Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
o Added IT's for MNG-5895, MNG-6057, MNG-6090 o Added flatten-maven-plugin for usage during the IT's.
- Loading branch information
1 parent
c68f707
commit dec1deb
Showing
20 changed files
with
884 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ bin | |
.DS_Store | ||
.idea | ||
jvz-* | ||
.flattened-pom.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...uite/src/test/java/org/apache/maven/it/MavenITmng5895CIFriendlyUsageWithPropertyTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package org.apache.maven.it; | ||
|
||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import org.apache.maven.it.Verifier; | ||
import org.apache.maven.it.util.ResourceExtractor; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* The usage of a <code>${revision}</code> for the version in the pom file and furthermore | ||
* defining the property in the pom file and overwrite it via command line. | ||
* <a href="https://issues.apache.org/jira/browse/MNG-5895">MNG-5895</a>. | ||
* | ||
* This will result in a failure without the fix for this issue. | ||
* | ||
* @author Karl Heinz Marbaise khmarbaise@apache.org | ||
*/ | ||
public class MavenITmng5895CIFriendlyUsageWithPropertyTest | ||
extends AbstractMavenIntegrationTestCase | ||
{ | ||
|
||
public MavenITmng5895CIFriendlyUsageWithPropertyTest() | ||
{ | ||
// The first version which contains the fix for the MNG-issue. | ||
// TODO: Think about it! | ||
super( "[3.5.0-alpha-2,)" ); | ||
} | ||
|
||
/** | ||
* Check that the resulting run will not fail in case | ||
* of defining the property via command line which is | ||
* already defined inside the pom. | ||
*/ | ||
public void testitShouldResolveTheDependencies() | ||
throws Exception | ||
{ | ||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5895-ci-friendly-usage-with-property" ); | ||
|
||
Verifier verifier = newVerifier( testDir.getAbsolutePath(), false ); | ||
verifier.setMavenDebug( false ); | ||
verifier.setAutoclean( false ); | ||
|
||
//verifier.setLogFileName( "log-only.txt" ); | ||
verifier.addCliOption( "-Drevision=1.2" ); | ||
verifier.executeGoal( "clean" ); | ||
verifier.executeGoal( "package" ); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.resetStreams(); | ||
|
||
} | ||
|
||
} |
119 changes: 119 additions & 0 deletions
119
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6057CheckReactorOrderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
package org.apache.maven.it; | ||
|
||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import org.apache.maven.it.Verifier; | ||
import org.apache.maven.it.util.ResourceExtractor; | ||
|
||
import java.io.File; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
/** | ||
* Using a <code>${revision}</code> in the version will change the reactor order before fixing | ||
* <a href="https://issues.apache.org/jira/browse/MNG-6057">MNG-6057</a>. Without the fix for this issue the order of | ||
* the reactor is changed in that way that the parent is ordered to the last position instead of the first position. | ||
* | ||
* @author Karl Heinz Marbaise khmarbaise@apache.org | ||
*/ | ||
public class MavenITmng6057CheckReactorOrderTest | ||
extends AbstractMavenIntegrationTestCase | ||
{ | ||
|
||
public MavenITmng6057CheckReactorOrderTest() | ||
{ | ||
// The first version which contains the fix for the MNG-6057 issue. | ||
// TODO: Think about it! | ||
super( "[3.5.0-alpha-2,)" ); | ||
} | ||
|
||
/** | ||
* Verify that the result shows the reactor order as expected. | ||
*/ | ||
public void testitReactorShouldResultInExpectedOrder() | ||
throws Exception | ||
{ | ||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6057-check-reactor-order" ); | ||
|
||
Verifier verifier = newVerifier( testDir.getAbsolutePath(), false ); | ||
verifier.setMavenDebug( false ); | ||
verifier.setAutoclean( false ); | ||
|
||
verifier.setLogFileName( "log-only.txt" ); | ||
verifier.addCliOption( "-Drevision=1.3.0-SNAPSHOT" ); | ||
verifier.executeGoal( "clean" ); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.resetStreams(); | ||
|
||
List<String> loadedLines = verifier.loadLines( "log-only.txt", "UTF-8" ); | ||
List<String> resultingLines = extractReactorBuildOrder( loadedLines ); | ||
|
||
// We expecting exactly three lines as result. | ||
assertEquals( 3, resultingLines.size() ); | ||
|
||
// We expect those lines in the following exact order. | ||
assertEquals( "[INFO] base-project", resultingLines.get( 0 ) ); | ||
assertEquals( "[INFO] module-1", resultingLines.get( 1 ) ); | ||
assertEquals( "[INFO] module-2", resultingLines.get( 2 ) ); | ||
} | ||
|
||
/** | ||
* Extract the lines at the beginning of the Maven output: | ||
* | ||
* <pre> | ||
* [INFO] Reactor Build Order: | ||
* [INFO] | ||
* [INFO] module-1 | ||
* [INFO] module-2 | ||
* [INFO] base-project | ||
* [INFO] | ||
* </pre> | ||
*/ | ||
private List<String> extractReactorBuildOrder( List<String> loadedLines ) | ||
{ | ||
List<String> resultingLines = new LinkedList<String>(); | ||
boolean start = false; | ||
for ( String line : loadedLines ) | ||
{ | ||
if ( start ) | ||
{ | ||
if ( line.startsWith( "[INFO] ----------------------------" ) ) | ||
{ | ||
start = false; | ||
} | ||
else if ( !line.endsWith( "[INFO] " ) ) | ||
{ | ||
resultingLines.add( line ); | ||
} | ||
} | ||
else | ||
{ | ||
if ( line.startsWith( "[INFO] Reactor Build Order:" ) ) | ||
{ | ||
start = true; | ||
} | ||
|
||
} | ||
} | ||
return resultingLines; | ||
|
||
} | ||
|
||
} |
80 changes: 80 additions & 0 deletions
80
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package org.apache.maven.it; | ||
|
||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import org.apache.maven.it.Verifier; | ||
import org.apache.maven.it.util.ResourceExtractor; | ||
|
||
import java.io.File; | ||
import java.util.Arrays; | ||
|
||
/** | ||
* The usage of a <code>${revision}</code> for the version in the pom file and furthermore | ||
* defining the property in the pom file and overwrite it via command line and | ||
* try to build a partial reactor via <code>mvn -pl ..</code> | ||
* <a href="https://issues.apache.org/jira/browse/MNG-6090">MNG-6090</a>. | ||
* | ||
* @author Karl Heinz Marbaise khmarbaise@apache.org | ||
*/ | ||
public class MavenITmng6090CIFriendlyTest | ||
extends AbstractMavenIntegrationTestCase | ||
{ | ||
|
||
public MavenITmng6090CIFriendlyTest() | ||
{ | ||
// The first version which contains the fix for the MNG-issue. | ||
// TODO: Think about it! | ||
super( "[3.5.0-alpha-2,)" ); | ||
} | ||
|
||
/** | ||
* Check that the resulting run will not fail in case | ||
* of defining the property via command line and | ||
* install the projects and afterwards just build | ||
* a part of the whole reactor. | ||
*/ | ||
public void testitShouldResolveTheDependencies() | ||
throws Exception | ||
{ | ||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6090-ci-friendly" ); | ||
|
||
Verifier verifier = newVerifier( testDir.getAbsolutePath(), false ); | ||
verifier.setMavenDebug( false ); | ||
verifier.setAutoclean( false ); | ||
|
||
verifier.addCliOption( "-Drevision=1.2" ); | ||
verifier.setLogFileName( "install-log.txt" ); | ||
verifier.executeGoals( Arrays.asList( "clean", "install" ) ); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.resetStreams(); | ||
|
||
verifier = newVerifier( testDir.getAbsolutePath(), false ); | ||
verifier.setMavenDebug( false ); | ||
verifier.setAutoclean( false ); | ||
|
||
verifier.addCliOption( "-Drevision=1.2" ); | ||
verifier.addCliOption( "-pl module-3" ); | ||
verifier.executeGoal( "package" ); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.resetStreams(); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.