Skip to content

Commit ea19764

Browse files
committed
Tests updated for multi-profiles
1 parent 7286436 commit ea19764

3 files changed

Lines changed: 158 additions & 31 deletions

File tree

‎pom.xml‎

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3636
<jboss.spec.version>1.0.0.Final</jboss.spec.version>
3737
<version.rewrite>1.0.6-SNAPSHOT</version.rewrite>
38+
<version.logging>1.0.1.Final</version.logging>
39+
<version.arquillian>1.0.0.Final</version.arquillian>
40+
<version.arquillian.jetty>1.0.0.CR1</version.arquillian.jetty>
41+
<version.jetty>8.1.2.v20120308</version.jetty>
42+
<version.jbossas>7.1.1.Final</version.jbossas>
3843
</properties>
3944

4045
<repositories>
@@ -77,6 +82,18 @@
7782
<scope>test</scope>
7883
</dependency>
7984
</dependencies>
85+
86+
<dependencyManagement>
87+
<dependencies>
88+
<dependency>
89+
<groupId>org.jboss.arquillian</groupId>
90+
<artifactId>arquillian-bom</artifactId>
91+
<version>${version.arquillian}</version>
92+
<type>pom</type>
93+
<scope>import</scope>
94+
</dependency>
95+
</dependencies>
96+
</dependencyManagement>
8097

8198
<developers>
8299
<developer>
@@ -146,6 +163,137 @@
146163
</plugin>
147164
</plugins>
148165
</build>
166+
167+
<profiles>
168+
<profile>
169+
<id>JETTY_EMBEDDED_8.X</id>
170+
<dependencies>
171+
<dependency>
172+
<groupId>org.jboss.arquillian.container</groupId>
173+
<artifactId>arquillian-jetty-embedded-7</artifactId>
174+
<version>${version.arquillian.jetty}</version>
175+
<scope>test</scope>
176+
<exclusions>
177+
<!-- Don't include the old version of arquillian-container-spi -->
178+
<exclusion>
179+
<groupId>org.jboss.arquillian.container</groupId>
180+
<artifactId>arquillian-container-spi</artifactId>
181+
</exclusion>
182+
</exclusions>
183+
</dependency>
184+
<dependency>
185+
<groupId>org.eclipse.jetty</groupId>
186+
<artifactId>jetty-webapp</artifactId>
187+
<version>${version.jetty}</version>
188+
<scope>test</scope>
189+
</dependency>
190+
<dependency>
191+
<groupId>org.eclipse.jetty</groupId>
192+
<artifactId>jetty-plus</artifactId>
193+
<version>${version.jetty}</version>
194+
<scope>test</scope>
195+
</dependency>
196+
<dependency>
197+
<groupId>org.slf4j</groupId>
198+
<artifactId>slf4j-simple</artifactId>
199+
<version>1.5.10</version>
200+
<scope>test</scope>
201+
</dependency>
202+
<dependency>
203+
<groupId>org.slf4j</groupId>
204+
<artifactId>slf4j-log4j12</artifactId>
205+
<version>1.5.10</version>
206+
<scope>test</scope>
207+
</dependency>
208+
<dependency>
209+
<groupId>org.ocpsoft.logging</groupId>
210+
<artifactId>logging-adapter-slf4j</artifactId>
211+
<version>${version.logging}</version>
212+
<scope>test</scope>
213+
</dependency>
214+
215+
<dependency>
216+
<groupId>org.glassfish.web</groupId>
217+
<artifactId>el-impl</artifactId>
218+
<version>2.2</version>
219+
<scope>test</scope>
220+
</dependency>
221+
<dependency>
222+
<groupId>javax.servlet.jsp</groupId>
223+
<artifactId>jsp-api</artifactId>
224+
<version>2.2</version>
225+
<scope>test</scope>
226+
</dependency>
227+
</dependencies>
228+
</profile>
229+
230+
<profile>
231+
<id>JBOSS_AS_MANAGED_7.X</id>
232+
<build>
233+
<plugins>
234+
<plugin>
235+
<artifactId>maven-dependency-plugin</artifactId>
236+
<extensions>false</extensions>
237+
<executions>
238+
<execution>
239+
<id>unpack</id>
240+
<phase>process-test-classes</phase>
241+
<goals>
242+
<goal>unpack</goal>
243+
</goals>
244+
<configuration>
245+
<artifactItems>
246+
<artifactItem>
247+
<groupId>org.jboss.as</groupId>
248+
<artifactId>jboss-as-dist</artifactId>
249+
<version>${version.jbossas}</version>
250+
<type>zip</type>
251+
<overWrite>false</overWrite>
252+
<outputDirectory>../target</outputDirectory>
253+
</artifactItem>
254+
</artifactItems>
255+
</configuration>
256+
</execution>
257+
</executions>
258+
</plugin>
259+
</plugins>
260+
</build>
261+
<dependencies>
262+
<dependency>
263+
<groupId>org.jboss.spec</groupId>
264+
<artifactId>jboss-javaee-web-6.0</artifactId>
265+
<version>3.0.1.Final</version>
266+
<type>pom</type>
267+
<scope>test</scope>
268+
</dependency>
269+
<dependency>
270+
<groupId>org.jboss.as</groupId>
271+
<artifactId>jboss-as-arquillian-container-managed</artifactId>
272+
<version>${version.jbossas}</version>
273+
<scope>test</scope>
274+
</dependency>
275+
</dependencies>
276+
</profile>
277+
278+
<profile>
279+
<id>JBOSS_AS_REMOTE_7.X</id>
280+
<dependencies>
281+
<dependency>
282+
<groupId>org.jboss.spec</groupId>
283+
<artifactId>jboss-javaee-web-6.0</artifactId>
284+
<version>3.0.1.Final</version>
285+
<type>pom</type>
286+
<scope>test</scope>
287+
</dependency>
288+
<dependency>
289+
<groupId>org.jboss.as</groupId>
290+
<artifactId>jboss-as-arquillian-container-remote</artifactId>
291+
<version>${version.jbossas}</version>
292+
<scope>test</scope>
293+
</dependency>
294+
</dependencies>
295+
</profile>
296+
</profiles>
149297

