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 MavenITmng3831PomInterpolationTest
34 extends AbstractMavenIntegrationTestCase
35 {
36
37 public MavenITmng3831PomInterpolationTest()
38 {
39 super( "(,2.0.2),(2.0.2,)" );
40 }
41
42
43
44
45
46
47 public void testitMNG3831()
48 throws Exception
49 {
50 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3831" );
51 File child = new File( testDir, "child" );
52
53 Verifier verifier = newVerifier( child.getAbsolutePath() );
54 verifier.executeGoal( "initialize" );
55 verifier.verifyErrorFreeLog();
56 verifier.resetStreams();
57
58 Properties props = verifier.loadProperties( "target/interpolated.properties" );
59 String prefix = "project.properties.";
60
61 assertEquals( child.getCanonicalFile(), new File( props.getProperty( prefix + "projectDir" ) ).getCanonicalFile() );
62
63 assertEquals( "org.apache.maven.its.mng3831.child", props.getProperty( prefix + "projectGroupId" ) );
64 assertEquals( "child", props.getProperty( prefix + "projectArtifactId" ) );
65 assertEquals( "2.0-alpha-1", props.getProperty( prefix + "projectVersion" ) );
66 assertEquals( "jar", props.getProperty( prefix + "projectPackaging" ) );
67
68 assertEquals( "child-name", props.getProperty( prefix + "projectName" ) );
69 assertEquals( "child-desc", props.getProperty( prefix + "projectDesc" ) );
70 assertEquals( "http://child.org/", props.getProperty( prefix + "projectUrl" ) );
71 assertEquals( "2008", props.getProperty( prefix + "projectYear" ) );
72 assertEquals( "child-org-name", props.getProperty( prefix + "projectOrgName" ) );
73
74 assertEquals( "2.0.0", props.getProperty( prefix + "projectPrereqMvn" ) );
75 assertEquals( "http://scm.org/", props.getProperty( prefix + "projectScmUrl" ) );
76 assertEquals( "http://issue.org/", props.getProperty( prefix + "projectIssueUrl" ) );
77 assertEquals( "http://ci.org/", props.getProperty( prefix + "projectCiUrl" ) );
78 assertEquals( "child-dist-repo", props.getProperty( prefix + "projectDistRepoName" ) );
79 assertEquals( "http://dist.org/", props.getProperty( prefix + "projectDistRepoUrl" ) );
80 assertEquals( "http://site.org/", props.getProperty( prefix + "projectDistSiteUrl" ) );
81
82 assertEquals( "org.apache.maven.its.mng3831", props.getProperty( prefix + "parentGroupId" ) );
83 assertEquals( "parent", props.getProperty( prefix + "parentArtifactId" ) );
84 assertEquals( "1.0", props.getProperty( prefix + "parentVersion" ) );
85
86
87
88
89
90 if ( matchesVersionRange( "(2.0.8,)" ) )
91 {
92 assertTrue( props.getProperty( prefix + "projectBuildOut" ).endsWith( "bin" ) );
93 }
94 assertTrue( props.getProperty( prefix + "projectSiteOut" ).endsWith( "doc" ) );
95 }
96
97 }