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 public class MavenITmng5578SessionScopeTest
27 extends AbstractMavenIntegrationTestCase
28 {
29 public MavenITmng5578SessionScopeTest()
30 {
31 super( "[3.2.4,)" );
32 }
33
34 public void testBasic()
35 throws Exception
36 {
37 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5578-session-scope" );
38 File pluginDir = new File( testDir, "plugin" );
39 File projectDir = new File( testDir, "basic" );
40
41 Verifier verifier;
42
43
44 verifier = newVerifier( pluginDir.getAbsolutePath(), "remote" );
45 verifier.executeGoal( "install" );
46 verifier.resetStreams();
47 verifier.verifyErrorFreeLog();
48
49
50 verifier = newVerifier( projectDir.getAbsolutePath(), "remote" );
51 verifier.addCliOption( "-Dit-build-extensions=false" );
52 verifier.executeGoal( "package" );
53 verifier.resetStreams();
54 verifier.verifyErrorFreeLog();
55 }
56
57 public void testBasic_multithreaded()
58 throws Exception
59 {
60 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5578-session-scope" );
61 File pluginDir = new File( testDir, "plugin" );
62 File projectDir = new File( testDir, "basic" );
63
64 Verifier verifier;
65
66
67 verifier = newVerifier( pluginDir.getAbsolutePath(), "remote" );
68 verifier.executeGoal( "install" );
69 verifier.resetStreams();
70 verifier.verifyErrorFreeLog();
71
72
73 verifier = newVerifier( projectDir.getAbsolutePath(), "remote" );
74 verifier.addCliOption( "-Dit-build-extensions=false" );
75 verifier.addCliOption( "--builder multithreaded -T 1" );
76 verifier.executeGoal( "package" );
77 verifier.resetStreams();
78 verifier.verifyErrorFreeLog();
79 }
80
81 public void testBasic_buildExtension()
82 throws Exception
83 {
84 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5578-session-scope" );
85 File pluginDir = new File( testDir, "plugin" );
86 File projectDir = new File( testDir, "basic" );
87
88 Verifier verifier;
89
90
91 verifier = newVerifier( pluginDir.getAbsolutePath(), "remote" );
92 verifier.executeGoal( "install" );
93 verifier.resetStreams();
94 verifier.verifyErrorFreeLog();
95
96
97 verifier = newVerifier( projectDir.getAbsolutePath(), "remote" );
98 verifier.addCliOption( "-Dit-build-extensions=true" );
99 verifier.executeGoal( "package" );
100 verifier.resetStreams();
101 verifier.verifyErrorFreeLog();
102 }
103
104 public void testExtension()
105 throws Exception
106 {
107 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5578-session-scope" );
108 File extensionDir = new File( testDir, "extension" );
109 File pluginDir = new File( testDir, "extension-plugin" );
110 File projectDir = new File( testDir, "extension-project" );
111
112 Verifier verifier;
113
114
115 verifier = newVerifier( extensionDir.getAbsolutePath(), "remote" );
116 verifier.executeGoal( "install" );
117 verifier.resetStreams();
118 verifier.verifyErrorFreeLog();
119
120
121 verifier = newVerifier( pluginDir.getAbsolutePath(), "remote" );
122 verifier.executeGoal( "install" );
123 verifier.resetStreams();
124 verifier.verifyErrorFreeLog();
125
126
127 verifier = newVerifier( projectDir.getAbsolutePath(), "remote" );
128 verifier.addCliOption( "-Dmaven.ext.class.path=" + new File( extensionDir, "target/classes" ).getAbsolutePath() );
129 verifier.setForkJvm( true );
130 verifier.executeGoal( "package" );
131 verifier.resetStreams();
132 verifier.verifyErrorFreeLog();
133
134 }
135 }