google-code-export / gwt-test-utils

Automatically exported from code.google.com/p/gwt-test-utils
1 stars 0 forks source link

GXT, FormPanel & MessageBox #152

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Try to use gwt-test-utils 0.39 with GWT 2.4.0, GXT 2.2.5 and Mockito with a 
simple test case.

public class Problems extends GwtTestWithMockito { 

   @Test 
   public void testForm() { 
       FormPanel formPanel = new FormPanel(); 
       GXT & renderField Options .add(new TextField<String>()); 

       RootPanel.get().add(formPanel); 
   } 

   @Test 
   public void testMessageBox() { 
       MessageBox.wait("title", "message", null); 
   } 

   @Override 
   public String getModuleName() { 
       return "com.mycompany.gwt.myproject.Data"; 
   } 

} 

==========================================================

Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 2.297 sec <<< 
FAILURE!
testForm(com.mycompany.gwt.myproject.client.widgets.Problems)  Time elapsed: 
0.922 sec  <<< ERROR!
java.lang.ExceptionInInitializerError
    at com.googlecode.html.HTMLConfiguration.reset(HTMLConfiguration.java:584)
    at com.googlecode.html.HTMLConfiguration.setInputSource(HTMLConfiguration.java:475)
    at com.googlecode.html.HTMLConfiguration.parse(HTMLConfiguration.java:451)
    at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1169)
    at com.googlecode.gwt.test.internal.utils.GwtHtmlParser.parse(GwtHtmlParser.java:99)
    at com.googlecode.gwt.test.internal.patchers.dom.DocumentPatcher.parseHTMLElement(DocumentPatcher.java:273)
    at com.googlecode.gwt.test.internal.patchers.dom.DocumentPatcher.nativeGet(DocumentPatcher.java:147)
    at com.google.gwt.dom.client.Document.nativeGet(Document.java)
    at com.google.gwt.dom.client.Document.get(Document.java:46)
    at com.google.gwt.user.client.DOM.createDiv(DOM.java:149)
    at com.extjs.gxt.ui.client.GXT.init(GXT.java:263)
    at com.extjs.gxt.ui.client.widget.Component.<clinit>(Component.java:203)
    at com.mycompany.gwt.myproject.client.widgets.Problems.testForm(Problems.java:25)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
    at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
    at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
    at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
    at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
    at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
    at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
    at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
    at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
    at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
    at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
    at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
    at com.googlecode.gwt.test.internal.runner.AbstractGwtRunner.run(AbstractGwtRunner.java:40)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
    at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
    at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
Caused by: java.lang.IllegalStateException: Failed to create XercesBridge 
instance
    at com.googlecode.html.xercesbridge.XercesBridge.makeInstance(XercesBridge.java:59)
    at com.googlecode.html.xercesbridge.XercesBridge.<clinit>(XercesBridge.java:32)
    ... 43 more
testMessageBox(com.mycompany.gwt.myproject.client.widgets.Problems)  Time 
elapsed: 0.016 sec  <<< ERROR!
java.lang.NoClassDefFoundError: com.extjs.gxt.ui.client.widget.ContentPanel
    at com.extjs.gxt.ui.client.widget.MessageBox.getDialog(MessageBox.java:337)
    at com.extjs.gxt.ui.client.widget.MessageBox.show(MessageBox.java:746)
    at com.extjs.gxt.ui.client.widget.MessageBox.wait(MessageBox.java:250)
    at com.mycompany.gwt.myproject.client.widgets.Problems.testMessageBox(Problems.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
    at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
    at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
    at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
    at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
    at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
    at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
    at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
    at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
    at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
    at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
    at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
    at com.googlecode.gwt.test.internal.runner.AbstractGwtRunner.run(AbstractGwtRunner.java:40)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
    at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
    at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)

Original issue reported on code.google.com by jojo...@gmail.com on 24 Jul 2012 at 6:14

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 24 Jul 2012 at 6:52

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 31 Jul 2012 at 5:47

GoogleCodeExporter commented 9 years ago
Hi, 

I just deployed a new 0.40-SNAPSHOT which provides support for GXT2 MessageBox. 
Could you please give it a try and post some feedback ?
Before updating, you should carefully read this wiki page : 
http://code.google.com/p/gwt-test-utils/wiki/MigrationTo040

FormPanel should already been supported. I didn't understand your test case (I 
don't know GXT very well.. :x). Could you please provide another example ?

Original comment by gael.laz...@gmail.com on 31 Jul 2012 at 6:33