Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
Rearrange and test servlet-based examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmcwhirter committed Dec 1, 2015
1 parent 01c939e commit ea7e554
Show file tree
Hide file tree
Showing 11 changed files with 151 additions and 39 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -154,9 +154,9 @@
<module>jsf</module>
<module>messaging</module>
<module>msc</module>
<module>servlet</module>
<module>static</module>
<!--
<module>cdi-servlet</module>
<module>datasource-deployment</module>
<module>datasource-subsystem</module>
<module>docker-jaxrs-app</module>
Expand Down
40 changes: 8 additions & 32 deletions servlet/pom.xml
Expand Up @@ -15,40 +15,16 @@
<relativePath>../</relativePath>
</parent>

<artifactId>wildfly-swarm-example-servlet</artifactId>
<artifactId>examples-servlet</artifactId>

<name>WildFly Swarm Examples: Servlet</name>
<description>WildFly Swarm Examples: Servlet</description>
<name>WildFly Swarm Examples: Servlet parent</name>
<description>WildFly Swarm Examples: Servlet parent</description>

<packaging>war</packaging>
<packaging>pom</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-undertow</artifactId>
<version>${version.wildfly-swarm}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.7</version>
</dependency>
</dependencies>

<modules>
<module>servlet-war</module>
<module>servlet-cdi</module>
</modules>
</project>
File renamed without changes.
23 changes: 19 additions & 4 deletions cdi-servlet/pom.xml → servlet/servlet-cdi/pom.xml
Expand Up @@ -10,15 +10,15 @@

<parent>
<groupId>org.wildfly.swarm.examples</groupId>
<artifactId>wildfly-swarm-examples-parent</artifactId>
<artifactId>examples-servlet</artifactId>
<version>1.0.0.Alpha6-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

<artifactId>wildfly-swarm-example-cdi-servlet</artifactId>
<artifactId>example-servlet-cdi</artifactId>

<name>WildFly Swarm Examples: CDI and Servlet</name>
<description>WildFly Swarm Examples: CDI and Servlet</description>
<name>WildFly Swarm Examples: Servlet with CDI</name>
<description>WildFly Swarm Examples: Servlet with CDI</description>

<packaging>war</packaging>

Expand All @@ -34,11 +34,26 @@
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
<executions>
<execution>
<id>package</id>
</execution>
<execution>
<id>start</id>
</execution>
<execution>
<id>stop</id>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.wildfly.swarm.examples</groupId>
<artifactId>examples-base</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-weld</artifactId>
Expand Down
@@ -0,0 +1,26 @@
package org.wildfly.swarm.it.servlet.cdi;

import org.jboss.arquillian.drone.api.annotation.Drone;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.WebDriver;
import org.wildfly.swarm.it.AbstractIntegrationTest;

import static org.fest.assertions.Assertions.assertThat;

/**
* @author Bob McWhirter
*/
@RunWith(Arquillian.class)
public class ServletApplicationIT extends AbstractIntegrationTest {

@Drone
WebDriver browser;

@Test
public void testIt() {
browser.navigate().to("http://localhost:8080/");
assertThat(browser.getPageSource()).contains("Howdy at ");
}
}
@@ -1,4 +1,4 @@
package org.wildfly.swarm.examples.cdi;
package org.wildfly.swarm.examples.servlet.cdi;

import java.time.LocalDateTime;

Expand Down
@@ -1,4 +1,4 @@
package org.wildfly.swarm.examples.cdi;
package org.wildfly.swarm.examples.servlet.cdi;

import java.io.IOException;

Expand Down
File renamed without changes.
69 changes: 69 additions & 0 deletions servlet/servlet-war/pom.xml
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2015 Red Hat, Inc. and/or its affiliates.
~
~ Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.wildfly.swarm.examples</groupId>
<artifactId>examples-servlet</artifactId>
<version>1.0.0.Alpha6-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

<artifactId>example-servlet-war</artifactId>

<name>WildFly Swarm Examples: Servlet .war</name>
<description>WildFly Swarm Examples: Servlet .war</description>

<packaging>war</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
<executions>
<execution>
<id>package</id>
</execution>
<execution>
<id>start</id>
</execution>
<execution>
<id>stop</id>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.wildfly.swarm.examples</groupId>
<artifactId>examples-base</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-undertow</artifactId>
<version>${version.wildfly-swarm}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.7</version>
</dependency>
</dependencies>

</project>
@@ -0,0 +1,26 @@
package org.wildfly.swarm.it.servlet;

import org.jboss.arquillian.drone.api.annotation.Drone;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.WebDriver;
import org.wildfly.swarm.it.AbstractIntegrationTest;

import static org.fest.assertions.Assertions.assertThat;

/**
* @author Bob McWhirter
*/
@RunWith(Arquillian.class)
public class ServletApplicationIT extends AbstractIntegrationTest {

@Drone
WebDriver browser;

@Test
public void testIt() {
browser.navigate().to("http://localhost:8080/");
assertThat(browser.getPageSource()).contains("Howdy at ");
}
}

0 comments on commit ea7e554

Please sign in to comment.