Open GoogleCodeExporter opened 9 years ago
Original comment by gael.laz...@gmail.com
on 1 Jun 2011 at 8:17
The gwt-google-api are not supported (yet) by gwt-test-utils.
In your case, you could easily provide a patcher to stub the
VisualizationUtils.loadVisualizationAPi(..) method. It would be :
@PatchClass(VisualizationUtils.class)
public class VisualizationUtilsPatcher extends AutomaticPatcher {
@PatchMethod
public static void loadVisualizationApi(String version, Runnable onLoad,
JsArrayString packages) {
// do nothing instead of the orginial code
}
}
JsArrayXXX, which are part of the GWT core API, are not patched yet. I'm gonna
provide some support very soon, but I doubt it will be enough to get the
visualization API fully working with gwt-test-utils...
Original comment by gael.laz...@gmail.com
on 1 Jun 2011 at 11:51
Hi,
I created a patcher as you suggested. I still get the same issue. I added log4j
to see what patchers are being loaded and it seems the one I created is not
being used. Is there any other config I need to add for this to work?
I checked here:
http://code.google.com/p/gwt-test-utils/wiki/HowToWriteCustomPatchers but it
doesn't contain much info.
Regards.
Original comment by mchi...@intalio.com
on 1 Jun 2011 at 4:04
My mistake, I forgot to tell you to create a META-INF/gwt-test-utils.properties
file in your test classpath (src/test/resources if you are a maven user).
In this file, simply add this line :
your.package = scan-package
where your.package is the package of the VisualizationUtilsPatcher
scan-package tells gwt-test-utils to scan a package, searching for @PatchClass
to apply while loading classes.
Original comment by gael.laz...@gmail.com
on 1 Jun 2011 at 10:38
The corresponding wiki page will be updated soon, I promise !
Original comment by gael.laz...@gmail.com
on 1 Jun 2011 at 10:38
I just fixed the JsArrayString UnsatisfiedLinkError. It's available in the
lastest 0.30-SNAPSHOT (for gwt 2.3.0) and 0.28.4-SNAPSHOT (for gwt 2.2.0).
But I'm not sure it will entirely solve the full Visualization API
compatibility..
Original comment by gael.laz...@gmail.com
on 3 Jun 2011 at 4:13
Hi,
thanks for the quick update. Now, I'm using the 0.28.4-SNAPSHOT in another test
(it also involves visualization code) and I have my VisualizationUtilsPatcher
configured properly. This time I get this:
java.lang.NoClassDefFoundError: com/google/gwt/visualization/client/DataTable
at org.ebayopensource.turmeric.monitoring.client.presenter.DashboardPresenter.initTabPresenters(DashboardPresenter.java:203)
at org.ebayopensource.turmeric.monitoring.client.presenter.DashboardPresenter.<init>(DashboardPresenter.java:73)
at org.ebayopensource.turmeric.monitoring.client.presenter.MenuController.initPresenters(MenuController.java:175)
at org.ebayopensource.turmeric.monitoring.client.presenter.MenuController.<init>(MenuController.java:81)
at org.ebayopensource.turmeric.monitoring.client.AppController.initPresenters(AppController.java:84)
at org.ebayopensource.turmeric.monitoring.client.AppController.<init>(AppController.java:56)
at org.ebayopensource.turmeric.monitoring.test.ServicePresenterTest.setUp(ServicePresenterTest.java:50)
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.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
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.runners.ParentRunner.run(ParentRunner.java:236)
at com.octo.gwt.test.GwtRunnerBase.run(GwtRunnerBase.java:63)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.Surefire.run(Surefire.java:109)
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.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1017)
Caused by: java.lang.ClassNotFoundException: caught an exception while
obtaining a class file for com.google.gwt.visualization.client.DataTable
at javassist.Loader.findClass(Loader.java:359)
at javassist.Loader.loadClass(Loader.java:311)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 35 more
Caused by: com.octo.gwt.test.exceptions.GwtTestPatchException: Unable to
compile body { return (com.google.gwt.visualization.client.DataTable)
com.octo.gwt.test.internal.patchers.dom.JavaScriptObjects.getObject(this,
"create"); }
at com.octo.gwt.test.internal.utils.GwtPatcherUtils.replaceImplementation(GwtPatcherUtils.java:161)
at com.octo.gwt.test.internal.utils.GwtPatcherUtils.patch(GwtPatcherUtils.java:94)
at com.octo.gwt.test.internal.GwtTranslator.applyPatcher(GwtTranslator.java:83)
at com.octo.gwt.test.internal.GwtTranslator.patchClass(GwtTranslator.java:119)
at com.octo.gwt.test.internal.GwtTranslator.onLoad(GwtTranslator.java:38)
at javassist.Loader.findClass(Loader.java:340)
... 37 more
Caused by: javassist.CannotCompileException: [source error] not-available: this
at javassist.CtBehavior.setBody(CtBehavior.java:409)
at javassist.CtBehavior.setBody(CtBehavior.java:375)
at com.octo.gwt.test.internal.utils.GwtPatcherUtils.replaceImplementation(GwtPatcherUtils.java:159)
... 42 more
Caused by: compile error: not-available: this
at javassist.compiler.CodeGen.atKeyword(CodeGen.java:1874)
at javassist.compiler.ast.Keyword.accept(Keyword.java:34)
at javassist.compiler.JvstCodeGen.atMethodArgs(JvstCodeGen.java:357)
at javassist.compiler.MemberCodeGen.atMethodCallCore(MemberCodeGen.java:555)
at javassist.compiler.MemberCodeGen.atCallExpr(MemberCodeGen.java:523)
at javassist.compiler.JvstCodeGen.atCallExpr(JvstCodeGen.java:243)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45)
at javassist.compiler.CodeGen.checkCastExpr(CodeGen.java:1389)
at javassist.compiler.CodeGen.atCastExpr(CodeGen.java:1363)
at javassist.compiler.JvstCodeGen.atCastExpr(JvstCodeGen.java:177)
at javassist.compiler.ast.CastExpr.accept(CastExpr.java:54)
at javassist.compiler.CodeGen.compileExpr(CodeGen.java:229)
at javassist.compiler.CodeGen.atReturnStmnt2(CodeGen.java:597)
at javassist.compiler.JvstCodeGen.atReturnStmnt(JvstCodeGen.java:424)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:362)
at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:350)
at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:291)
at javassist.compiler.Javac.compileBody(Javac.java:222)
at javassist.CtBehavior.setBody(CtBehavior.java:401)
... 44 more
I checked my config (I'm using maven3), and it seems I have my jar in the
classpath. Perhaps if I add another Patcher it could do the trick?. If not, I
might have to simply skip that part in the tests for now.
Any thoughts?
Regards.
Original comment by mchi...@intalio.com
on 3 Jun 2011 at 10:04
I improved this stack trace so I could figured out the problem easier.
Could you please update to the lastest 0.28.4-SNAPSHOT and rerun your test to
post the new stack trace ?
Thank you very much !
Original comment by gael.laz...@gmail.com
on 5 Jun 2011 at 6:18
Note that the patcher wiki page has been updated :
http://code.google.com/p/gwt-test-utils/wiki/HowToWriteCustomPatchers
Original comment by gael.laz...@gmail.com
on 23 Jun 2011 at 8:52
Original comment by gael.laz...@gmail.com
on 29 Nov 2011 at 2:54
Original issue reported on code.google.com by
mchi...@intalio.com
on 31 May 2011 at 7:00