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.List;
26
27
28
29
30
31
32 public class MavenITmng3775ConflictResolutionBacktrackingTest
33 extends AbstractMavenIntegrationTestCase
34 {
35
36 public MavenITmng3775ConflictResolutionBacktrackingTest()
37 {
38 super( "[3.0,)" );
39 }
40
41 public void testitABC()
42 throws Exception
43 {
44 testit( "test-abc" );
45 }
46
47 public void testitACB()
48 throws Exception
49 {
50 testit( "test-acb" );
51 }
52
53 public void testitBAC()
54 throws Exception
55 {
56 testit( "test-bac" );
57 }
58
59 public void testitBCA()
60 throws Exception
61 {
62 testit( "test-bca" );
63 }
64
65 public void testitCAB()
66 throws Exception
67 {
68 testit( "test-cab" );
69 }
70
71 public void testitCBA()
72 throws Exception
73 {
74 testit( "test-cba" );
75 }
76
77
78
79
80
81
82 private void testit( String project )
83 throws Exception
84 {
85 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3775" );
86
87 Verifier verifier = newVerifier( new File( testDir, project ).getAbsolutePath() );
88 verifier.setAutoclean( false );
89 verifier.deleteDirectory( "target" );
90 verifier.deleteArtifacts( "org.apache.maven.its.mng3775" );
91 verifier.addCliOption( "-s" );
92 verifier.addCliOption( "settings.xml" );
93 verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
94 verifier.executeGoal( "validate" );
95 verifier.verifyErrorFreeLog();
96 verifier.resetStreams();
97
98 List<String> test = verifier.loadLines( "target/test.txt", "UTF-8" );
99
100 assertTrue( project + " > " + test.toString(), test.contains( "a-0.1.jar" ) );
101 assertTrue( project + " > " + test.toString(), test.contains( "b-0.1.jar" ) );
102 assertTrue( project + " > " + test.toString(), test.contains( "x-0.1.jar" ) );
103 assertTrue( project + " > " + test.toString(), test.contains( "c-0.1.jar" ) );
104 }
105
106 }