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 MavenITmng1142VersionRangeIntersectionTest
33 extends AbstractMavenIntegrationTestCase
34 {
35
36 public MavenITmng1142VersionRangeIntersectionTest()
37 {
38 super( "[2.0.7,3.0-alpha-1),[3.0,)" );
39 }
40
41
42
43
44
45
46
47 public void testitAB()
48 throws Exception
49 {
50 testit( "test-ab" );
51 }
52
53
54
55
56
57
58
59 public void testitBA()
60 throws Exception
61 {
62 testit( "test-ba" );
63 }
64
65 private void testit( String project )
66 throws Exception
67 {
68 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1142" );
69
70 Verifier verifier = newVerifier( new File( testDir, project ).getAbsolutePath() );
71 verifier.setAutoclean( false );
72 verifier.deleteDirectory( "target" );
73 verifier.deleteArtifacts( "org.apache.maven.its.mng1142" );
74 verifier.addCliOption( "-s" );
75 verifier.addCliOption( "settings.xml" );
76 verifier.filterFile( "../settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
77 verifier.executeGoal( "validate" );
78 verifier.verifyErrorFreeLog();
79 verifier.resetStreams();
80
81 List<String> classpath = verifier.loadLines( "target/classpath.txt", "UTF-8" );
82
83 assertFalse( classpath.toString(), classpath.contains( "a-1.1.2.jar" ) );
84 assertTrue( classpath.toString(), classpath.contains( "a-1.1.1.jar" ) );
85 assertTrue( classpath.toString(), classpath.contains( "b-0.1.jar" ) );
86 }
87
88 }