You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "KARR, DAVID" <dk...@att.com> on 2017/03/29 19:06:44 UTC

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(ReflectionUtils.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?

Re: Issues running unit tests based on CamelTestSupport

Posted by souciance <so...@gmail.com>.
I am not sure seems to indicate that it it cannot find the junit rule
called TestWatcher. I don't think this is Camel related. I run those tests
with Junit and various rules and works fine. Seem if that rule is added to
your dependency.

On Wed, Mar 29, 2017 at 9:07 PM, KARR, DAVID [via Camel] <
ml-node+s465427n5796711h4@n5.nabble.com> wrote:

> 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(ReflectionUtils.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?
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Issues-running-unit-tests-
> based-on-CamelTestSupport-tp5796711.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Issues-running-unit-tests-based-on-CamelTestSupport-tp5796711p5796712.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: Issues running unit tests based on CamelTestSupport

Posted by "KARR, DAVID" <dk...@att.com>.
> -----Original Message-----
> From: souciance [mailto:souciance.eqdam.rashti@gmail.com]
> Sent: Wednesday, March 29, 2017 9:50 PM
> To: users@camel.apache.org
> Subject: Re: Issues running unit tests based on CamelTestSupport
> 
> Hard to say but might because due to conflict here:
> 
> junit:junit:jar:4.8.1:test[INFO] +-
> org.mockito:mockito-core:jar:1.10.19:test[INFO] |  +-
> org.hamcrest:hamcrest-core:jar:1.3:test[INFO] |  \-
> org.objenesis:objenesis:jar:2.1:test[INFO] +- org.slf4j:slf4j-
> api:jar:1.7.6:provided[INFO] +-
> org.apache.aries.blueprint:org.apache.aries.blueprint.annotation.api:jar
> :1.0.0:provided[INFO]
> +- org.ops4j.pax.exam:pax-exam-junit4:jar:4.9.1:test
> 
> Your junit is at 4.8.1 and your pax exam junit is 4.9.1 and it says that
> from 4.9.1 TestWatcher replaces TestWatchMan

For some reason I was seeing "4.12" and "4.8.1" and thinking that the latter was newer than the former.  Duh. It's clear now that upgrading from 4.8.1 to 4.12 is the correct solution.

> On Wed, Mar 29, 2017 at 11:24 PM, KARR, DAVID [via Camel] <
> ml-node+s465427n5796720h83@n5.nabble.com> wrote:
> 
> > > -----Original Message-----
> > > From: souciance [mailto:[hidden email]
> > <https://urldefense.proofpoint.com/v2/url?u=http-3A___user_SendEmail.j
> > tp-3Ftype-3Dnode-26node-3D5796720-26i-3D0&d=DwICAg&c=LFYZ-o9_HUMeMTSQi
> > cvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=K6bdm2r24hPZLUy_0Iqt-6PCc3AoroSRFSgis
> > iXrNfc&s=Da3FNt2l-43lADcsFhu1d1cU6v54LjrumN2WwUe_UwM&e= >]
> > > Sent: Wednesday, March 29, 2017 1:31 PM
> > > To: [hidden email]
> > <https://urldefense.proofpoint.com/v2/url?u=http-3A___user_SendEmail.j
> > tp-3Ftype-3Dnode-26node-3D5796720-26i-3D1&d=DwICAg&c=LFYZ-o9_HUMeMTSQi
> > cvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=K6bdm2r24hPZLUy_0Iqt-6PCc3AoroSRFSgis
> > iXrNfc&s=jvvge5_QLQW8-GlwKia3C904VqUTF6z8uckOrj9aTrw&e= >
> > > 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:
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__stackoverflow.com_
> > questions_43104390_camel-2Dunit-2D&d=DwICAg&c=LFYZ-o9_HUMeMTSQicvjIg&r
> > =OsTemSXEn-xy2uk0vYF_EA&m=K6bdm2r24hPZLUy_0Iqt-6PCc3AoroSRFSgisiXrNfc&
> > s=tqMks4dmVGmoK__pC7EhtOJWBWIIJOz4EgE2bFxYfTg&e=
> > test-fails-with-ncdfe-for-testwatcher .
> >
> > > On Wed, Mar 29, 2017 at 10:27 PM, KARR, DAVID [via Camel] < [hidden
> > > email]
> > > <https://urldefense.proofpoint.com/v2/url?u=http-3A___user_SendEmail
> > > .jtp-3Ftype-3Dnode-26node-3D5796720-26i-3D2&d=DwICAg&c=LFYZ-o9_HUMeM
> > > TSQicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=K6bdm2r24hPZLUy_0Iqt-6PCc3AoroS
> > > RFSgisiXrNfc&s=IRM_DJLHQU-oQiTFVdq1SjxWCNE2q42bwi9ivcRHlZg&e= >>
> > 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_SendEma
> > > > il.j> > >
> > > > tp-3Ftype-3Dnode-26node-3D5796717-26i-3D0&d=DwICAg&c=LFYZ-o9_HUMeM
> > > > TSQi
> >
> > > > cvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=WVUo4fvEV5e8nk1T4LBfDEes0uVjs05uB
> > > > KuPy
> >
> > > > 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_SendEma
> > > > il.j> > >
> > > > tp-3Ftype-3Dnode-26node-3D5796717-26i-3D1&d=DwICAg&c=LFYZ-o9_HUMeM
> > > > TSQi
> >
> > > > cvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=WVUo4fvEV5e8nk1T4LBfDEes0uVjs05uB
> > > > KuPy
> >
> > > > 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(Re
> > > > > > flec
> >
> > > > > > 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.n
> > > > 5.na
> > > > bble.com_Issues-2Drunning-2Dunit-2Dtests-2D&d=DwICAg&c=LFYZ-o9_HUM
> > > > eMTS
> >
> > > > QicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=WVUo4fvEV5e8nk1T4LBfDEes0uVjs05
> > > > uBKu
> >
> > > > PyOKcQBA&s=VO9fI7GQY7ayiGJG2d30vHiUlRKNjJ4k4C_meV1nrQY&e=
> > > > based-on-CamelTestSupport-tp5796711p5796717.html
> > > > To start a new topic under Camel - Users, email [hidden email]
> > > > <https://urldefense.proofpoint.com/v2/url?u=http-3A___user_SendEma
> > > > il.jtp-3Ftype-3Dnode-26node-3D5796720-26i-3D3&d=DwICAg&c=LFYZ-o9_H
> > > > UMeMTSQicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=K6bdm2r24hPZLUy_0Iqt-6PCc
> > > > 3AoroSRFSgisiXrNfc&s=BIyiZ4leMvRH3m_srAJnHodp5FWVwyQCw5d4w4JMoL4&e
> > > > = > 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-5Fco
> > > > de-
> > > 26node-3D465428-26code-
> > > 3Dc291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NT
> > > Y-
> > > 3D&d=DwICAg&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-
> > > xy2uk0vYF_EA&m=WVUo4fvEV5e8nk1T4LBfDEes0uVjs05uBKuPyOKcQBA&s=l9sg6RD
> > > jErw
> >
> > > -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-3
> > > > Dins
> >
> > > > 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=WVUo4fvEV5e8nk1T4LBfDEes0uV
> > > > js05
> >
> > > > 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-2Dbas
> > > ed-
> > > 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.
> >
> >
> > ------------------------------
> > 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=K6bdm2r24hPZLUy_0Iqt-6PCc3AoroSRFSg
> > isiXrNfc&s=AJ9K4I6d6YsFv8Vz4AHnqOV3yLF_2WQWwfggnLUbWjo&e=
> > based-on-CamelTestSupport-tp5796711p5796720.html
> > To start a new topic under Camel - Users, email
> > ml-node+s465427n465428h31@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=K6bdm2r24hPZLUy_0Iqt-
> 6PCc3AoroSRFSgisiXrNfc&s=3u5ZDyQUkTEgjM7FQOZ5K_EjA2s3skqbIHdV_oxHD9Y&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=K6bdm2r24hPZLUy_0Iqt-6PCc3AoroS
> > RFSgisiXrNfc&s=HlrSv9XA6HBF6LiDYwhvmbtJ9Sn2d2WinJYMUL7FFO8&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-2Dtp5796711p5796726.html&d=DwICAg&c=LFYZ-
> o9_HUMeMTSQicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=K6bdm2r24hPZLUy_0Iqt-
> 6PCc3AoroSRFSgisiXrNfc&s=FzXuSkf9XmrgjnI7l2vKJUgPiOOvMCTxeR1EMdjonZI&e=
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Issues running unit tests based on CamelTestSupport

Posted by souciance <so...@gmail.com>.
Hard to say but might because due to conflict here:

junit:junit:jar:4.8.1:test[INFO] +-
org.mockito:mockito-core:jar:1.10.19:test[INFO] |  +-
org.hamcrest:hamcrest-core:jar:1.3:test[INFO] |  \-
org.objenesis:objenesis:jar:2.1:test[INFO] +-
org.slf4j:slf4j-api:jar:1.7.6:provided[INFO] +-
org.apache.aries.blueprint:org.apache.aries.blueprint.annotation.api:jar:1.0.0:provided[INFO]
+- org.ops4j.pax.exam:pax-exam-junit4:jar:4.9.1:test

Your junit is at 4.8.1 and your pax exam junit is 4.9.1 and it says that
from 4.9.1 TestWatcher replaces TestWatchMan

On Wed, Mar 29, 2017 at 11:24 PM, KARR, DAVID [via Camel] <
ml-node+s465427n5796720h83@n5.nabble.com> wrote:

> > -----Original Message-----
> > From: souciance [mailto:[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5796720&i=0>]
> > Sent: Wednesday, March 29, 2017 1:31 PM
> > To: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5796720&i=1>
> > 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] <
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5796720&i=2>>
> 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
> > > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5796720&i=3>
> > > 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.
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Issues-running-unit-tests-
> based-on-CamelTestSupport-tp5796711p5796720.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Issues-running-unit-tests-based-on-CamelTestSupport-tp5796711p5796726.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: Issues running unit tests based on CamelTestSupport

Posted by "KARR, DAVID" <dk...@att.com>.
> -----Original Message-----
> From: souciance [mailto:souciance.eqdam.rashti@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+s465427n5796717h90@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+s465427n465428h31@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.

Re: Issues running unit tests based on CamelTestSupport

Posted by souciance <so...@gmail.com>.
How does your pom look where you run the tests`?

On Wed, Mar 29, 2017 at 10:27 PM, KARR, DAVID [via Camel] <
ml-node+s465427n5796717h90@n5.nabble.com> wrote:

> > -----Original Message-----
> > From: KARR, DAVID
> > Sent: Wednesday, March 29, 2017 12:47 PM
> > To: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5796717&i=0>
> > 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]
> <http:///user/SendEmail.jtp?type=node&node=5796717&i=1>
> > > 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(Reflection
>
> > > 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:
> http://camel.465427.n5.nabble.com/Issues-running-unit-tests-
> based-on-CamelTestSupport-tp5796711p5796717.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Issues-running-unit-tests-based-on-CamelTestSupport-tp5796711p5796718.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: Issues running unit tests based on CamelTestSupport

Posted by "KARR, DAVID" <dk...@att.com>.
> -----Original Message-----
> From: KARR, DAVID
> Sent: Wednesday, March 29, 2017 12:47 PM
> To: users@camel.apache.org
> Subject: RE: Issues running unit tests based on CamelTestSupport
> 
> > -----Original Message-----
> > From: KARR, DAVID
> > Sent: Wednesday, March 29, 2017 12:07 PM
> > To: users@camel.apache.org
> > 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(Reflection
> > 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.


RE: Issues running unit tests based on CamelTestSupport

Posted by "KARR, DAVID" <dk...@att.com>.
> -----Original Message-----
> From: KARR, DAVID
> Sent: Wednesday, March 29, 2017 12:07 PM
> To: users@camel.apache.org
> 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(ReflectionUt
> 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.