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
26
27
28
29
30 public class MavenIT0145ReactorWithIncludesExcludesTest
31 extends AbstractMavenIntegrationTestCase
32 {
33
34 public MavenIT0145ReactorWithIncludesExcludesTest()
35 {
36
37 super( "[2.0,3.0-alpha-1)" );
38 }
39
40
41
42
43
44
45 public void testitDefaultIncludesExcludes()
46 throws Exception
47 {
48 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0145" );
49
50 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
51 verifier.setAutoclean( false );
52 verifier.deleteDirectory( "target" );
53 verifier.deleteDirectory( "mod-a/target" );
54 verifier.deleteDirectory( "mod-b/target" );
55 verifier.addCliOption( "-r" );
56 verifier.setLogFileName( "log-defaults.txt" );
57 verifier.executeGoal( "validate" );
58 verifier.verifyErrorFreeLog();
59 verifier.resetStreams();
60
61 verifier.assertFileNotPresent( "target/touch.txt" );
62 verifier.assertFilePresent( "mod-a/target/touch-a.txt" );
63 verifier.assertFilePresent( "mod-b/target/touch-b.txt" );
64 }
65
66
67
68
69
70
71 public void testitCustomIncludes()
72 throws Exception
73 {
74 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0145" );
75
76 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
77 verifier.setAutoclean( false );
78 verifier.deleteDirectory( "target" );
79 verifier.deleteDirectory( "mod-a/target" );
80 verifier.deleteDirectory( "mod-b/target" );
81 verifier.addCliOption( "-r" );
82 verifier.addCliOption( "-Dmaven.reactor.includes=mod-a/pom.xml" );
83 verifier.setLogFileName( "log-includes.txt" );
84 verifier.executeGoal( "validate" );
85 verifier.verifyErrorFreeLog();
86 verifier.resetStreams();
87
88 verifier.assertFileNotPresent( "target/touch.txt" );
89 verifier.assertFilePresent( "mod-a/target/touch-a.txt" );
90 verifier.assertFileNotPresent( "mod-b/target/touch-b.txt" );
91 }
92
93
94
95
96
97
98 public void testitCustomExcludes()
99 throws Exception
100 {
101 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0145" );
102
103 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
104 verifier.setAutoclean( false );
105 verifier.deleteDirectory( "target" );
106 verifier.deleteDirectory( "mod-a/target" );
107 verifier.deleteDirectory( "mod-b/target" );
108 verifier.addCliOption( "-r" );
109 verifier.addCliOption( "-Dmaven.reactor.excludes=mod-a/pom.xml" );
110 verifier.setLogFileName( "log-excludes.txt" );
111 verifier.executeGoal( "validate" );
112 verifier.verifyErrorFreeLog();
113 verifier.resetStreams();
114
115 verifier.assertFilePresent( "target/touch.txt" );
116 verifier.assertFileNotPresent( "mod-a/target/touch-a.txt" );
117 verifier.assertFilePresent( "mod-b/target/touch-b.txt" );
118 }
119
120 }