Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arquillian "embedded" SLSB test in AS7.1.1 environment #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 178 additions & 0 deletions ejb31-as7-embedded/out.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
/usr/lib/jvm/java
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.jboss.arquillian.examples:ejb31-jbembedded:jar:2.0.Final
[WARNING] 'dependencies.dependency.scope' for org.jboss.arquillian:arquillian-bom:pom must be one of [provided, compile, runtime, test, system] but is 'import'. @ line 63, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Arquillian Examples EJB3.1 JBoss AS 7 Embedded 2.0.Final
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ ejb31-jbembedded ---
[INFO] org.jboss.arquillian.examples:ejb31-jbembedded:jar:2.0.Final
[INFO] +- junit:junit:jar:4.8.2:test
[INFO] +- org.jboss.spec:jboss-javaee-6.0:pom:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.resource:jboss-connector-api_1.5_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar:1.0.0.Final:provided
[INFO] | | \- javax.xml:jaxrpc-api:jar:1.1:provided
[INFO] | +- org.jboss.spec.javax.el:jboss-el-api_2.2_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.enterprise.deploy:jboss-jad-api_1.2_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.security.auth.message:jboss-jaspi-api_1.0_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.xml.registry:jboss-jaxr-api_1.0_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.jms:jboss-jms-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.servlet.jsp:jboss-jsp-api_2.2_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.xml.rpc:jboss-jaxrpc-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.xml.soap:jboss-saaj-api_1.3_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.xml.ws:jboss-jaxws-api_2.2_spec:jar:1.0.0.Final:provided
[INFO] | +- javax.activation:activation:jar:1.1:provided
[INFO] | +- javax.enterprise:cdi-api:jar:1.0-SP4:provided
[INFO] | +- com.sun.faces:jsf-api:jar:2.0.3-b05:provided
[INFO] | +- javax.inject:javax.inject:jar:1:provided
[INFO] | +- javax.jws:jsr181-api:jar:1.0-MR1:provided
[INFO] | +- javax.mail:mail:jar:1.4.2:provided
[INFO] | +- javax.servlet:jstl:jar:1.2:provided
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.resteasy:jaxrs-api:jar:2.1.0.GA:provided
[INFO] | +- stax:stax-api:jar:1.0.1:provided
[INFO] | \- javax.validation:validation-api:jar:1.0.0.GA:provided
[INFO] +- org.jboss.as:jboss-as-arquillian-container-managed:jar:7.1.1.Final:test
[INFO] | +- org.jboss.as:jboss-as-arquillian-common:jar:7.1.1.Final:test
[INFO] | | +- org.jboss.arquillian.container:arquillian-container-osgi:jar:1.0.2.Final:test
[INFO] | | +- org.jboss.arquillian.testenricher:arquillian-testenricher-cdi:jar:1.0.0.CR7:test
[INFO] | | +- org.jboss.arquillian.testenricher:arquillian-testenricher-ejb:jar:1.0.0.CR7:test
[INFO] | | +- org.jboss.arquillian.testenricher:arquillian-testenricher-initialcontext:jar:1.0.0.CR7:test
[INFO] | | +- org.jboss.arquillian.testenricher:arquillian-testenricher-osgi:jar:1.0.2.Final:test
[INFO] | | +- org.jboss.arquillian.testenricher:arquillian-testenricher-resource:jar:1.0.0.CR7:test
[INFO] | | +- org.jboss.as:jboss-as-arquillian-testenricher-msc:jar:7.1.1.Final:test
[INFO] | | | \- org.jboss.msc:jboss-msc:jar:1.0.2.GA:test
[INFO] | | +- org.jboss.as:jboss-as-controller-client:jar:7.1.1.Final:test
[INFO] | | | +- org.jboss.as:jboss-as-protocol:jar:7.1.1.Final:test
[INFO] | | | | \- org.jboss.xnio:xnio-nio:jar:3.0.3.GA:test
[INFO] | | | +- org.jboss:jboss-dmr:jar:1.1.1.Final:test
[INFO] | | | \- org.jboss.threads:jboss-threads:jar:2.0.0.GA:test
[INFO] | | +- org.jboss.as:jboss-as-jmx:jar:7.1.1.Final:test
[INFO] | | | +- org.jboss:jboss-common-core:jar:2.2.17.GA:test
[INFO] | | | +- org.jboss.as:jboss-as-server:jar:7.1.1.Final:test
[INFO] | | | | +- org.jboss.as:jboss-as-controller:jar:7.1.1.Final:test
[INFO] | | | | | \- org.jboss:staxmapper:jar:1.1.0.Final:test
[INFO] | | | | +- org.jboss.as:jboss-as-domain-http-interface:jar:7.1.1.Final:test
[INFO] | | | | | +- org.jboss.as:jboss-as-domain-management:jar:7.1.1.Final:test
[INFO] | | | | | \- org.jboss.com.sun.httpserver:httpserver:jar:1.0.0.Final:test
[INFO] | | | | +- org.jboss.as:jboss-as-deployment-repository:jar:7.1.1.Final:test
[INFO] | | | | +- org.jboss.as:jboss-as-embedded:jar:7.1.1.Final:test
[INFO] | | | | +- org.jboss.as:jboss-as-platform-mbean:jar:7.1.1.Final:test
[INFO] | | | | +- org.jboss.as:jboss-as-process-controller:jar:7.1.1.Final:test
[INFO] | | | | | \- system:jdk-tools:jar:jdk:system
[INFO] | | | | +- org.jboss.as:jboss-as-remoting:jar:7.1.1.Final:test
[INFO] | | | | | +- org.jboss.as:jboss-as-network:jar:7.1.1.Final:test
[INFO] | | | | | \- org.jboss.as:jboss-as-threads:jar:7.1.1.Final:test
[INFO] | | | | +- org.jboss:jandex:jar:1.0.3.Final:test
[INFO] | | | | +- org.jboss.invocation:jboss-invocation:jar:1.1.1.Final:test
[INFO] | | | | +- org.jboss.logmanager:jboss-logmanager-log4j:jar:1.0.0.GA:test
[INFO] | | | | +- org.jboss.stdio:jboss-stdio:jar:1.0.1.GA:test
[INFO] | | | | \- org.jboss:jboss-vfs:jar:3.1.0.Final:test
[INFO] | | | \- org.jboss.marshalling:jboss-marshalling-river:jar:1.3.11.GA:test
[INFO] | | +- org.jboss.shrinkwrap:shrinkwrap-api:jar:1.0.0-cr-1:test
[INFO] | | +- org.jboss.osgi.spi:jbosgi-spi:jar:3.0.1.Final:test
[INFO] | | | \- org.jboss.osgi.vfs:jbosgi-vfs:jar:1.0.7.Final:test
[INFO] | | +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven:jar:1.0.0-beta-5:test
[INFO] | | | +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api:jar:1.0.0-beta-5:test
[INFO] | | | +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven:jar:1.0.0-beta-5:test
[INFO] | | | +- org.sonatype.aether:aether-api:jar:1.8:test
[INFO] | | | +- org.sonatype.aether:aether-util:jar:1.8:test
[INFO] | | | +- org.sonatype.aether:aether-connector-wagon:jar:1.8:test
[INFO] | | | | +- org.sonatype.aether:aether-spi:jar:1.8:test
[INFO] | | | | \- org.codehaus.plexus:plexus-container-default:jar:1.5.5:test
[INFO] | | | | +- org.codehaus.plexus:plexus-classworlds:jar:2.2.2:test
[INFO] | | | | +- org.apache.xbean:xbean-reflect:jar:3.4:test
[INFO] | | | | | \- log4j:log4j:jar:1.2.12:test
[INFO] | | | | \- com.google.collections:google-collections:jar:1.0:test
[INFO] | | | +- org.apache.maven:maven-aether-provider:jar:3.0.1:test
[INFO] | | | | +- org.apache.maven:maven-model:jar:3.0.1:test
[INFO] | | | | +- org.apache.maven:maven-model-builder:jar:3.0.1:test
[INFO] | | | | +- org.apache.maven:maven-repository-metadata:jar:3.0.1:test
[INFO] | | | | +- org.sonatype.aether:aether-impl:jar:1.8:test
[INFO] | | | | +- org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:test
[INFO] | | | | \- org.codehaus.plexus:plexus-utils:jar:2.0.4:test
[INFO] | | | +- org.apache.maven:maven-settings-builder:jar:3.0.1:test
[INFO] | | | | +- org.codehaus.plexus:plexus-interpolation:jar:1.14:test
[INFO] | | | | +- org.apache.maven:maven-settings:jar:3.0.1:test
[INFO] | | | | \- org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:test
[INFO] | | | | \- org.sonatype.plexus:plexus-cipher:jar:1.4:test
[INFO] | | | +- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-7:test
[INFO] | | | +- org.apache.maven.wagon:wagon-file:jar:1.0-beta-7:test
[INFO] | | | \- org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-7:test
[INFO] | | | \- org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-7:test
[INFO] | | \- org.osgi:org.osgi.core:jar:4.2.0:test
[INFO] | +- org.jboss.as:jboss-as-arquillian-protocol-jmx:jar:7.1.1.Final:test
[INFO] | | +- org.jboss.as:jboss-as-osgi-service:jar:7.1.1.Final:test
[INFO] | | | +- org.jboss.as:jboss-as-ee:jar:7.1.1.Final:test
[INFO] | | | | +- org.hibernate:hibernate-validator:jar:4.2.0.Final:test
[INFO] | | | | | \- org.slf4j:slf4j-api:jar:1.6.1:test
[INFO] | | | | +- org.jboss.interceptor:jboss-interceptor-spi:jar:2.0.0.Final:test
[INFO] | | | | +- org.jboss.metadata:jboss-metadata-common:jar:7.0.1.Final:test
[INFO] | | | | \- org.jboss.metadata:jboss-metadata-ear:jar:7.0.1.Final:test
[INFO] | | | +- org.jboss.as:jboss-as-naming:jar:7.1.1.Final:test
[INFO] | | | | \- org.jboss:jboss-remote-naming:jar:1.0.2.Final:test
[INFO] | | | | \- org.jboss:jboss-ejb-client:jar:1.0.0.Final:test
[INFO] | | | +- org.jboss.modules:jboss-modules:jar:1.1.1.GA:test
[INFO] | | | +- org.jboss.osgi.framework:jbosgi-framework-core:jar:1.1.8.Final:test
[INFO] | | | | +- org.jboss.osgi.deployment:jbosgi-deployment:jar:1.0.12.Final:test
[INFO] | | | | +- org.jboss.osgi.resolver:jbosgi-resolver-felix:jar:1.0.13.Final:test
[INFO] | | | | | +- org.jboss.osgi.resolver:jbosgi-resolver-api:jar:1.0.13.Final:test
[INFO] | | | | | | \- org.jboss.osgi.metadata:jbosgi-metadata:jar:2.0.3.Final:test
[INFO] | | | | | \- org.jboss.osgi.resolver:jbosgi-resolver-spi:jar:1.0.13.Final:test
[INFO] | | | | +- org.jboss.osgi.vfs:jbosgi-vfs30:jar:1.0.7.Final:test
[INFO] | | | | \- org.osgi:org.osgi.compendium:jar:4.2.0:test
[INFO] | | | +- org.jboss.osgi.repository:jbosgi-repository-core:jar:1.0.5:test
[INFO] | | | | \- org.jboss.osgi.repository:jbosgi-repository-api:jar:1.0.5:test
[INFO] | | | | \- org.jboss.osgi.resolver:jbosgi-resolver-api-v2:jar:2.0.0.Beta2:test
[INFO] | | | | \- org.apache.felix:org.apache.felix.resolver:jar:0.1.0.Beta1:test
[INFO] | | | \- org.osgi:org.osgi.enterprise:jar:4.2.0:test
[INFO] | | +- org.jboss.arquillian.core:arquillian-core-spi:jar:1.0.0.CR7:test
[INFO] | | \- org.jboss.arquillian.protocol:arquillian-protocol-jmx:jar:1.0.0.CR7:test
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.1.0.GA:test
[INFO] | +- org.jboss.remoting3:jboss-remoting:jar:3.2.3.GA:test
[INFO] | | \- org.jboss.xnio:xnio-api:jar:3.0.0.GA:test
[INFO] | +- org.jboss.remotingjmx:remoting-jmx:jar:1.0.2.Final:test
[INFO] | | +- org.jboss.logmanager:jboss-logmanager:jar:1.2.2.GA:test
[INFO] | | \- org.jboss.marshalling:jboss-marshalling:jar:1.3.9.GA:test
[INFO] | +- org.jboss.sasl:jboss-sasl:jar:1.0.0.Final:test
[INFO] | +- org.jboss.arquillian.core:arquillian-core-api:jar:1.0.0.CR7:test
[INFO] | \- org.jboss.as:jboss-as-build-config:jar:7.1.1.Final:test
[INFO] +- org.jboss.arquillian:arquillian-bom:pom:1.0.1.Final:import
[INFO] \- org.jboss.arquillian.junit:arquillian-junit-container:jar:1.0.1.Final:test
[INFO] +- org.jboss.arquillian.junit:arquillian-junit-core:jar:1.0.1.Final:test
[INFO] +- org.jboss.arquillian.test:arquillian-test-api:jar:1.0.1.Final:test
[INFO] +- org.jboss.arquillian.test:arquillian-test-spi:jar:1.0.1.Final:test
[INFO] +- org.jboss.arquillian.container:arquillian-container-test-api:jar:1.0.1.Final:test
[INFO] +- org.jboss.arquillian.container:arquillian-container-test-spi:jar:1.0.1.Final:test
[INFO] | \- org.jboss.arquillian.container:arquillian-container-spi:jar:1.0.1.Final:test
[INFO] | \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-api-base:jar:2.0.0-alpha-3:test
[INFO] +- org.jboss.arquillian.core:arquillian-core-impl-base:jar:1.0.1.Final:test
[INFO] +- org.jboss.arquillian.test:arquillian-test-impl-base:jar:1.0.1.Final:test
[INFO] +- org.jboss.arquillian.container:arquillian-container-impl-base:jar:1.0.1.Final:test
[INFO] | +- org.jboss.arquillian.config:arquillian-config-api:jar:1.0.1.Final:test
[INFO] | +- org.jboss.arquillian.config:arquillian-config-impl-base:jar:1.0.1.Final:test
[INFO] | \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-spi:jar:2.0.0-alpha-3:test
[INFO] +- org.jboss.arquillian.container:arquillian-container-test-impl-base:jar:1.0.1.Final:test
[INFO] \- org.jboss.shrinkwrap:shrinkwrap-impl-base:jar:1.0.1:test
[INFO] \- org.jboss.shrinkwrap:shrinkwrap-spi:jar:1.0.1:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.306s
[INFO] Finished at: Sun Jul 15 07:33:01 EDT 2012
[INFO] Final Memory: 19M/295M
[INFO] ------------------------------------------------------------------------
94 changes: 94 additions & 0 deletions ejb31-as7-embedded/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?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">

