@@ -44,6 +44,12 @@ class LogInspector
44
44
45
45
46
46
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
+
47
53
assert new File ( basedir, " repo/org/apache/maven/its/deploy/comparepom/test/1.0/test-1.0-first.jar" ). exists()
48
54
assert new File ( basedir, " repo/org/apache/maven/its/deploy/comparepom/test/1.0/test-1.0-second.jar" ). exists()
49
55
@@ -62,18 +68,22 @@ assert buildLog.exists()
62
68
LogInspector li = new LogInspector ( buildLog )
63
69
String groupUrl = " file:///${ basedir} /repo/org/apache/maven/its/deploy/comparepom"
64
70
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:
66
76
assert li. containsAfter( " [INFO] Downloading from it: ${ groupUrl} /test/1.0/test-1.0.pom" )
67
77
assert li. containsAfter( " [INFO] Uploaded to it: ${ groupUrl} /test/1.0/test-1.0.pom" )
68
78
69
79
// After that, it is never tried to be uploaded:
70
80
assert -1 == buildLog. text. indexOf( " [INFO] Uploading to it: ${ groupUrl} /test/1.0/test-1.0.pom" , li. index + 1 )
71
81
72
- // Second run: POM is downloaded and not uploaded:
82
+ // 4th run: POM is downloaded and not uploaded:
73
83
assert li. containsAfter( " [INFO] Downloaded from it: ${ groupUrl} /test/1.0/test-1.0.pom" )
74
84
assert li. containsAfter( " [INFO] Not deploying POM, since deployed POM is equal to current POM." )
75
85
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:
77
87
assert li. containsAfter( " [INFO] Downloaded from it: ${ groupUrl} /test/1.0/test-1.0.pom" )
78
88
assert -1 == buildLog. text. indexOf( " [INFO] Uploading to" , li. index + 1 )
79
89
assert li. containsAfter( " [ERROR] Project version org.apache.maven.its.deploy.comparepom:test:1.0 already deployed with a differing POM." )
0 commit comments