The tests run fine when I run them individually using Maven at the command line (or from within NetBeans or Eclipse -- I don't think the IDE is an issue since the same thing happens in the IDE as at the command line):
$ mvn -Dtest=MultipleDaoTest test-compile surefire:test [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'surefire'. [INFO] ------------------------------------------------------------------------ [INFO] Building lifecycle-manager [INFO] task-segment: [test-compile, surefire:test] [INFO] ------------------------------------------------------------------------ [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] [INFO] Nothing to compile - all classes are up to date [INFO] [surefire:test] [INFO] Surefire report directory: c:\dev\projects\lifecycle-manager\target\surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running com.mycom.network.lifecycle.persistence.dao.MultipleDaoTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.282 sec Results : Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ However if I run a full build I get errors for the same tests which pass individually: $ mvn clean install ... Failed tests: testSaveDeleteFindAll(com.mycom.network.lifecycle.persistence.dao.MultipleDaoTest) I have a simple pom.xml with dependencies, etc., nothing unusual. My tests extend Spring's AbstractTransactionalDataSourceSpringContextTests class, which creates a transaction for each test method and rolls back when the test is complete. Seems pretty vanilla to me, which is why I'm so perplexed. --James Geoffrey Wiseman wrote: > > On Tue, Dec 16, 2008 at 12:48 AM, Marat Radchenko < > slonopotamusor...@gmail.com> wrote: > >> They should. Unless you managed to write them in such way that they >> don't. >> > > So it could be: > > - Issues with the isolation of your tests from each other > - Issues with your Maven project configuration > - Something that Maven enforces that Netbeans does not > > Hard to say without knowing a lot more about what's happening. > > - Geoffrey > -- > Geoffrey Wiseman > http://www.geoffreywiseman.ca/ > > -- View this message in context: http://www.nabble.com/Tests-run-fine-individually%2C-but-some-fail-when-run-as-part-of-%27mvn-install%27-tp21019373p21043070.html Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org