<!-- Model Information -->
<modelVersion>4.0.0</modelVersion>

<!-- Artifact Information -->
<groupId>org.jboss.arquillian.examples</groupId>
<artifactId>ejb31-jbembedded</artifactId>
<name>Arquillian Examples EJB3.1 JBoss AS 7 Embedded</name>
<version>2.0.Final</version>
<description>Simple Arquillian EJB3.1 JBoss AS 7 Embedded Project</description>

<!-- Properties -->
<properties>
<version.junit>4.8.2</version.junit>

<!-- Versioning -->
<version.org.jboss.arquillian>1.0.1.Final</version.org.jboss.arquillian>

<!-- The target version of AS to be used -->
<version.org.jboss.jbossas>7.1.1.Final</version.org.jboss.jbossas>
</properties>

<!-- Dependencies -->
<dependencies>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
<scope>test</scope>
</dependency>

</dependencies>

<!-- Profiles -->
<profiles>
<profile>
<id>jbossas-embedded-7</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
<version>7.1.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.0.1.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
<version>1.0.1.Final</version>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>

</profile>
</profiles>

</project>

22 changes: 22 additions & 0 deletions ejb31-as7-embedded/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

ejb31-jbembedded

Arquillian enables you to test your business logic in a remote or embedded container. Alternatively, it can deploy an archive to the container so the test can interact as a remote client.

