You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <ci...@silverbullet.dk> on 2008/09/17 14:12:05 UTC

RE: [SPAM] Re: Camel Maven Plugin looking in test-classes

Hi

I actually think camel:run should NOT pickup anything from src/test (test-classes)

You use src/test for unit testing with mvn test.

I think there is a ticket in JIRA about something with classpath setting on the plugin. Please check before creating a ticket.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: James Strachan [mailto:james.strachan@gmail.com] 
Sent: 17. september 2008 14:05
To: camel-user@activemq.apache.org
Subject: [SPAM] Re: Camel Maven Plugin looking in test-classes

2008/9/17 Martin Gilday <ma...@imap.cc>:
> Hi Camel riders,
>
> We follow what I think is a fairly standard pattern where we name our
> test classes the same as the class under test with the suffix UnitTest
> or IntTest.  We place this in the same package name, but under
> src/test/java instead of src/main/java.
>
> I have a route scanner defined as so:
>
> <camel:camelContext>
>  <camel:package>example.routes</camel:package>
> </camel:camelContext>
>
> When I start up mvn camel:run I can see the following log lines:
>
> DEBUG org.apache.camel.util.ResolverUtil  - Loading from directory:
> C:\workspace\projectname\target\classes\example\routes
> DEBUG org.apache.camel.util.ResolverUtil  - Loading from directory:
> C:\workspace\projectname\target\test-classes\example\routes
>
> This causes a problem as it attempts to load a class in test-classes
> which has a super class of AbstractJUnit4SpringContextTests which in the
> Maven POM is defined with test depdendency scope.  Therefore you get a
> java.lang.NoClassDefFoundError.
>
> Why is Camel scanning test classes for routes?  Is there a way to
> prevent this other than changing the test package name?

Hmm - I guess you could just disable the logging messages so you don't
see it happening :)

Maybe we could change camel:run to also include the test dependencies?

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Re: [SPAM] Re: [SPAM] Re: Camel Maven Plugin looking in test-classes

Posted by James Strachan <ja...@gmail.com>.
2008/9/18 Claus Ibsen <ci...@silverbullet.dk>:
> Hi
>
> Ah yeah that's the dangerous when having a mail client that is capable of sending emails before 3 cups of coffee.

Yeah :)

Shame it doesn't keep 'em in a drafts folder until your caffeine
levels are high enough...


> I have refined the camel:run plugin to skip test-classes and any test scoped maven dependencies.

Great!

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

RE: [SPAM] Re: [SPAM] Re: Camel Maven Plugin looking in test-classes

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Ah yeah that's the dangerous when having a mail client that is capable of sending emails before 3 cups of coffee.

I have refined the camel:run plugin to skip test-classes and any test scoped maven dependencies.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: James Strachan [mailto:james.strachan@gmail.com] 
Sent: 18. september 2008 11:30
To: camel-user@activemq.apache.org
Subject: [SPAM] Re: [SPAM] Re: Camel Maven Plugin looking in test-classes

2008/9/17 Claus Ibsen <ci...@silverbullet.dk>:
> Hi
>
> I actually think camel:run should NOT pickup anything from src/test (test-classes)

Agreed. I'd not had that much coffee when I posted my previous mail :)

So I think we just need to fix the camel:run plugin to not use the
test classpath right?

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Re: [SPAM] Re: Camel Maven Plugin looking in test-classes

Posted by James Strachan <ja...@gmail.com>.
2008/9/17 Claus Ibsen <ci...@silverbullet.dk>:
> Hi
>
> I actually think camel:run should NOT pickup anything from src/test (test-classes)

Agreed. I'd not had that much coffee when I posted my previous mail :)

So I think we just need to fix the camel:run plugin to not use the
test classpath right?

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com