1 package org.apache.maven.it;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23 import java.util.Properties;
24
25 import org.apache.maven.it.util.ResourceExtractor;
26
27
28
29
30
31
32
33 public class MavenITmng4189UniqueVersionSnapshotTest
34 extends AbstractMavenIntegrationTestCase
35 {
36
37 public MavenITmng4189UniqueVersionSnapshotTest()
38 {
39 super( "[2.2.1,),[3.0-alpha-3,)" );
40 }
41
42 public void testit()
43 throws Exception
44 {
45 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4189" );
46
47 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
48 verifier.setAutoclean( false );
49 verifier.deleteDirectory( "target" );
50 verifier.deleteArtifacts( "org.apache.maven.its.mng4189" );
51 verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
52 verifier.addCliOption( "--settings" );
53 verifier.addCliOption( "settings.xml" );
54
55
56 verifier.setLogFileName( "log-1.txt" );
57 verifier.executeGoal( "validate" );
58 verifier.verifyErrorFreeLog();
59
60 Properties checksums = verifier.loadProperties( "target/checksum.properties" );
61 assertEquals( "da2e54f69a9ba120f9211c476029f049967d840c", checksums.getProperty( "dep-1.0-SNAPSHOT.jar" ) );
62
63
64 verifier.deleteDirectory( "target" );
65 verifier.addCliOption( "-f" );
66 verifier.addCliOption( "dependent-on-newer-timestamp-pom.xml" );
67 verifier.setLogFileName( "log-2.txt" );
68 verifier.executeGoal( "validate" );
69 verifier.verifyErrorFreeLog();
70
71 checksums = verifier.loadProperties( "target/checksum.properties" );
72 assertEquals( "835979c28041014c5fd55daa15302d92976924a7", checksums.getProperty( "dep-1.0-SNAPSHOT.jar" ) );
73
74
75 verifier.deleteDirectory( "target" );
76 verifier.getCliOptions().remove( "-f" );
77 verifier.getCliOptions().remove( "dependent-on-newer-timestamp-pom.xml" );
78 verifier.setLogFileName( "log-3.txt" );
79 verifier.executeGoal( "validate" );
80 verifier.verifyErrorFreeLog();
81 verifier.resetStreams();
82
83 checksums = verifier.loadProperties( "target/checksum.properties" );
84 assertEquals( "da2e54f69a9ba120f9211c476029f049967d840c", checksums.getProperty( "dep-1.0-SNAPSHOT.jar" ) );
85 }
86
87 }