我怎样才能使用gwt-test-utils来处理杜松子酒?

时间:2023-01-24 18:17:14

i tried using the steps in http://code.google.com/p/gwt-test-utils/wiki/HowToUseWithGIN and i'm using testNG but it is giving fallowing error

我尝试使用http://code.google.com/p/gwt-test-utils/wiki/HowToUseWithGIN中的步骤,我正在使用testNG,但它给出了以下错误

java.lang.ExceptionInInitializerError
    at com.riskfocus.examples.JsonReaderWriterTest.setupGIN(JsonReaderWriterTest.java:59)
    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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:551)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
    at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107)
    at org.testng.TestRunner.privateRun(TestRunner.java:768)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
    at org.testng.TestNG.run(TestNG.java:1022)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:109)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:202)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:173)
Caused by: java.lang.UnsupportedOperationException: ERROR: GWT.create() is only usable in client code!  It cannot be called, for example, from server code.  If you are running a unit test, check that your test case extends GWTTestCase and that GWT.create() is not called from within an initializer or constructor.
    at com.google.gwt.core.client.GWT.create(GWT.java:91)
    at com.riskfocus.examples.client.model.StockPriceJsonReaderWriter.<clinit>(StockPriceJsonReaderWriter.java:12)
    ... 25 more

1 个解决方案

#1


0  

I guess you forget to extends the GwtTest class (which substitute the standard GWTTestCase class).

我猜你忘了扩展GwtTest类(它取代了标准的GWTTestCase类)。

The gwt-test-utils / GIN integration wiki page didn't tell to do so (my bad), this has been corrected :)

gwt-test-utils / GIN集成维基页面没有告诉我这样做(我的坏),这已经得到纠正:)

#1


0  

I guess you forget to extends the GwtTest class (which substitute the standard GWTTestCase class).

我猜你忘了扩展GwtTest类(它取代了标准的GWTTestCase类)。

The gwt-test-utils / GIN integration wiki page didn't tell to do so (my bad), this has been corrected :)

gwt-test-utils / GIN集成维基页面没有告诉我这样做(我的坏),这已经得到纠正:)