Got it working the following:
pom.xml:
| ...
| <plugin>
| <groupId>org.apache.maven.plugins</groupId>
| <artifactId>maven-surefire-plugin</artifactId>
| <configuration>
| <suiteXmlFiles>
| <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
| </suiteXmlFiles>
|
| <!-- This trick allows the JBoss EJB3StandaloneBootstrap to find and
deploy our compiled EJBs!! -->
| <systemProperties>
| <property>
| <name>java.class.path</name>
| <value>target/classes</value>
| </property>
| </systemProperties>
| </configuration>
| </plugin>
| ...
|
TestNG test class:
| public class EJB3Test extends AssertJUnit {
|
| @Configuration(groups = "integration.ejb3", beforeSuite = true)
| public static void startupEmbeddedJboss()
| {
| EJB3StandaloneBootstrap.boot(null);
| EJB3StandaloneBootstrap.scanClasspath();
| }
|
| @Configuration(groups = "integration.ejb3", afterSuite = true)
| public static void shutdownEmbeddedJboss()
| {
| EJB3StandaloneBootstrap.shutdown();
| }
|
| @Test(groups = "integration.ejb3")
| public void testSubtract() throws Exception {
| Calculator calculator = (Calculator) new
InitialContext().lookup("CalculatorBean/local");
| assertEquals(0, calculator.subtract(1, 1));
| }
|
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960939#3960939
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960939
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user