Forum Discussion

CXin's avatar
CXin
Frequent Contributor
15 years ago

Can't run the sample of integration with JUnit

Hello there,

I have read the article about how to integrate soapUI with JUnit. However the sample doesn't work for me. Could you please take a look?
http://www.soapui.org/Test-Automation/i ... junit.html

PS: junit-4.4.jar, soapui-3.6.1.jar, soapui-coverage-xmlbeans-3.6.1.jar and soapui-xmlbeans-3.6.1.jar are already included into the build path and there is no build error.



Here is the error when I run the example test:
Line 15: SoapUITestCaseRunner runner = new SoapUITestCaseRunner();

java.lang.NoClassDefFoundError: org.apache.log4j.Layout
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
at java.lang.J9VMInternals.verify(J9VMInternals.java:70)
at java.lang.J9VMInternals.verify(J9VMInternals.java:70)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
at com.test.soapui.tests.SampleTest.testRunner(SampleTest.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:51)
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: java.lang.ClassNotFoundException: org.apache.log4j.Layout
at java.net.URLClassLoader.findClass(URLClassLoader.java:419)
at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:320)
at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
... 25 more

4 Replies

  • Hi!

    You will need to add all jars in the soapUI-pro\libs folder, in this specific case the log4j jar seems to be missing.

    Hope this helps!

    regards,

    /Ole
    eviware.com
  • CXin's avatar
    CXin
    Frequent Contributor
    Thanks! it works now.
    Anther favor is needed. How should I open composite project?
  • Hi!

    you would need to use the WsdlProjectPro class instead and specify the folder of the composite project to the constructor.

    Hope this helps!

    regards,

    /Ole
    eviware.com