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.Verifier;
23 import org.apache.maven.it.util.ResourceExtractor;
24
25 import java.io.File;
26 import java.util.Properties;
27
28
29
30
31
32
33 public class MavenITmng2201PluginConfigInterpolationTest
34 extends AbstractMavenIntegrationTestCase
35 {
36
37 public MavenITmng2201PluginConfigInterpolationTest()
38 {
39 super( "(2.0.8,)" );
40 }
41
42
43
44
45 public void testitMNG2201()
46 throws Exception
47 {
48 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2201" );
49 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
50 verifier.setAutoclean( false );
51 verifier.deleteDirectory( "target" );
52 verifier.executeGoal( "validate" );
53 verifier.verifyErrorFreeLog();
54 verifier.resetStreams();
55
56 testDir = testDir.getCanonicalFile();
57
58 Properties props = verifier.loadProperties( "target/config.properties" );
59 assertEquals( new File( testDir, "target" ), new File( props.getProperty( "stringParam" ) ) );
60 assertEquals( new File( testDir, "target" ), new File( props.getProperty( "propertiesParam.buildDir" ) ) );
61 assertEquals( new File( testDir, "target" ), new File( props.getProperty( "mapParam.buildDir" ) ) );
62 assertEquals( "4.0.0", props.getProperty( "domParam.children.modelVersion.0.value" ) );
63 assertEquals( "org.apache.maven.its.it0104", props.getProperty( "domParam.children.groupId.0.value" ) );
64 assertEquals( "1.0-SNAPSHOT", props.getProperty( "domParam.children.version.0.value" ) );
65 assertEquals( "jar", props.getProperty( "domParam.children.packaging.0.value" ) );
66 assertEquals( "http://maven.apache.org", props.getProperty( "domParam.children.url.0.value" ) );
67 assertEquals( "Apache", props.getProperty( "domParam.children.organization.0.children.name.0.value" ) );
68 assertEquals( new File( testDir, "target" ), new File( props.getProperty( "domParam.children.build.0.children.directory.0.value" ) ) );
69 assertEquals( new File( testDir, "target/classes" ), new File( props.getProperty( "domParam.children.build.0.children.outputDirectory.0.value" ) ) );
70 }
71
72 }