Arnaud Bailly <[EMAIL PROTECTED]> writes:

 > Paul Michael Reilly <[EMAIL PROTECTED]> 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.

You qualify. :-)

Actually your points are well taken.  After thinking about it a bit, I
realize that my "process" needs to be a two tiered testing process,
which probably means abandoning the quick start pom and learning more
about constructing a custom pom.  This is probably a good thing.

The first testing tier will be based on the classes and will be mostly
traditional unit testing, but I will observe that unit testing has
never given me much bang for the buck.  Rather it is the integration
level testing, driven by JUnit, or a JUnit derived framework, like
Abbot, that I have found to pay big dividends.  But this particular
App has highlighted opportunities where traditional unit testing may
offer bigger dividends.  A second testing phase based on the main jar
artifact is a definite win.

So I like your suggestions and appreciate you taking the time to make
them.

-pmr

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to