[jboss-user] [EJB 3.0] - Re: Embeddable EJB3 with Maven2?

wonnekeysers do-not-reply at jboss.com
Wed Jul 26 07:11:00 EDT 2006


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



More information about the jboss-user mailing list