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