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 public class MavenITmng4053PluginConfigAttributesTest
33 extends AbstractMavenIntegrationTestCase
34 {
35
36 public MavenITmng4053PluginConfigAttributesTest()
37 {
38 super( "[2.0.3,)" );
39 }
40
41
42
43
44
45
46
47 public void testitWithoutPluginMngt()
48 throws Exception
49 {
50 testit( "test-1" );
51 }
52
53
54
55
56
57
58
59 public void testitWithPluginMngt()
60 throws Exception
61 {
62 testit( "test-2" );
63 }
64
65
66
67
68
69
70
71 public void testitWithPluginMngtAndProfile()
72 throws Exception
73 {
74 testit( "test-3" );
75 }
76
77 private void testit( String test )
78 throws Exception
79 {
80 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4053/" + test );
81
82 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
83 verifier.setAutoclean( false );
84 verifier.deleteDirectory( "target" );
85 verifier.executeGoal( "validate" );
86 verifier.verifyErrorFreeLog();
87 verifier.resetStreams();
88
89 Properties props = verifier.loadProperties( "target/config.properties" );
90
91 assertEquals( "src", props.getProperty( "domParam.children.copy.0.attributes.todir" ) );
92 assertEquals( "true", props.getProperty( "domParam.children.copy.0.attributes.overwrite" ) );
93 assertEquals( "2", props.getProperty( "domParam.children.copy.0.attributes" ) );
94
95 assertEquals( "target", props.getProperty( "domParam.children.copy.0.children.fileset.0.attributes.dir" ) );
96 assertNull( props.getProperty( "domParam.children.copy.0.children.fileset.0.attributes.todir" ) );
97 assertNull( props.getProperty( "domParam.children.copy.0.children.fileset.0.attributes.overwrite" ) );
98 assertEquals( "1", props.getProperty( "domParam.children.copy.0.children.fileset.0.attributes" ) );
99 }
100
101 }