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 MavenITmng0680ParentBasedirTest
34 extends AbstractMavenIntegrationTestCase
35 {
36 public MavenITmng0680ParentBasedirTest()
37 {
38 super( ALL_MAVEN_VERSIONS );
39 }
40
41
42
43
44
45
46 public void testitMNG680()
47 throws Exception
48 {
49 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-0680" );
50
51 testDir = testDir.getCanonicalFile();
52
53 File subDir = new File( testDir, "subproject" );
54
55 Verifier verifier = newVerifier( subDir.getAbsolutePath() );
56 verifier.setAutoclean( false );
57 verifier.deleteDirectory( "target" );
58 verifier.executeGoal( "validate" );
59 verifier.verifyErrorFreeLog();
60 verifier.resetStreams();
61
62 Properties props = verifier.loadProperties( "target/basedir.properties" );
63 assertEquals( subDir, new File( props.getProperty( "project.basedir" ) ) );
64 assertEquals( testDir, new File( props.getProperty( "project.parent.basedir" ) ) );
65 }
66
67 }