Skip to content

Commit e7600ce

Browse files
Mathias de Riesemdrie
Mathias de Riese
authored andcommitted
MDEPLOY-118: integration test: add two SNAPSHOT runs, not affected by feature.
1 parent ef26770 commit e7600ce

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

src/it/compare-pom/altered-pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ under the License.
2424

2525
<groupId>org.apache.maven.its.deploy.comparepom</groupId>
2626
<artifactId>test</artifactId>
27-
<version>1.0</version>
27+
<version>${revision}</version>
2828
<packaging>pom</packaging>
2929

3030
<description>
3131
Tests deployment comparing with a deployed POM. Parameter comparePomWithDeployed. Modified POM!
3232
</description>
3333

3434
<properties>
35+
<revision>1.0-SNAPSHOT</revision>
3536
<maven.test.skip>true</maven.test.skip>
3637
</properties>
3738

src/it/compare-pom/invoker.properties

+10-5
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@
1717

1818
invoker.debug = false
1919

20-
invoker.goals = -Dclassifier=first clean deploy
20+
invoker.goals.1 = -Dclassifier=first clean deploy
2121

22-
invoker.goals.2 = -Dclassifier=second clean deploy
22+
invoker.project.2 = altered-pom.xml
23+
invoker.goals.2 = -Dclassifier=second -Dm-deploy-p.version=${project.version} clean deploy
2324

24-
invoker.project.3 = altered-pom.xml
25-
invoker.goals.3 = -Dclassifier=third -Dm-deploy-p.version=${project.version} clean deploy
26-
invoker.buildResult.3 = failure
25+
invoker.goals.3 = -Drevision=1.0 -Dclassifier=first clean deploy
26+
27+
invoker.goals.4 = -Drevision=1.0 -Dclassifier=second clean deploy
28+
29+
invoker.project.5 = altered-pom.xml
30+
invoker.goals.5 = -Drevision=1.0 -Dclassifier=third -Dm-deploy-p.version=${project.version} clean deploy
31+
invoker.buildResult.5 = failure

src/it/compare-pom/pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ under the License.
2424

2525
<groupId>org.apache.maven.its.deploy.comparepom</groupId>
2626
<artifactId>test</artifactId>
27-
<version>1.0</version>
27+
<version>${revision}</version>
2828
<packaging>pom</packaging>
2929

3030
<description>
3131
Tests deployment comparing with a deployed POM. Parameter comparePomWithDeployed.
3232
</description>
3333

3434
<properties>
35+
<revision>1.0-SNAPSHOT</revision>
3536
<maven.test.skip>true</maven.test.skip>
3637
</properties>
3738

src/it/compare-pom/verify.groovy

+13-3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ class LogInspector
4444

4545

4646
assert new File( basedir, "repo/org/apache/maven/its/deploy/comparepom/test/maven-metadata.xml" ).exists()
47+
48+
File snDir = new File( basedir, "repo/org/apache/maven/its/deploy/comparepom/test/1.0-SNAPSHOT/" )
49+
assert snDir.list( {d, f -> f ==~ /test-1.0-.*-first.jar/} as FilenameFilter ).size() == 1
50+
assert snDir.list( {d, f -> f ==~ /test-1.0-.*-second.jar/} as FilenameFilter ).size() == 1
51+
assert snDir.list( {d, f -> f ==~ /test-1.0-.*.pom/} as FilenameFilter ).size() == 2
52+
4753
assert new File( basedir, "repo/org/apache/maven/its/deploy/comparepom/test/1.0/test-1.0-first.jar" ).exists()
4854
assert new File( basedir, "repo/org/apache/maven/its/deploy/comparepom/test/1.0/test-1.0-second.jar").exists()
4955

@@ -62,18 +68,22 @@ assert buildLog.exists()
6268
LogInspector li = new LogInspector( buildLog )
6369
String groupUrl = "file:///${basedir}/repo/org/apache/maven/its/deploy/comparepom"
6470

65-
// First run: The POM tried to be downloaded and uploaded:
71+
// 1st and 2nd run: The POM tried to be downloaded and uploaded:
72+
assert li.containsAfter( "[INFO] Downloading from it: ${groupUrl}/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom" )
73+
assert li.containsAfter( "[INFO] Downloading from it: ${groupUrl}/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom" )
74+
75+
// 3rd run: The POM tried to be downloaded and uploaded:
6676
assert li.containsAfter( "[INFO] Downloading from it: ${groupUrl}/test/1.0/test-1.0.pom" )
6777
assert li.containsAfter( "[INFO] Uploaded to it: ${groupUrl}/test/1.0/test-1.0.pom" )
6878

6979
// After that, it is never tried to be uploaded:
7080
assert -1 == buildLog.text.indexOf( "[INFO] Uploading to it: ${groupUrl}/test/1.0/test-1.0.pom", li.index + 1 )
7181

72-
// Second run: POM is downloaded and not uploaded:
82+
// 4th run: POM is downloaded and not uploaded:
7383
assert li.containsAfter( "[INFO] Downloaded from it: ${groupUrl}/test/1.0/test-1.0.pom" )
7484
assert li.containsAfter( "[INFO] Not deploying POM, since deployed POM is equal to current POM." )
7585

76-
// Third run: POM is downloaded, nothing is tried to be uploaded after that, and the build fails with error:
86+
// 5th run: POM is downloaded, nothing is tried to be uploaded after that, and the build fails with error:
7787
assert li.containsAfter( "[INFO] Downloaded from it: ${groupUrl}/test/1.0/test-1.0.pom" )
7888
assert -1 == buildLog.text.indexOf( "[INFO] Uploading to", li.index + 1 )
7989
assert li.containsAfter( "[ERROR] Project version org.apache.maven.its.deploy.comparepom:test:1.0 already deployed with a differing POM." )

0 commit comments

Comments
 (0)