All about arquillian: http://jboss.org/arquillian

Example contains EJB3.1 integration test and runs against JBoss AS 6 Embedded container. The projects target is to provide simplest possible setup for this test combination.

Getting started
================
1) Download sources.
2) Configure JBoss Maven repositories in settings.xml (http://community.jboss.org/wiki/MavenGettingStarted).
3) Run: mvn test.

Tests will be executed within container. Container will be started by Arquillian, automatically.

System requirements
===================
All you need to run this project is Java 5.0 (Java SDK 1.5) or greater and
Maven 2.0.10 or greater. This application is setup to be run on a Java EE 6
certified application server.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.jboss.arquillian.examples.jbembedded;

import javax.ejb.Stateless;

/**
* EJB3.1. with no-interface view.
*
* @author <a href="mailto:[email protected]">Michael Schuetz</a>
*/
@Stateless
public class HelloEJB {

public String sayHelloEJB(String name) {

return "Hello " + name;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package org.jboss.arquillian.examples.jbembedded;

import javax.ejb.EJB;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.asset.Asset;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertEquals;

@RunWith(Arquillian.class)
public class HelloEJBTest {

//@EJB(lookup="java:module/HelloEJB!org.jboss.arquillian.examples.jbembedded.HelloEJB")
@EJB(lookup="java:global/helloEJB/HelloEJB!org.jboss.arquillian.examples.jbembedded.HelloEJB")
private HelloEJB helloEJB;

@Deployment
public static JavaArchive createTestArchive() {
return ShrinkWrap.create(JavaArchive.class, "helloEJB.jar")
.addClasses(HelloEJB.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}

@Test
public void testHelloEJB() {
String result = helloEJB.sayHelloEJB("Michael");
assertEquals("Hello Michael", result);
}
}