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 org.apache.maven.it.util.ResourceExtractor;
23
24 import java.io.File;
25 import java.util.ArrayList;
26 import java.util.Collections;
27 import java.util.List;
28 import java.util.Properties;
29
30
31
32
33
34
35 public class MavenITmng4190MirrorRepoMergingTest
36 extends AbstractMavenIntegrationTestCase
37 {
38
39 public MavenITmng4190MirrorRepoMergingTest()
40 {
41 super( "[3.0-alpha-3,)" );
42 }
43
44
45
46
47
48
49
50
51 public void testit()
52 throws Exception
53 {
54 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4190" );
55
56 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
57 verifier.setAutoclean( false );
58 verifier.deleteDirectory( "target" );
59 verifier.deleteArtifacts( "org.apache.maven.its.mng4190" );
60 verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
61 verifier.addCliOption( "-s" );
62 verifier.addCliOption( "settings.xml" );
63 verifier.executeGoal( "validate" );
64 verifier.verifyErrorFreeLog();
65 verifier.resetStreams();
66
67 List<String> artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" );
68 Collections.sort( artifacts );
69
70 List<String> expected = new ArrayList<>();
71 expected.add( "org.apache.maven.its.mng4190:a:jar:0.1" );
72 expected.add( "org.apache.maven.its.mng4190:b:jar:0.1-SNAPSHOT" );
73
74 assertEquals( expected, artifacts );
75
76 Properties props = verifier.loadProperties( "target/repo.properties" );
77 assertEquals( "1", props.getProperty( "project.remoteArtifactRepositories" ) );
78
79 assertEquals( "true", props.getProperty( "project.remoteArtifactRepositories.0.releases.enabled" ) );
80 assertEquals( "ignore", props.getProperty( "project.remoteArtifactRepositories.0.releases.checksumPolicy" ) );
81 assertEquals( "daily", props.getProperty( "project.remoteArtifactRepositories.0.releases.updatePolicy" ) );
82
83 assertEquals( "true", props.getProperty( "project.remoteArtifactRepositories.0.snapshots.enabled" ) );
84 assertEquals( "ignore", props.getProperty( "project.remoteArtifactRepositories.0.snapshots.checksumPolicy" ) );
85 assertEquals( "always", props.getProperty( "project.remoteArtifactRepositories.0.snapshots.updatePolicy" ) );
86 }
87
88 }