Joakim,
I believe I've found the reason why the tests for continuum-release are
not predictable. The two tests are executed in random order (junit does
this), but they change the contents of target/scm-src.
This can be fixed by always restoring the scm directory, and by
explicitly invoking one test first and then the second. Patch is in
attachment.
grtz
--
Philippe Faes <[EMAIL PROTECTED]>
Index: src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
===================================================================
--- src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java (revision 465364)
+++ src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java (working copy)
@@ -72,12 +72,15 @@
{
releaseManager = (ContinuumReleaseManager) lookup( ContinuumReleaseManager.ROLE );
}
+ File scmPath = new File( getBasedir(), "target/scm-src" ).getAbsoluteFile();
+ File scmTargetPath = new File( getBasedir(), "target/scm-test" ).getAbsoluteFile();
+ FileUtils.copyDirectoryStructure(scmPath, scmTargetPath);
}
- public void testReleaseSimpleProject()
+ public void releaseSimpleProject()
throws Exception
{
- String scmPath = new File( getBasedir(), "target/scm-src" ).getAbsolutePath().replace( '\\', '/' );
+ String scmPath = new File( getBasedir(), "target/scm-test" ).getAbsolutePath().replace( '\\', '/' );
File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
FileUtils.deleteDirectory( workDir );
File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
@@ -107,11 +110,16 @@
pom = FileUtils.fileRead( new File( testDir, "pom.xml" ) );
assertTrue( "Test released version", pom.indexOf( "<version>1.0</version>" ) > 0 );
}
-
- public void testReleaseSimpleProjectWithNextVersion()
+
+ public void testReleases() throws Exception{
+ releaseSimpleProject();
+ releaseSimpleProjectWithNextVersion();
+ }
+
+ public void releaseSimpleProjectWithNextVersion()
throws Exception
{
- String scmPath = new File( getBasedir(), "target/scm-src" ).getAbsolutePath().replace( '\\', '/' );
+ String scmPath = new File( getBasedir(), "target/scm-test" ).getAbsolutePath().replace( '\\', '/' );
File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
FileUtils.deleteDirectory( workDir );
File testDir = new File( getBasedir(), "target/test-classes/test-dir" );