maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arnaud Bailly <abai...@oqube.com>
Subject Re: Maven2/TestApp/Classpath testing and structuring issues
Date Wed, 16 Aug 2006 10:10:39 GMT
Paul Michael Reilly <pmr@pajato.com> writes:

> I use the Maven 2 quick start scaffold for this project so far.  In
> AppTest, I spawn the app during setup via something like:
> Runtime.getRuntime().exec( "java -cp the:class:path com.foo.App" ).
> ...
> avoid.  So, being new to the Maven2 world, I'm looking for some
> guidance on how a more experienced Maven2 hacker would approach these
> issues.
>

I am not sure to qualify as an "experienced maven2 hacker" but I am
wondering whether it is a good idea to test your whole application in
a unit test. To solve the classpath issue, I would rather do the following:
 - test my application's classes in unit tests, using the test
 classpath provided by maven. You can add <scope>test</scope> to your
 dependencies if you want to use libraries in the test phase only. If
 I need to test the main class com.foo.App, I just call "main" method
 constructing arguments 
 - create another project for integration testing that will depend on
 my application main artifact and run specific integration tests using
 this artifact (eg. jar). That could allow solving the "environment"
 issues you hinted at.


> Thanks,
>
HIH,
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message