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 MavenITmng4690InterdependentConflictResolutionTest
34 extends AbstractMavenIntegrationTestCase
35 {
36
37 public MavenITmng4690InterdependentConflictResolutionTest()
38 {
39 super( "[2.0.9,)" );
40 }
41
42
43
44 public void testitADX()
45 throws Exception
46 {
47 requiresMavenVersion( "[3.0-beta-3,)" );
48 testit( "test-adx" );
49 }
50
51 public void testitAXD()
52 throws Exception
53 {
54 testit( "test-axd" );
55 }
56
57 public void testitDAX()
58 throws Exception
59 {
60 requiresMavenVersion( "[3.0-beta-3,)" );
61 testit( "test-dax" );
62 }
63
64 public void testitDXA()
65 throws Exception
66 {
67 testit( "test-dxa" );
68 }
69
70 public void testitXAD()
71 throws Exception
72 {
73 testit( "test-xad" );
74 }
75
76 public void testitXDA()
77 throws Exception
78 {
79 testit( "test-xda" );
80 }
81
82
83
84
85
86 private void testit( String test )
87 throws Exception
88 {
89 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4690" );
90
91 Verifier verifier = newVerifier( new File( testDir, test ).getAbsolutePath() );
92 verifier.setAutoclean( false );
93 verifier.deleteDirectory( "target" );
94 verifier.deleteArtifacts( "org.apache.maven.its.mng4690" );
95 verifier.getCliOptions().add( "-s" );
96 verifier.getCliOptions().add( "settings.xml" );
97 verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
98 verifier.executeGoal( "validate" );
99 verifier.verifyErrorFreeLog();
100 verifier.resetStreams();
101
102 List classpath = verifier.loadLines( "target/classpath.txt", "UTF-8" );
103
104 assertTrue( test + " > " + classpath.toString(), classpath.contains( "a-1.jar" ) );
105 assertTrue( test + " > " + classpath.toString(), classpath.contains( "b-1.jar" ) );
106 assertTrue( test + " > " + classpath.toString(), classpath.contains( "c-1.jar" ) );
107 assertTrue( test + " > " + classpath.toString(), classpath.contains( "d-1.jar" ) );
108
109 assertTrue( test + " > " + classpath.toString(), classpath.contains( "x-1.jar" ) );
110 assertTrue( test + " > " + classpath.toString(), classpath.contains( "y-2.jar" ) );
111 }
112
113 }