vendredi 2 août 2019

ZK Application Test Suite (ZATS) return java.lang.NoClassDefFoundError: org/zkoss/zats/ZatsException

I'm starting my first zats-test that follow the example at ZK.

But it returned this error:

java.lang.NoClassDefFoundError: org/zkoss/zats/ZatsException

This is my test case


public class LoginControllerTest {

    @BeforeClass
    public static void init() {
        Zats.init("./WebContent");
    }

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

    @After
    public void after() {
        Zats.cleanup();
    }

    @Test
    public void test() {
        DesktopAgent desktop = Zats.newClient().connect("/index.zul");

        ComponentAgent button = desktop.query("button");
        ComponentAgent label = desktop.query("label");

        button.as(ClickAgent.class).click();
        button.click();
        Assert.assertEquals("Hello Mimic", label.as(Label.class).getValue());
    }
}

I've received this:

java.lang.NoClassDefFoundError: org/zkoss/zats/ZatsException

    at testing.LoginControllerTest.init(LoginControllerTest.java:16)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ClassNotFoundException: org.zkoss.zats.ZatsException
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 16 more


Aucun commentaire:

Enregistrer un commentaire