google-code-export / gwt-test-utils

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

"GwtTestUiBinderException: Found unexpected child element" is thrown when items are added to a ListBox widget inside of a UiBinder template #147

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download sample project. 
2. Execute GwtTestBuggedViewGwt.java as a unit test. You should see the 
following exception thrown when the unit test is loaded:

com.googlecode.gwt.test.exceptions.GwtTestUiBinderException: Found unexpected 
child element : <urn:import:com.google.gwt.user.client.ui:item> in 
com.google.gwt.user.client.ui.ListBox
    at com.googlecode.gwt.test.uibinder.UiObjectTag.appendElement(UiObjectTag.java:186)
    at com.googlecode.gwt.test.uibinder.UiObjectTag.addElement(UiObjectTag.java:65)
    at com.googlecode.gwt.test.uibinder.UiTagBuilder.endTag(UiTagBuilder.java:116)
    at com.googlecode.gwt.test.uibinder.UiXmlContentHandler.endElement(UiXmlContentHandler.java:41)
    at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLNSDTDValidator.endNamespaceScope(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.googlecode.gwt.test.uibinder.UiBinderParser.createUiComponent(UiBinderParser.java:54)
    at com.googlecode.gwt.test.uibinder.UiBinderInvocationHandler.createAndBindUi(UiBinderInvocationHandler.java:86)
    at com.googlecode.gwt.test.uibinder.UiBinderInvocationHandler.invoke(UiBinderInvocationHandler.java:35)
    at com.example.client.view.gwt.$Proxy15.createAndBindUi(Unknown Source)
    at com.example.client.view.gwt.BuggedViewGwt.<init>(BuggedViewGwt.java:27)
    at com.example.client.view.gwt.GwtTestBuggedViewGwt.init(GwtTestBuggedViewGwt.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.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at com.googlecode.gwt.test.internal.runner.AbstractGwtRunner.run(AbstractGwtRunner.java:40)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

What is the expected output? What do you see instead? The unit test should 
execute without error.

What version of the product are you using? On what operating system? Using 
gwt-test-utils 0.38 on Windows XP.

Please provide any additional information below. This error did not occur when 
I used the 0.35 version of gwt-test-utils. This error does not occur when using 
Google's gwt test framework.

Original issue reported on code.google.com by theamper...@gmail.com on 2 Jul 2012 at 8:58

GoogleCodeExporter commented 9 years ago
Here is the sample project: 
https://docs.google.com/open?id=0B44x63ym5RINSGN5dFdyb1BWdmM

Original comment by theamper...@gmail.com on 2 Jul 2012 at 9:01

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 3 Jul 2012 at 6:18

GoogleCodeExporter commented 9 years ago
Hi,

ListBox <ui:item> element are handled starting 0.39. I've updated your 
UiBinderBug project  gwt-test-utils dependency and the 
GwtTestBuggedViewGwt.testAsWidgetReturnsSelf() passed.

Could you please update to gwt-test-utils-0.39.jar and give me some feedback ?

Original comment by gael.laz...@gmail.com on 3 Jul 2012 at 6:38

GoogleCodeExporter commented 9 years ago
Tested using the 0.39 jar, and my project's failed test cases in my project are 
now working.

Original comment by theamper...@gmail.com on 3 Jul 2012 at 5:56

GoogleCodeExporter commented 9 years ago
great :)

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