> -----Original Message----- > From: souciance [mailto:souciance.eqdam.ras...@gmail.com] > Sent: Wednesday, March 29, 2017 1:31 PM > To: users@camel.apache.org > Subject: Re: Issues running unit tests based on CamelTestSupport > > How does your pom look where you run the tests`?
I assume what you really mean to ask is what the dependency tree looks like. I'll save the bytes required to show that (long) output and just refer to the StackOverflow posting I made about this problem: http://stackoverflow.com/questions/43104390/camel-unit-test-fails-with-ncdfe-for-testwatcher . > On Wed, Mar 29, 2017 at 10:27 PM, KARR, DAVID [via Camel] < > ml-node+s465427n5796717...@n5.nabble.com> wrote: > > > > -----Original Message----- > > > From: KARR, DAVID > > > Sent: Wednesday, March 29, 2017 12:47 PM > > > To: [hidden email] > > <https://urldefense.proofpoint.com/v2/url?u=http-3A___user_SendEmail.j > > tp-3Ftype-3Dnode-26node-3D5796717-26i-3D0&d=DwICAg&c=LFYZ-o9_HUMeMTSQi > > cvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=WVUo4fvEV5e8nk1T4LBfDEes0uVjs05uBKuPy > > OKcQBA&s=2JuYkMGcppngbjslA8_aXHrN3xfDRD9dJP1naC6vGs0&e= > > > > Subject: RE: Issues running unit tests based on CamelTestSupport > > > > > > > -----Original Message----- > > > > From: KARR, DAVID > > > > Sent: Wednesday, March 29, 2017 12:07 PM > > > > To: [hidden email] > > <https://urldefense.proofpoint.com/v2/url?u=http-3A___user_SendEmail.j > > tp-3Ftype-3Dnode-26node-3D5796717-26i-3D1&d=DwICAg&c=LFYZ-o9_HUMeMTSQi > > cvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=WVUo4fvEV5e8nk1T4LBfDEes0uVjs05uBKuPy > > OKcQBA&s=_sTR37L8mIWFmH67gwqx5tPsWObn5mhGOMYGPTWCmSM&e= > > > > > Subject: Issues running unit tests based on CamelTestSupport > > > > > > > > I have only used Camel peripherally before. I'm trying to get > > > > some unit tests working that are based on CamelTestSupport. When > > > > I run "mvn install" from the command line, the tests attempt to > > > > execute, but I get errors like this: > > > > > > > > ------------------- > > > > [ERROR] Failed to execute goal > > > > org.apache.maven.plugins:maven-surefire- > > > > plugin:2.19.1:test (default-test) on project ...: Execution > > > > default-test of goal > > > > org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test > > > > failed: There was an error in the forked process [ERROR] > > > > java.lang.NoClassDefFoundError: org/junit/rules/TestWatcher > > > > [ERROR] > > at > > > > java.lang.ClassLoader.defineClass1(Native Method) [ERROR] at > > > > java.lang.ClassLoader.defineClass(ClassLoader.java:763) > > > > [ERROR] at > > > > java.security.SecureClassLoader.defineClass(SecureClassLoader.java > > > > :142 > > > > > > ) [ERROR] at > > > > java.net.URLClassLoader.defineClass(URLClassLoader.java:467) > > > > [ERROR] at > > > > java.net.URLClassLoader.access$100(URLClassLoader.java:73) > > > > [ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:368) > > > > [ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:362) > > > > [ERROR] at java.security.AccessController.doPrivileged(Native > > > > Method) [ERROR] at > > > > java.net.URLClassLoader.findClass(URLClassLoader.java:361) > > > > [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) > > > > [ERROR] at > > > > sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) > > > > [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > > > > [ERROR] at java.lang.Class.getDeclaredMethods0(Native Method) > > > > [ERROR] at > > > > java.lang.Class.privateGetDeclaredMethods(Class.java:2701) > > > > [ERROR] at > > > > java.lang.Class.privateGetMethodRecursive(Class.java:3048) > > > > [ERROR] at java.lang.Class.getMethod0(Class.java:3018) > > > > [ERROR] at > > > > java.lang.Class.privateGetMethodRecursive(Class.java:3058) > > > > [ERROR] at java.lang.Class.getMethod0(Class.java:3018) > > > > [ERROR] at java.lang.Class.getMethod(Class.java:1784) > > > > [ERROR] at > > > > org.apache.maven.surefire.util.ReflectionUtils.tryGetMethod(Reflec > > > > tion > > > > > > Ut > > > > ils.java:61) > > > > ----------------- > > > > > > > > I've verified that this class is in the junit artifact, which is > > > > set as a dependency in the module (test scope). Is there > > > > something funky about how Camel tests execute that are not obvious > to me? > > > > > > After some more digging, I see that the "camel-test" artifact > > > references the "org.junit.rules.TestName" class, which in some older > > > versions of Junit (4.12 for instance) extends a "TestWatcher" class, > > > although in newer versions that is changed to "TestWatchman". I > > > still can't figure out the root cause for this. > > > > I'm specifying the use of Junit 4.8.1 in my dependencies. In Eclipse, > > if I manually add the Junit 4.12 jar to the end of the classpath for > > my test configuration, it gets past this error. That's not really a > > workable solution, but it's at least some information. > > > > > > > > ------------------------------ > > If you reply to this email, your message will be added to the > > discussion > > below: > > https://urldefense.proofpoint.com/v2/url?u=http-3A__camel.465427.n5.na > > bble.com_Issues-2Drunning-2Dunit-2Dtests-2D&d=DwICAg&c=LFYZ-o9_HUMeMTS > > QicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=WVUo4fvEV5e8nk1T4LBfDEes0uVjs05uBKu > > PyOKcQBA&s=VO9fI7GQY7ayiGJG2d30vHiUlRKNjJ4k4C_meV1nrQY&e= > > based-on-CamelTestSupport-tp5796711p5796717.html > > To start a new topic under Camel - Users, email > > ml-node+s465427n465428...@n5.nabble.com > > To unsubscribe from Camel - Users, click here > > <https://urldefense.proofpoint.com/v2/url?u=http-3A__camel.465427.n5.n > > abble.com_template_NamlServlet.jtp-3Fmacro-3Dunsubscribe-5Fby-5Fcode- > 26node-3D465428-26code- > 3Dc291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY- > 3D&d=DwICAg&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn- > xy2uk0vYF_EA&m=WVUo4fvEV5e8nk1T4LBfDEes0uVjs05uBKuPyOKcQBA&s=l9sg6RDjErw > -YXA1hzUl9wo_el0Gm_MCg5tz-POM3xY&e= > . > > NAML > > <https://urldefense.proofpoint.com/v2/url?u=http-3A__camel.465427.n5.n > > abble.com_template_NamlServlet.jtp-3Fmacro-3Dmacro-5Fviewer-26id-3Dins > > tant-5Fhtml-2521nabble-253Aemail.naml-26base-3Dnabble.naml.namespaces. > > BasicNamespace-2Dnabble.view.web.template.NabbleNamespace-2Dnabble.vie > > w.web.template.NodeNamespace-26breadcrumbs-3Dnotify-5Fsubscribers-2521 > > nabble-253Aemail.naml-2Dinstant-5Femails-2521nabble-253Aemail.naml-2Ds > > end-5Finstant-5Femail-2521nabble-253Aemail.naml&d=DwICAg&c=LFYZ-o9_HUM > > eMTSQicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=WVUo4fvEV5e8nk1T4LBfDEes0uVjs05 > > uBKuPyOKcQBA&s=s6ufrFq94A-jLZxsae5Nm2ISwsP5mv-pwuzdyG3Yx98&e= > > > > > > > > -- > View this message in context: > https://urldefense.proofpoint.com/v2/url?u=http- > 3A__camel.465427.n5.nabble.com_Issues-2Drunning-2Dunit-2Dtests-2Dbased- > 2Don-2DCamelTestSupport-2Dtp5796711p5796718.html&d=DwICAg&c=LFYZ- > o9_HUMeMTSQicvjIg&r=OsTemSXEn- > xy2uk0vYF_EA&m=WVUo4fvEV5e8nk1T4LBfDEes0uVjs05uBKuPyOKcQBA&s=RY5OuEc- > 9RTuhqjisVK0b_ZGPOM-u-Lstyc3PObtgnk&e= > Sent from the Camel - Users mailing list archive at Nabble.com.