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.Properties;
26
27
28
29
30
31
32
33 public class MavenITmng2591MergeInheritedPluginConfigTest
34 extends AbstractMavenIntegrationTestCase
35 {
36
37 public MavenITmng2591MergeInheritedPluginConfigTest()
38 {
39 super( "(2.0.7,)" );
40 }
41
42
43
44
45
46
47
48 public void testitNoProfile()
49 throws Exception
50 {
51 testit( "no-profile" );
52 }
53
54
55
56
57
58
59
60 public void testitWithProfile()
61 throws Exception
62 {
63 testit( "with-profile" );
64 }
65
66 private void testit( String project )
67 throws Exception
68 {
69 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2591/" + project );
70 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
71 verifier.setAutoclean( false );
72 verifier.deleteDirectory( "subproject/target" );
73 verifier.executeGoal( "validate" );
74 verifier.verifyErrorFreeLog();
75 verifier.resetStreams();
76
77 Properties props = verifier.loadProperties( "subproject/target/config.properties" );
78
79 assertEquals( "8", props.getProperty( "stringParams" ) );
80 assertEquals( "PARENT-1", props.getProperty( "stringParams.0" ) );
81 assertEquals( "PARENT-3", props.getProperty( "stringParams.1" ) );
82 assertEquals( "PARENT-2", props.getProperty( "stringParams.2" ) );
83 assertEquals( "PARENT-4", props.getProperty( "stringParams.3" ) );
84 assertEquals( "CHILD-1", props.getProperty( "stringParams.4" ) );
85 assertEquals( "CHILD-3", props.getProperty( "stringParams.5" ) );
86 assertEquals( "CHILD-2", props.getProperty( "stringParams.6" ) );
87 assertEquals( "CHILD-4", props.getProperty( "stringParams.7" ) );
88
89 assertEquals( "8", props.getProperty( "listParam" ) );
90 assertEquals( "PARENT-1", props.getProperty( "listParam.0" ) );
91 assertEquals( "PARENT-3", props.getProperty( "listParam.1" ) );
92 assertEquals( "PARENT-2", props.getProperty( "listParam.2" ) );
93 assertEquals( "PARENT-4", props.getProperty( "listParam.3" ) );
94 assertEquals( "CHILD-1", props.getProperty( "listParam.4" ) );
95 assertEquals( "CHILD-3", props.getProperty( "listParam.5" ) );
96 assertEquals( "CHILD-2", props.getProperty( "listParam.6" ) );
97 assertEquals( "CHILD-4", props.getProperty( "listParam.7" ) );
98 }
99
100 }