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 java.io.File;
23 import java.util.Properties;
24
25 import org.apache.maven.it.util.ResourceExtractor;
26
27
28
29
30
31
32
33 public class MavenITmng3955EffectiveSettingsTest
34 extends AbstractMavenIntegrationTestCase
35 {
36
37 public MavenITmng3955EffectiveSettingsTest()
38 {
39 super( ALL_MAVEN_VERSIONS );
40 }
41
42
43
44
45
46
47
48 public void testitMNG3955()
49 throws Exception
50 {
51 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3955" );
52
53 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
54 verifier.setAutoclean( false );
55 verifier.addCliOption( "--settings" );
56 verifier.addCliOption( "settings.xml" );
57 verifier.addCliOption( "--offline" );
58 verifier.addCliOption( "--batch-mode" );
59 verifier.executeGoal( "validate" );
60 verifier.verifyErrorFreeLog();
61 verifier.resetStreams();
62
63 Properties props = verifier.loadProperties( "target/settings.properties" );
64 assertEquals( "true", props.getProperty( "settings.offline" ) );
65 assertEquals( "false", props.getProperty( "settings.interactiveMode" ) );
66 assertEquals( new File( verifier.getLocalRepository() ).getAbsoluteFile(),
67 new File( props.getProperty( "settings.localRepository" ) ).getAbsoluteFile() );
68 }
69
70 }