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 java.io.File;
23 import java.util.Arrays;
24 import java.util.Collections;
25 import java.util.List;
26
27 import org.apache.maven.it.util.ResourceExtractor;
28
29
30
31
32
33
34
35 public class MavenITmng4129PluginExecutionInheritanceTest
36 extends AbstractMavenIntegrationTestCase
37 {
38
39 public MavenITmng4129PluginExecutionInheritanceTest()
40 {
41 super( "[3.0-alpha-3,)" );
42 }
43
44
45
46
47
48
49 public void testit()
50 throws Exception
51 {
52 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4129" );
53
54 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
55 verifier.setAutoclean( false );
56 verifier.deleteDirectory( "target" );
57 verifier.deleteDirectory( "child-1/target" );
58 verifier.deleteDirectory( "child-2/target" );
59 verifier.executeGoal( "validate" );
60 verifier.verifyErrorFreeLog();
61 verifier.resetStreams();
62
63 List<String> executions = verifier.loadLines( "target/executions.txt", "UTF-8" );
64 Collections.sort( executions );
65 assertEquals( Arrays.asList( new String[] { "inherited-execution", "non-inherited-execution" } ), executions );
66
67 List<String> executions1 = verifier.loadLines( "child-1/target/executions.txt", "UTF-8" );
68 assertEquals( Collections.singletonList( "inherited-execution" ), executions1 );
69
70 List<String> executions2 = verifier.loadLines( "child-2/target/executions.txt", "UTF-8" );
71 assertEquals( Collections.singletonList( "inherited-execution" ), executions2 );
72 }
73
74 }