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
24 import org.apache.maven.it.util.ResourceExtractor;
25
26
27
28
29
30
31
32
33
34 public class MavenITmng3746POMPropertyOverrideTest
35 extends AbstractMavenIntegrationTestCase
36 {
37 public MavenITmng3746POMPropertyOverrideTest()
38 {
39 super( "(2.0.8,)" );
40 }
41
42 public void testitMNG3746_UsingDefaultSystemProperty()
43 throws Exception
44 {
45
46
47 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3746" );
48 File pluginDir = new File( testDir, "maven-mng3746-plugin" );
49 File projectDir = new File( testDir, "project" );
50
51 Verifier verifier;
52
53 verifier = newVerifier( pluginDir.getAbsolutePath(), "remote" );
54 verifier.setLogFileName( "log-sys.txt" );
55 verifier.executeGoal( "install" );
56 verifier.verifyErrorFreeLog();
57 verifier.resetStreams();
58
59 verifier = newVerifier( projectDir.getAbsolutePath() );
60 verifier.setLogFileName( "log-sys.txt" );
61 verifier.executeGoal( "validate" );
62 verifier.verifyErrorFreeLog();
63 verifier.resetStreams();
64 }
65
66 public void testitMNG3746_UsingCLIProperty()
67 throws Exception
68 {
69
70
71 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3746" );
72 File pluginDir = new File( testDir, "maven-mng3746-plugin" );
73 File projectDir = new File( testDir, "project" );
74
75 Verifier verifier;
76
77 verifier = newVerifier( pluginDir.getAbsolutePath(), "remote" );
78 verifier.setLogFileName( "log-cli.txt" );
79 verifier.executeGoal( "install" );
80 verifier.verifyErrorFreeLog();
81 verifier.resetStreams();
82
83 verifier = newVerifier( projectDir.getAbsolutePath() );
84 verifier.setLogFileName( "log-cli.txt" );
85
86 verifier.addCliOption( "-Dtest.verification=cli" );
87 verifier.addCliOption( "-Dtest.usingCliValue=true" );
88 verifier.addCliOption( "-Djava.version=cli" );
89
90 verifier.executeGoal( "validate" );
91 verifier.verifyErrorFreeLog();
92 verifier.resetStreams();
93 }
94 }