Wednesday, July 30, 2014

Unable to find class _FieldSerializer

I have problems with testing GWT. I have an object (called DatabaseConnection), which I want to store in my test. For this I am using an asynchronous callback. Afterwards, I want to test some things about the object, but my test fails before it actually stores the object. I got the following exception:

java.lang.RuntimeException: Unable to find class DatabaseConnection_FieldSerializer

I have serval tests, which have to store the object to do the actual testing. When I execute each test by itselfs, everthing works fine. Also when I click through the frontend everything works. But when I try to execute all my GWT tests I got the error message above.

My tests are looking like this:

 public void testObject() {
   
// Setup
   
TestHelper.resetDatabaseSync();

   
DatabaseConnection dbConnection = new DatabaseConnection();
   
TestHelper.storeDatabaseConnection(dbConnection, new AsyncCallback<Long>() {
     
@Override
     
public void onFailure(Throwable caught) {
       
// Here the test fails!
       
System.out.println(caught.getMessage());
        fail
();
     
}

     
@Override
     
public void onSuccess(Long id) {
     
}
   
});
   
   
Timer timer = new Timer() {
     
@Override
     
public void run() {
       
// Do something with the object
       
// For example creating a dropdown, which is automatically filled with all stored objects in the database
       
// Validate something

       
// Cleanup
       
TestHelper.resetDatabaseSync();

        finishTest
();
     
}
   
};

    delayTestFinish
(8000);

   
// Waiting for asynchronous calls to finish.
    timer
.schedule(4000);
 
}


I could not find any helpful solutions on the web. Does someone have an idea? It seems that my tests somehow depend on each other...

Thanks!

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment