google-code-export / gwt-test-utils

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

Problem with @UiConstructor which has non String arugments #162

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. In ui.xml file put an element which has constructor with non string 
arguments (like integer)
2. In test code instanciate the widget

What is the expected output? What do you see instead?

GwtTestUiBinderException is thrown.

What version of the product are you using? On what operating system?

gwt-test-utils 0.39,  GWT 2.4, Windows 7

Please provide any additional information below.

UiConstructorWidget has @UiConstrucotr with two arguments (int and enum).

StackTrace:

com.googlecode.gwt.test.exceptions.GwtTestUiBinderException: Error while 
calling @UiConstructor 'new UiConstructorWidget("5", "T1" );'
    at com.googlecode.gwt.test.uibinder.UiBinderInstanciator.instanciate(UiBinderInstanciator.java:167)
    at com.googlecode.gwt.test.uibinder.UiBinderInstanciator.getObjectFromUiConstructor(UiBinderInstanciator.java:91)
    at com.googlecode.gwt.test.uibinder.UiBinderInstanciator.getInstance(UiBinderInstanciator.java:40)
    at com.googlecode.gwt.test.uibinder.UiObjectTag.startTag(UiObjectTag.java:273)
    at com.googlecode.gwt.test.uibinder.UiTagBuilder.createUiTag(UiTagBuilder.java:153)
    at com.googlecode.gwt.test.uibinder.UiTagBuilder.startTag(UiTagBuilder.java:123)
    at com.googlecode.gwt.test.uibinder.UiXmlContentHandler.startElement(UiXmlContentHandler.java:70)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(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:50)
    at com.googlecode.gwt.test.uibinder.UiBinderInvocationHandler.createAndBindUi(UiBinderInvocationHandler.java:83)
    at com.googlecode.gwt.test.uibinder.UiBinderInvocationHandler.invoke(UiBinderInvocationHandler.java:34)
    at com.googlecode.gwt.test.uibinder.$Proxy60.createAndBindUi(Unknown Source)
    at com.googlecode.gwt.test.uibinder.UiBinderWithUiConstructor.<init>(UiBinderWithUiConstructor.java:22)
    at com.googlecode.gwt.test.uibinder.UiBinderWithUiConstructorTest.instanciation(UiBinderWithUiConstructorTest.java:15)
    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.InvokeMethod.evaluate(InvokeMethod.java:20)
    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.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
    at com.googlecode.gwt.test.internal.junit.GwtBlockJUnitParamsClassRunner.runChild(GwtBlockJUnitParamsClassRunner.java:75)
    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.junit.GwtBlockJUnit4ClassRunner.run(GwtBlockJUnit4ClassRunner.java:27)
    at com.googlecode.gwt.test.internal.junit.AbstractGwtRunner.run(AbstractGwtRunner.java:47)
    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)
Caused by: com.googlecode.gwt.test.exceptions.ReflectionException: Error during 
instanciation of 'com.googlecode.gwt.test.uibinder.UiConstructorWidget'. 
Illegal arguments for constructor
    at com.googlecode.gwt.test.utils.GwtReflectionUtils.instantiateClass(GwtReflectionUtils.java:527)
    at com.googlecode.gwt.test.uibinder.UiBinderInstanciator.instanciate(UiBinderInstanciator.java:150)
    ... 51 more
Caused by: java.lang.IllegalArgumentException: argument type mismatch
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.googlecode.gwt.test.utils.GwtReflectionUtils.instantiateClass(GwtReflectionUtils.java:518)
    ... 52 more

Original issue reported on code.google.com by tanaka.k...@gmail.com on 3 Sep 2012 at 2:58

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 4 Sep 2012 at 4:06

GoogleCodeExporter commented 9 years ago
I've just merged your pull request on github to fix this issue 
(https://github.com/gwt-test-utils/gwt-test-utils/pull/2).

Thank you very much :) A new 0.41-SNAPSHOT version is now available on sonatype 
oss maven repository.

Could you please confirm it's working so I could close this issue ?

Original comment by gael.laz...@gmail.com on 5 Sep 2012 at 6:05

GoogleCodeExporter commented 9 years ago
I confirmed it works fine with 0.41-SNAPSHOT.
Thank you very much!

Original comment by tanaka.k...@gmail.com on 5 Sep 2012 at 1:42

GoogleCodeExporter commented 9 years ago
Thank you again for your pull request :)

Original comment by gael.laz...@gmail.com on 5 Sep 2012 at 1:47