Skip to content
This repository has been archived by the owner on Nov 17, 2017. It is now read-only.

Ftest #42

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions bootstrap/demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Running Integration Tests
-------------------------

To run all integration tests with JBoss AS 7.1 in managed mode use:

mvn clean verify -Pftest,container-jbossas-managed-7


Running Unit Tests
-------------------------

To run all unit tests use:

mvn clean verify
75 changes: 69 additions & 6 deletions bootstrap/demo/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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/xsd/maven-4.0.0.xsd">
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>
Expand All @@ -14,19 +14,25 @@
<packaging>war</packaging>

<properties>
<version.jbossas-71>7.1.1.Final</version.jbossas-71>
<version.graphene.arquillian>2.0.0.Alpha1</version.graphene.arquillian>

<javax.faces.PROJECT_STAGE>Development</javax.faces.PROJECT_STAGE>

<jboss7-1Home>${project.build.directory}/jboss-as-${version.jbossas7-1}</jboss7-1Home>

<junit.suite>**/UnitTestsSuite.java</junit.suite>

</properties>

<dependencies>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-ui</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.richfaces.sandbox.ui.bootstrap</groupId>
Expand All @@ -36,7 +42,6 @@
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-web-6.0</artifactId>
<version>3.0.1.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand All @@ -46,16 +51,66 @@
<scope>provided</scope>
</dependency>

<!-- junit dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- Arquillian dependencies -->
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>graphene-webdriver</artifactId>
<scope>test</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>

<!-- Resolution of JAR libraries into WAR archive -->
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<scope>test</scope>
</dependency>

<!-- Opera driver, selenium dependencies -->
<dependency>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<finalName>bootstrap-demo</finalName>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>${junit.suite}</include>
</includes>
</configuration>
<executions>
<execution>
<id>default-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
Expand Down Expand Up @@ -92,13 +147,21 @@
</plugins>
</build>
</profile>

<profile>
<id>production</id>
<properties>
<javax.faces.PROJECT_STAGE>Production</javax.faces.PROJECT_STAGE>
</properties>
</profile>


<profile>
<id>ftest</id>
<properties>
<junit.suite>**/IntegrationTestsSuite.java</junit.suite>
</properties>
</profile>

</profiles>
</project>


Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,15 @@
**/
package org.richfaces.bootstrap.demo;

import org.junit.Assert;
import org.junit.Test;
import org.richfaces.bootstrap.demo.jaxb.javaee.FaceletTaglibTagType;
import org.richfaces.bootstrap.demo.jaxb.javaee.FaceletTaglibType;

import java.io.InputStream;
import junit.framework.Assert;
import org.junit.Test;

/**
* @author <a href="http://community.jboss.org/people/bleathem">Brian Leathem</a>
*/

public class TaglibReaderTest {

@Test
public void getStreamTest() throws Exception {
TaglibReader reader = new TaglibReader();
Expand All @@ -43,7 +40,6 @@ public void getStreamTest() throws Exception {
@Test
public void readTaglibTest() throws Exception {
TaglibReader taglibReader = new TaglibReader();
InputStream stream = taglibReader.getStream();
Assert.assertNotNull(taglibReader.getTaglib());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* JBoss, Home of Professional Open Source
* Copyright 2012, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt 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.richfaces.bootstrap.demo.ftest;

import java.net.URL;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.maven.MavenImporter;
import org.junit.runner.RunWith;

/**
* @author <a href="mailto:jstefek@redhat.com">Jiri Stefek</a>
*/
@RunWith(Arquillian.class)
public class AbstractBootsrapDemoTest {

@ArquillianResource
protected URL deploymentURL;

@Deployment(testable = false)
public static WebArchive createTestArchive() {
return ShrinkWrap.create(MavenImporter.class, "bootstrap-demo.war").loadEffectivePom("pom.xml").importBuildOutput()
.as(WebArchive.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* JBoss, Home of Professional Open Source
* Copyright 2012, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt 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.richfaces.bootstrap.demo.ftest.webdriver;

import java.net.MalformedURLException;
import java.net.URL;
import org.jboss.arquillian.drone.api.annotation.Drone;
import org.junit.Before;
import org.openqa.selenium.WebDriver;
import org.richfaces.bootstrap.demo.ftest.AbstractBootsrapDemoTest;

/**
* @author <a href="mailto:jstefek@redhat.com">Jiri Stefek</a>
*/
public abstract class AbstractWebDriverTest extends AbstractBootsrapDemoTest {

private static final String PREFIX_TEST_URL = "component/";
//
@Drone
protected WebDriver driver;

abstract protected String getComponentName();

private URL getPathURL() throws MalformedURLException {
return new URL(deploymentURL, getTestURL());
}

private String getTestURL() {
return PREFIX_TEST_URL + getComponentName();
}

@Before
public void initialize() throws MalformedURLException {
initializePageUrl();
}

public void initializePageUrl() throws MalformedURLException {
driver.get(getPathURL().toString());
}
}