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.HashMap;
26 import java.util.Map;
27 import java.util.Properties;
28
29 public class MavenIT0090EnvVarInterpolationTest
30 extends AbstractMavenIntegrationTestCase
31 {
32 public MavenIT0090EnvVarInterpolationTest()
33 {
34 super( ALL_MAVEN_VERSIONS );
35 }
36
37
38
39
40
41
42
43 public void testit0090()
44 throws Exception
45 {
46 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0090" );
47
48 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
49 Map<String, String> envVars = new HashMap<>();
50 envVars.put( "MAVEN_TEST_ENVAR", "MAVEN_TEST_ENVAR_VALUE" );
51 verifier.setAutoclean( false );
52 verifier.deleteDirectory( "target" );
53 verifier.executeGoal( "validate", envVars );
54 verifier.verifyErrorFreeLog();
55 verifier.resetStreams();
56
57 Properties props = verifier.loadProperties( "target/env.properties" );
58 assertEquals( "MAVEN_TEST_ENVAR_VALUE", props.getProperty( "stringParam" ) );
59 }
60
61 }