Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
312 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<parent> | ||
<artifactId>weld-servlet-parent</artifactId> | ||
<groupId>org.jboss.weld.servlet</groupId> | ||
<version>1.1.0-SNAPSHOT</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.jboss.weld.servlet</groupId> | ||
<artifactId>weld-servlet-test-jetty7</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Weld Servlet Integration Tests (Jetty7)</name> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>servlet-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.jboss.spec.javax.ejb</groupId> | ||
<artifactId>jboss-ejb-api_3.1_spec</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>commons-httpclient</groupId> | ||
<artifactId>commons-httpclient</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.jboss.arquillian</groupId> | ||
<artifactId>arquillian-junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.jboss.weld.servlet</groupId> | ||
<artifactId>weld-servlet-test-base</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.faces</groupId> | ||
<artifactId>jsf-api</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.faces</groupId> | ||
<artifactId>jsf-impl</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>jstl</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<defaultGoal>test</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-report-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>generate-test-report</id> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>report-only</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}/surefire-reports</outputDirectory> | ||
<outputName>test-report</outputName> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<!-- | ||
Set parallel none to force a more modern JUnitCore | ||
provider that understands Suites, | ||
http://old.nabble.com/Maven-Surefire-and-newer-junit-features-td28539796.html | ||
--> | ||
<parallel>none</parallel> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>default</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
<property> | ||
<name>default</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<!-- Skip the tests by default, they are all "incontainer" --> | ||
<skipTests>true</skipTests> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>incontainer</id> | ||
<activation> | ||
<property> | ||
<name>incontainer</name> | ||
</property> | ||
</activation> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jboss.arquillian.container</groupId> | ||
<artifactId>arquillian-jetty-embedded-7</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<!-- plus and naming requires for using JNDI --> | ||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-plus</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-jndi</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-webapp</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<!-- Weld servlet, EL and JSP required for testing CDI injections --> | ||
<dependency> | ||
<groupId>org.jboss.weld.servlet</groupId> | ||
<artifactId>weld-servlet-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.jboss.weld</groupId> | ||
<artifactId>weld-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.glassfish.web</groupId> | ||
<artifactId>el-impl</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.servlet.jsp</groupId> | ||
<artifactId>jsp-api</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-jdk14</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
46 changes: 46 additions & 0 deletions
46
.../src/test/java/org/jboss/weld/environment/servlet/test/injection/FilterInjectionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2010, Red Hat Middleware LLC, and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.jboss.weld.environment.servlet.test.injection; | ||
|
||
import org.jboss.arquillian.api.Deployment; | ||
import org.jboss.arquillian.api.Run; | ||
import org.jboss.arquillian.junit.Arquillian; | ||
import org.jboss.shrinkwrap.api.spec.WebArchive; | ||
|
||
import org.junit.runner.RunWith; | ||
import static org.jboss.arquillian.api.RunModeType.AS_CLIENT; | ||
import static org.jboss.weld.environment.servlet.test.util.JettyDeployments.JETTY_ENV; | ||
|
||
/** | ||
* @author Ales Justin | ||
*/ | ||
@RunWith(Arquillian.class) | ||
@Run(AS_CLIENT) | ||
public class FilterInjectionTest extends FilterInjectionTestBase | ||
{ | ||
@Deployment | ||
public static WebArchive deployment() | ||
{ | ||
return FilterInjectionTestBase.deployment().addWebResource(JETTY_ENV, "jetty-env.xml"); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...s/jetty7/src/test/java/org/jboss/weld/environment/servlet/test/util/JettyDeployments.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2010, Red Hat Middleware LLC, and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.jboss.weld.environment.servlet.test.util; | ||
|
||
import org.jboss.shrinkwrap.api.asset.Asset; | ||
import org.jboss.shrinkwrap.api.asset.StringAsset; | ||
|
||
/** | ||
* @author Ales Justin | ||
*/ | ||
public class JettyDeployments | ||
{ | ||
public static final Asset JETTY_ENV = new StringAsset("<Configure id=\"webAppCtx\" class=\"org.eclipse.jetty.webapp.WebAppContext\"><New class=\"org.eclipse.jetty.plus.naming.EnvEntry\"><Arg><Ref id=\"webAppCtx\"/></Arg><Arg>BeanManager</Arg><Arg><New class=\"javax.naming.Reference\"><Arg>javax.enterprise.inject.spi.BeanManager</Arg><Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg><Arg/></New></Arg><Arg type=\"boolean\">true</Arg></New></Configure>"); | ||
} |
11 changes: 11 additions & 0 deletions
11
environments/servlet/tests/jetty7/src/test/resources/arquillian.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<arquillian xmlns="http://jboss.com/arquillian" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:jetty7="urn:arq:org.jboss.arquillian.container.jetty.embedded_7"> | ||
|
||
<jetty7:container> | ||
<jetty7:bindHttpPort>8888</jetty7:bindHttpPort> | ||
<jetty7:jettyPlus>false</jetty7:jettyPlus> | ||
</jetty7:container> | ||
|
||
</arquillian> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters