Hi Pablo, > -----Original Message----- > From: Pablo [mailto:[EMAIL PROTECTED] > Sent: jeudi 5 janvier 2006 10:43 > To: Maven Users List > Subject: Integration testing > > Hello everyone > > I'm trying to include integration tests into my maven project. > I've accomplished the task but had to write my own plugin. > Since I don't know maven2 too well I'd like to ask you a few questions. > > My plugin does the following: > 1) compiles integration tests > 2) starts tomcat using cargo > 3) runs tests > 4) stops tomcat > > Junit tests are run before the 'package' phase so there is no > application to be tested yet. > Therefore if integration tests were in the same directory as the junit > tests, the test phase would fail. > > That's why I use two test directories: > 1) src/tests for junit tests > 2) src/integration-tests for integration tests > > I'd like to use maven code as much as possible therefore I'd like to > remove the 1st section (compilation of tests). > Right now the compilation of tests is done in a similiar way as in > TestCompilerMojo.java. > I wanted to extend this class but the fields: compileSourceRoots and > outputDirectory are read only. > So I would have to create a few fields with different names, and when > they are set in plugin's configuration I could set the proper ones > through reflection. It's not a good approach I agree. > > It would be even more convenient if I could use the existing compiler > plugin and could simply set different paths. > The junit tests would be compiled in a standard way by setting > <testSourceDirectory> and integration tests would be compiled using > different source directory to a different output directory. > > The question is, how can I do it? How can I use maven-compiler-plugin > two times with different source and destination paths? Can someone send > me a few lines of pom which does it?
There's a discussion going on on these topics. You can check http://docs.codehaus.org/display/MAVEN/best+practices+-+testing+strategies Feel free to comment about it! Right now you could do what you're doing by using the new before-integration-test and after-integratiob-test phase but you won't be able to mix both unit tests and integration tests in the same project AFAIK. Thanks -Vincent --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]