0

Zats throws unhelpful NullPointerException

asked 2013-11-13 11:05:51 +0800

Loekke gravatar image Loekke
15 2

I'm trying to use Zats to test my ZK site.

I have this testcase (TestNG):

public class AccountZulTest {
    private static DefaultZatsEnvironment env;

    @BeforeClass
    public static void init() {
        env = new DefaultZatsEnvironment("./pguard-ui/src/test/webapp/WEB-INF");
        env.init("./pguard-ui/src/main/webapp");
    }

    @AfterClass
    public static void end() {
        env.destroy();
    }

    @AfterMethod
    public void after() {
        env.cleanup();
    }

    @Test
    public void test() {
        Client client = env.newClient();
        DesktopAgent desktop = client.connect("/account.zul");
    }
}

Which throws this rather unhelpful Exception:

org.zkoss.zats.ZatsException
    at org.zkoss.zats.mimic.impl.EmulatorClient.connect(EmulatorClient.java:129)
    at com.capasystems.ui.AccountZulTest.test(AccountZulTest.java:41)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:715)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:907)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1237)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    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:51)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:85)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1197)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1122)
    at org.testng.TestNG.run(TestNG.java:1030)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:111)
Caused by: java.lang.NullPointerException
    at org.zkoss.zats.mimic.impl.DefaultDesktopAgent.getId(DefaultDesktopAgent.java:42)
    at org.zkoss.zats.mimic.impl.EmulatorClient.connect(EmulatorClient.java:108)
    ... 26 more

Any ideas?

delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-11-13 11:05:51 +0800

Seen: 14 times

Last updated: Nov 13 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More