forked from wildfly/wildfly
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AS7-1303] Add failing case showing TestNG not working in ARQ AS7; Ma…
…ke ArquillianConfigBuilder support both JUnit and TestNG
- Loading branch information
1 parent
d032667
commit 127b12b
Showing
8 changed files
with
288 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ JBoss, Home of Professional Open Source. | ||
~ Copyright 2010, Red Hat, Inc., 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. | ||
--> | ||
|
||
<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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.jboss.as</groupId> | ||
<artifactId>jboss-as-arquillian</artifactId> | ||
<version>7.1.0.Alpha1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>jboss-as-arquillian-testng-integration</artifactId> | ||
<name>JBoss Application Server: Arquillian TestNG Integration</name> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<jboss.home>${project.basedir}/../../build/target/jboss-as-${jboss.as.release.version}</jboss.home> | ||
</properties> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.jboss.as</groupId> | ||
<artifactId>jboss-as-spec-api</artifactId> | ||
<type>pom</type> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.as</groupId> | ||
<artifactId>jboss-as-arquillian-container-managed</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.arquillian.testng</groupId> | ||
<artifactId>arquillian-testng-container</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<!-- Why does this not come in via arquillian-testng-container? Required. --> | ||
<dependency> | ||
<groupId>com.google.inject</groupId> | ||
<artifactId>guice</artifactId> | ||
<version>2.0</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>copy-resources</id> | ||
<phase>process-test-classes</phase> | ||
<goals> | ||
<goal>copy-resources</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${basedir}/target/jbossas</outputDirectory> | ||
<overwrite>true</overwrite> | ||
<resources> | ||
<resource> | ||
<directory>${jboss.home}</directory> | ||
<excludes> | ||
<exclude>modules/</exclude> | ||
<exclude>bundles/</exclude> | ||
</excludes> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<systemProperties> | ||
<property> | ||
<name>java.util.logging.manager</name> | ||
<value>org.jboss.logmanager.LogManager</value> | ||
</property> | ||
<property> | ||
<name>jboss.home</name> | ||
<value>${basedir}/target/jbossas</value> | ||
</property> | ||
<property> | ||
<name>module.path</name> | ||
<value>${jboss.home}/modules</value> | ||
</property> | ||
</systemProperties> | ||
<redirectTestOutputToFile>true</redirectTestOutputToFile> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
52 changes: 52 additions & 0 deletions
52
...egration/src/test/java/org/jboss/as/arquillian/testng/BasicTestNGIntegrationTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors | ||
* as indicated by the @authors tag. All rights reserved. | ||
* See the copyright.txt in the distribution for a | ||
* full listing of individual contributors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.jboss.as.arquillian.testng; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.arquillian.container.test.api.Deployment; | ||
import org.jboss.arquillian.testng.Arquillian; | ||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.asset.EmptyAsset; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
/** | ||
* Ensures that the basic startup/deployment etc facilities of the Arquillian container are working with TestNG w/ AS7. AS7-1303 | ||
* | ||
* @author <a href="mailto:alr@jboss.org">Andrew Lee Rubinger</a> | ||
*/ | ||
public class BasicTestNGIntegrationTestCase extends Arquillian { | ||
|
||
@Deployment | ||
public static JavaArchive create() { | ||
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class).addClass(GreetingService.class); | ||
archive.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); | ||
return archive; | ||
} | ||
|
||
@Inject | ||
private GreetingService service; | ||
|
||
@Test | ||
public void shouldBeAbleToInject() throws Exception { | ||
Assert.assertNotNull(service); | ||
Assert.assertEquals("Hello Earthling!", service.greet("Earthling")); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...lian/testng-integration/src/test/java/org/jboss/as/arquillian/testng/GreetingService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors | ||
* as indicated by the @authors tag. All rights reserved. | ||
* See the copyright.txt in the distribution for a | ||
* full listing of individual contributors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.jboss.as.arquillian.testng; | ||
|
||
/** | ||
* GreetingService | ||
* | ||
* @author <a href="mailto:aslak@redhat.com">Aslak Knutsen</a> | ||
* @version $Revision: $ | ||
*/ | ||
public class GreetingService { | ||
public String greet(String name) { | ||
return "Hello " + name + "!"; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
arquillian/testng-integration/src/test/resources/arquillian.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<arquillian xmlns="http://jboss.org/schema/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"> | ||
|
||
<container qualifier="jboss" default="true"> | ||
<configuration> | ||
<property name="jbossHome">target/jbossas</property> | ||
</configuration> | ||
</container> | ||
</arquillian> |
Oops, something went wrong.