Skip to content

Commit

Permalink
Initial Jetty7+ tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alesj committed Mar 21, 2011
1 parent 287f6e3 commit f20e390
Show file tree
Hide file tree
Showing 6 changed files with 312 additions and 0 deletions.
19 changes: 19 additions & 0 deletions environments/servlet/pom.xml
Expand Up @@ -19,6 +19,7 @@
<module>tests/base</module>
<module>tests/tomcat</module>
<module>tests/jetty</module>
<module>tests/jetty7</module>
</modules>

<description>
Expand Down Expand Up @@ -113,6 +114,24 @@
<version>${jetty7.version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-plus</artifactId>
<version>${jetty7.version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jndi</artifactId>
<version>${jetty7.version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>${jetty7.version}</version>
</dependency>

<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
Expand Down
196 changes: 196 additions & 0 deletions environments/servlet/tests/jetty7/pom.xml
@@ -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>
@@ -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");
}
}
@@ -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>");
}
@@ -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>
6 changes: 6 additions & 0 deletions parent/pom.xml
Expand Up @@ -189,6 +189,12 @@
<version>${arquillian.version}</version>
</dependency>

<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-jetty-embedded-7</artifactId>
<version>${arquillian.version}</version>
</dependency>

<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-glassfish-embedded-3</artifactId>
Expand Down

0 comments on commit f20e390

Please sign in to comment.