150298
<reporting>
151299
<plugins>

‎test-harness/pom.xml‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,10 @@
2525
<url>http://ocpsoft.org/prettyfaces/</url>
2626

2727
<dependencies>
28-
29-
<!-- Rewrite test harness without Weld -->
3028
<dependency>
3129
<groupId>org.ocpsoft.rewrite</groupId>
3230
<artifactId>rewrite-test-harness</artifactId>
3331
<version>${version.rewrite}</version>
34-
<exclusions>
35-
<exclusion>
36-
<groupId>org.jboss.weld.servlet</groupId>
37-
<artifactId>weld-servlet-core</artifactId>
38-
</exclusion>
39-
<exclusion>
40-
<groupId>org.jboss.weld</groupId>
41-
<artifactId>weld-core</artifactId>
42-
</exclusion>
43-
</exclusions>
4432
</dependency>
4533
</dependencies>
4634

‎test-harness/src/main/java/org/ocpsoft/prettyfaces/test/PrettyFacesTest.java‎

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22

33
import java.io.File;
44

5-
import javax.el.ExpressionFactory;
6-
75
import org.jboss.shrinkwrap.api.GenericArchive;
86
import org.jboss.shrinkwrap.api.ShrinkWrap;
97
import org.jboss.shrinkwrap.api.spec.JavaArchive;
108
import org.jboss.shrinkwrap.api.spec.WebArchive;
9+
import org.ocpsoft.rewrite.test.RewriteTest;
1110
import org.ocpsoft.rewrite.test.RewriteTestBase;
1211

13-
import com.sun.el.ExpressionFactoryImpl;
14-
1512
public class PrettyFacesTest extends RewriteTestBase
1613
{
1714
public static WebArchive getBaseDeployment()
@@ -35,23 +32,17 @@ public static WebArchive getBaseDeployment()
3532
.addAsLibraries(rewriteImplAnnotations)
3633
.addAsLibraries(rewriteIntegrationFaces)
3734

38-
/*
39-
* JSF implementation
40-
*/
41-
.addAsLibraries(resolveDependencies("org.glassfish:javax.faces:jar:2.1.7"))
42-
43-
/*
44-
* Set the EL implementation
45-
*/
46-
.addAsLibraries(resolveDependencies("org.glassfish.web:el-impl:jar:2.2"))
47-
.addAsServiceProvider(ExpressionFactory.class, ExpressionFactoryImpl.class)
48-
49-
/*
50-
* Set up container configuration
51-
*/
52-
.setWebXML("jetty-web.xml")
5335
.addAsWebInfResource("faces-config.xml", "faces-config.xml");
5436

37+
if(RewriteTest.isJetty())
38+
{
39+
/*
40+
* Set the JSF implementation
41+
*/
42+
deployment.addAsLibraries(resolveDependencies("org.glassfish:javax.faces:jar:2.1.7"));
43+
deployment.setWebXML("jetty-web.xml");
44+
}
45+
5546
return deployment;
5647

5748
}

0 commit comments

Comments
 (0)