Ah, i figured it out it was Eclipse being clever and running setUp() and tearDown() when it shouldn't have been. Maven was behaving correctly. Thanks for your help guys. Andy
On 08/01/07, Chris Hilton <[EMAIL PROTECTED]> wrote:
My guess would be that your tests were working with Ant's junit task which uses a forkmode of 'pertest' by default, but they are now failing because Maven's surefire plugin uses a default of 'once' by default. You can change the setting for the surefire plugin by adding a configuration something like the following to your pom: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <forkMode>always</forkMode> </configuration> </plugin> That should get you running, but you should also consider rewriting the tests to run with the default; all that forking can take a lot of time. Chris > -----Original Message----- > From: Andrew Birchall [mailto:[EMAIL PROTECTED] > Sent: Monday, 08 January, 2007 07:26 > To: Maven Users List > Subject: [m2] JUnit test setUp() and tearDown() not called > > Hello, > When I run my JUnut test suit from Maven using mvn test some > tests fail because setUp() and tearDown() are never called. > Surley these should be called automatically when the test is run? > The tests work fine when run from Eclipse. > Is there something stupidly obvious that I'm missing? > (Please don't say 'a brain') > Thanks a lot > Andrew Birchall > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]