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.ArrayList;
26 import java.util.List;
27 import java.util.Properties;
28
29
30
31
32
33
34 public class MavenITmng4415InheritedPluginOrderTest
35 extends AbstractMavenIntegrationTestCase
36 {
37
38 public MavenITmng4415InheritedPluginOrderTest()
39 {
40 super( "[2.0.5,)" );
41 }
42
43
44
45
46
47
48
49
50
51 public void testit()
52 throws Exception
53 {
54 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4415" );
55
56 Verifier verifier = newVerifier( new File( testDir, "sub" ).getAbsolutePath() );
57 verifier.setAutoclean( false );
58 verifier.deleteDirectory( "target" );
59 verifier.executeGoal( "validate" );
60 verifier.verifyErrorFreeLog();
61 verifier.resetStreams();
62
63 Properties props = verifier.loadProperties( "target/it.properties" );
64 assertNotNull( props.getProperty( "project.build.plugins" ) );
65
66 List<String> expected = new ArrayList<>();
67 expected.add( "maven-it-plugin-error" );
68 expected.add( "maven-it-plugin-configuration" );
69 expected.add( "maven-it-plugin-dependency-resolution" );
70 expected.add( "maven-it-plugin-packaging" );
71 expected.add( "maven-it-plugin-log-file" );
72 expected.add( "maven-it-plugin-expression" );
73 expected.add( "maven-it-plugin-fork" );
74 expected.add( "maven-it-plugin-touch" );
75
76 List<String> actual = new ArrayList<>();
77
78 int count = Integer.parseInt( props.getProperty( "project.build.plugins" ) );
79 for ( int i = 0; i < count; i++ )
80 {
81 actual.add( props.getProperty( "project.build.plugins." + i + ".artifactId" ) );
82 }
83
84 actual.retainAll( expected );
85
86 assertEquals( actual, expected );
87 }
88
89 }