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
31 public class MavenITmng2363BasedirAwareFileActivatorTest
32 extends AbstractMavenIntegrationTestCase
33 {
34
35 public MavenITmng2363BasedirAwareFileActivatorTest()
36 {
37 super( "[3.0-alpha-3,)" );
38 }
39
40
41
42
43
44
45
46 public void testit()
47 throws Exception
48 {
49 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2363" );
50
51 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
52 verifier.setAutoclean( false );
53 verifier.deleteDirectory( "target" );
54 verifier.deleteDirectory( "sub-a/target" );
55 verifier.deleteDirectory( "sub-b/target" );
56 verifier.executeGoal( "validate" );
57 verifier.verifyErrorFreeLog();
58 verifier.resetStreams();
59
60 verifier.assertFilePresent( "target/parent1.txt" );
61 verifier.assertFilePresent( "target/parent2.txt" );
62 verifier.assertFileNotPresent( "target/file1.txt" );
63 verifier.assertFileNotPresent( "target/file2.txt" );
64
65 verifier.assertFileNotPresent( "sub-a/target/parent1.txt" );
66 verifier.assertFileNotPresent( "sub-a/target/parent2.txt" );
67 verifier.assertFilePresent( "sub-a/target/file1.txt" );
68 verifier.assertFileNotPresent( "sub-a/target/file2.txt" );
69
70 verifier.assertFileNotPresent( "sub-b/target/parent1.txt" );
71 verifier.assertFileNotPresent( "sub-b/target/parent2.txt" );
72 verifier.assertFileNotPresent( "sub-b/target/file1.txt" );
73 verifier.assertFilePresent( "sub-b/target/file2.txt" );
74 }
75
76 }