Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

JSFUNIT-291 Update and simplify Getting Started application #5

Merged
merged 1 commit into from

1 participant

@ssilvert
Owner

Also, add NetBeans configuration file to .gitignore

@ssilvert ssilvert JSFUNIT-291 Update and simplify Getting Started application
Also, add NetBeans configuration file to .gitignore
226ad56
@ssilvert ssilvert merged commit 5a9c51f into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 14, 2011
  1. @ssilvert

    JSFUNIT-291 Update and simplify Getting Started application

    ssilvert authored
    Also, add NetBeans configuration file to .gitignore
This page is out of date. Refresh to see the latest.
View
1  .gitignore
@@ -2,3 +2,4 @@
.classpath
.settings/
target/
+nb-configuration.xml
View
337 gettingstarted/pom.xml
@@ -2,116 +2,133 @@
<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">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.jboss.jsfunit</groupId>
- <artifactId>gettingstarted</artifactId>
- <version>2.0.0.Beta2-SNAPSHOT</version>
- <packaging>war</packaging>
- <name>Minimal example for the Getting Started Guide</name>
-
- <repositories>
- <repository>
- <id>jboss-public-repository-group</id>
- <name>JBoss Public Maven Repository Group</name>
- <url>https://repository.jboss.org/nexus/content/groups/public</url>
- <layout>default</layout>
- <releases>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- </repository>
- <repository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
- <releases>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>jboss-public-repository-group</id>
- <name>JBoss Public Maven Repository Group</name>
- <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
- <layout>default</layout>
- <releases>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- </pluginRepository>
- <pluginRepository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
- <releases>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
-
- <properties>
- <version.jsfunit>2.0.0.Beta2-SNAPSHOT</version.jsfunit>
- <version.arquillian>1.0.0.Alpha5</version.arquillian>
- <version.jboss_60>6.0.0.Final</version.jboss_60>
- </properties>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.jsfunit</groupId>
+ <artifactId>gettingstarted</artifactId>
+ <version>2.0.0.Beta2</version>
+ <packaging>war</packaging>
+ <name>Minimal example for the Getting Started Guide</name>
+
+ <repositories>
+ <repository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public</url>
+ <layout>default</layout>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Repository Group</name>
+ <url>http://repository.jboss.org/nexus/content/groups/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <properties>
+ <version.jsfunit>2.0.0.Beta2</version.jsfunit>
+ <version.arquillian>1.0.0.CR4</version.arquillian>
+ <version.arquillian.jboss>1.0.0.CR2</version.arquillian.jboss>
+ <version.shrinkwrap>1.0.0-beta-5</version.shrinkwrap>
+ <version.shrinkwrap.descriptors>1.1.0-alpha-2</version.shrinkwrap.descriptors>
+ <version.jboss_60>6.0.0.Final</version.jboss_60>
+ </properties>
<!-- Dependencies common to all containers -->
- <dependencies>
- <dependency>
- <groupId>javax.enterprise</groupId>
- <artifactId>cdi-api</artifactId>
- <scope>provided</scope>
- <version>1.0-SP1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.2</version>
+ <scope>test</scope>
+ </dependency>
- <dependency>
- <groupId>org.jboss.arquillian</groupId>
- <artifactId>arquillian-junit</artifactId>
- <version>${version.arquillian}</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian.junit</groupId>
+ <artifactId>arquillian-junit-container</artifactId>
+ <version>${version.arquillian}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.protocol</groupId>
+ <artifactId>arquillian-protocol-servlet</artifactId>
+ <version>${version.arquillian}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-container-spi</artifactId>
+ <version>${version.arquillian}</version>
+ <scope>test</scope>
+ </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>2.0.4-b03</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.faces</groupId>
+ <artifactId>jboss-jsf-api_2.1_spec</artifactId>
+ <version>2.0.0.Beta1</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>jboss.web</groupId>
- <artifactId>servlet-api</artifactId>
- <version>3.0.0-beta-2</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.servlet</groupId>
+ <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <version>1.0.0.Final</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>org.jboss.jsfunit</groupId>
- <artifactId>jsfunit-arquillian</artifactId>
- <version>${version.jsfunit}</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.jsfunit</groupId>
+ <artifactId>jsfunit-arquillian</artifactId>
+ <version>${version.jsfunit}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jsfunit</groupId>
+ <artifactId>jboss-jsfunit-core</artifactId>
+ <version>${version.jsfunit}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.descriptors</groupId>
+ <artifactId>shrinkwrap-descriptors-impl</artifactId>
+ <version>${version.shrinkwrap.descriptors}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-api-maven</artifactId>
+ <version>${version.shrinkwrap}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
+ <version>${version.shrinkwrap}</version>
+ <scope>test</scope>
+ </dependency>
- </dependencies>
+ </dependencies>
<profiles>
<profile>
@@ -120,12 +137,12 @@
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-jbossas-remote-6</artifactId>
- <version>${version.arquillian}</version>
+ <version>${version.arquillian.jboss}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-client</artifactId>
+ <artifactId>jboss-as-profileservice-client</artifactId>
<version>${version.jboss_60}</version>
<type>pom</type>
</dependency>
@@ -142,117 +159,7 @@
<scope>test</scope>
</dependency>
</dependencies>
- <build>
- <testResources>
- <testResource>
- <directory>src/test/resources-jbossremote</directory>
- <excludes>
- <exclude>jndi.properties</exclude>
- </excludes>
- </testResource>
- </testResources>
- </build>
</profile>
- <profile>
- <id>jetty-embedded</id>
- <dependencies>
- <dependency>
- <groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-jetty-embedded-7</artifactId>
- <version>${version.arquillian}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-webapp</artifactId>
- <version>7.0.2.v20100331</version>
- <scope>test</scope>
- </dependency>
- <!-- jetty-plus required for using JNDI -->
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-plus</artifactId>
- <version>7.0.2.v20100331</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Weld servlet, EL, JSP, and jsr250 required for testing CDI injections -->
- <dependency>
- <groupId>org.jboss.weld.servlet</groupId>
- <artifactId>weld-servlet</artifactId>
- <version>1.1.0.Final</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish.web</groupId>
- <artifactId>el-impl</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
-
- <!-- These are extras that need to be added to the WAR for jetty -->
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- <version>1.0</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>2.0.4-b03</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>1.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <!-- Set system property so that the test will know to add extra
- libraries for jetty. -->
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.8.1</version>
- <configuration>
- <systemProperties>
- <property>
- <name>jetty-embedded</name>
- <value>active</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
</profiles>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
View
11 gettingstarted/readme.txt
@@ -0,0 +1,11 @@
+The Getting Started applicaiton is completely independent. This project's pom does not inherit from any parent pom and it does not rely on a settings.xml file. This way, it can show everything that one needs to set up a JSFUnit/Arquillian project.
+
+The Getting Started applicaiton can be run with JBossAS 6.x or JBossAS 7.x. Both are set to run in remote mode. To modify the build for other containers or other modes, see the Arquillian documentation. You can also see configurations for other containers and modes at https://github.com/jsfunit/jsfunit/tree/master/examples-arquillian.
+
+To run Getting Started with JBoss AS6:
+1) Start the server process for JBoss AS6
+2) mvn -Pjbossas-remote-6 test
+
+To run Getting Started with JBoss AS7:
+1) Start the server process for JBoss AS7
+2) mvn -Pjbossas-remote-7 test
View
24 gettingstarted/src/test/java/org/jboss/jsfunit/example/hellojsf/HelloJSFTest.java
@@ -29,16 +29,13 @@
import junit.framework.Assert;
-import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.jsfunit.api.InitialPage;
import org.jboss.jsfunit.jsfsession.JSFClientSession;
import org.jboss.jsfunit.jsfsession.JSFServerSession;
import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
-import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -60,30 +57,11 @@ public static WebArchive createDeployment() {
.setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
.addPackage(Package.getPackage("org.jboss.jsfunit.example.hellojsf")) // my test package
.addAsWebResource(new File("src/main/webapp", "index.xhtml"))
- .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addAsWebInfResource(new File("src/main/webapp/WEB-INF/faces-config.xml"), "faces-config.xml");
-
- prepareForJetty(war);
-
// System.out.println(war.toString(true)); // for debugging
return war;
}
- private static void prepareForJetty(WebArchive war)
- {
- if (!IS_JETTY) return;
-
- war.setWebXML(new File("src/main/jetty/web.xml")) // jetty web.xml needs extra declarations
- .addAsWebInfResource(new File("src/main/jetty/jetty-env.xml"), "jetty-env.xml")
- .addAsLibraries(
- DependencyResolvers.use(MavenDependencyResolver.class).artifacts(
- "com.sun.faces:jsf-api:2.0.4-b03",
- "com.sun.faces:jsf-impl:2.0.4-b03",
- "org.glassfish.web:el-impl:2.2",
- "javax.annotation:jsr250-api:1.0",
- "javax.servlet:jstl:1.2").resolveAsFiles());
- }
-
@Test
@InitialPage("/index.faces")
public void testInitialPage(JSFServerSession server, JSFClientSession client) throws IOException
View
11 gettingstarted/src/test/resources-jbossremote/arquillian.xml
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-
-<arquillian xmlns="http://jboss.com/arquillian"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:jboss="urn:arq:org.jboss.arquillian.container.jbossas.remote_6">
-
- <engine>
- <deploymentExportPath>target/</deploymentExportPath>
- </engine>
-
-</arquillian>
View
3  gettingstarted/src/test/resources-jbossremote/jndi.properties
@@ -1,3 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
-java.naming.provider.url=jnp://localhost:1099
View
11 gettingstarted/src/test/resources/arquillian.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian-1.0.xsd">
+
+ <engine>
+ <property name="deploymentExportPath">target/</property>
+ </engine>
+
+ <defaultProtocol type="Servlet 3.0" />
+
+</arquillian>
Something went wrong with that request. Please try again.