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
26
27
28
29
30
31 public class MavenITmng3221InfiniteForkingTest
32 extends AbstractMavenIntegrationTestCase
33 {
34 public MavenITmng3221InfiniteForkingTest()
35 {
36 super( "(2.0.8,3.0-alpha-1)" );
37 }
38
39 public void testitMNG3221a()
40 throws Exception
41 {
42 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3221" );
43
44 File reportDir = new File( testDir, "report" );
45 File projectDir = new File( testDir, "user" );
46
47 Verifier verifier = null;
48
49 try
50 {
51 verifier = newVerifier( reportDir.getAbsolutePath(), "remote" );
52
53 verifier.deleteArtifact( "org.apache.maven.its.mng3221", "maven-forking-report-plugin", "1", "jar" );
54
55 verifier.setLogFileName( "mng-3221-a-log.txt" );
56 verifier.executeGoal( "install" );
57 verifier.verifyErrorFreeLog();
58 verifier.resetStreams();
59
60 verifier = newVerifier( projectDir.getAbsolutePath(), "remote" );
61
62 verifier.addCliOption( "-Psite" );
63
64 verifier.setLogFileName( "mng-3221-a-log.txt" );
65 verifier.executeGoal( "site" );
66 verifier.verifyErrorFreeLog();
67 }
68 finally
69 {
70 if ( verifier != null )
71 {
72 verifier.resetStreams();
73 }
74 }
75 }
76
77 public void testitMNG3221b()
78 throws Exception
79 {
80 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3221" );
81
82 File pluginDir = new File( testDir, "plugin" );
83 File projectDir = new File( testDir, "user" );
84
85 Verifier verifier = null;
86
87 try
88 {
89 verifier = newVerifier( pluginDir.getAbsolutePath(), "remote" );
90
91 verifier.deleteArtifact( "org.apache.maven.its.mng3221", "maven-forking-test-plugin", "1", "jar" );
92
93 verifier.setLogFileName( "mng-3221-b-log.txt" );
94 verifier.executeGoal( "install" );
95 verifier.verifyErrorFreeLog();
96 verifier.resetStreams();
97
98 verifier = newVerifier( projectDir.getAbsolutePath(), "remote" );
99
100 verifier.addCliOption( "-Pplugin" );
101
102 verifier.setLogFileName( "mng-3221-b-log.txt" );
103 verifier.executeGoal( "package" );
104 verifier.verifyErrorFreeLog();
105 }
106 finally
107 {
108 if ( verifier != null )
109 {
110 verifier.resetStreams();
111 }
112 }
113 }
114 }