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 MavenITmng3807PluginConfigExpressionEvaluationTest
33 extends AbstractMavenIntegrationTestCase
34 {
35
36 public MavenITmng3807PluginConfigExpressionEvaluationTest()
37 {
38 super( "[3.0-alpha-3,)" );
39 }
40
41
42
43
44
45
46
47 public void testit()
48 throws Exception
49 {
50 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3807" );
51 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
52 verifier.setAutoclean( false );
53 verifier.deleteDirectory( "target" );
54 verifier.executeGoal( "validate" );
55 verifier.verifyErrorFreeLog();
56 verifier.resetStreams();
57
58 Properties props = verifier.loadProperties( "target/config.properties" );
59
60 assertEvaluated( props.getProperty( "stringParams.0" ) );
61 assertEvaluated( props.getProperty( "stringParams.1" ) );
62
63 assertEvaluated( props.getProperty( "listParam.0" ) );
64 assertEvaluated( props.getProperty( "listParam.1" ) );
65
66 assertEvaluated( props.getProperty( "mapParam.test0" ) );
67 assertEvaluated( props.getProperty( "mapParam.test1" ) );
68
69 assertEvaluated( props.getProperty( "propertiesParam.test0" ) );
70 assertEvaluated( props.getProperty( "propertiesParam.test1" ) );
71 }
72
73 private void assertEvaluated( String value )
74 {
75 assertNotNull( value );
76 assertTrue( value.length() > 0 );
77 assertFalse( value, value.contains( "${" ) );
78 }
79
80 }