Its a surefire testng bug.
It is indeed a very anoying one en apparently there is some working on I
don't know what the bug id is.
however what you can do is use maven-antrun-plugin although I don't know how
to fail a complete build when the tests fail but at least you can figure out
what the failed tests are.
Here is my setup
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
<!-- this ant script runs testng natively -->
<execution>
<id>testng55</id>
<phase>test</phase>
<configuration>
<tasks>
<taskdef resource="testngtasks"
classpath="testng.jar" classpathref="
maven.test.classpath" />
<testng
classpathref="maven.test.classpath"
outputdir="target/test-reports">
<xmlfileset dir="src/test/resources"
includes="*.xml" />
</testng>
<junitreport
todir="target/test-reports">
<fileset
dir="target/test-reports">
<include name="**/*.xml" />
</fileset>
<report format="noframes"
todir="target/test-reports" />
</junitreport>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-junit</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>
</plugin>
<!-- disable surefire plugin (too many problems!) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4</version>
<configuration>
<skip>true</skip>
<forkMode>once</forkMode>
<suiteXmlFiles>
<suiteXmlFile>
/src/test/resources/testsuite-
integration-ejb3.xml
</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
hope it helps
On 8/12/07, r_sudh <[EMAIL PROTECTED]> wrote:
>
>
> Here is the code from the test class that I'm using:
>
> EJB3StandaloneBootstrap.boot(null);
> EJB3StandaloneBootstrap.scanClasspath();
> Hashtable<String, String> props = new Hashtable<String,
> String>();
> props.put("java.naming.factory.initial",
> "
> org.jnp.interfaces.LocalOnlyContextFactory");
> props.put("java.naming.factory.url.pkgs",
> "org.jboss.naming:org.jnp.interfaces");
>
> initialContext = new InitialContext(props);
>
> OwnerDAO dao = (OwnerDAO) initialContext.lookup
> ("OwnerDAOBean/local");
>
> Like I said, the lookup fails if I run it via maven and works fine if I
> launch it via TestNG
>
> r_sudh wrote:
> >
> > I have a maven project in Eclipse with EJB 3.0 style Entity beans and
> > Session Beans. I'm using TestNG to run my tests that launch the JBoss
> > micro-container and successfully tests all my EJB code.
> >
> > I'd now like to have all of this working using maven outside of Eclipse
> > (so I can use a Continuous Integration server). I'm not fully clear on
> > what all I need to configure. I have the following in my pom.xml
> >
> > <build>
> > <plugins>
> > <plugin>
> > <artifactId>maven-compiler-plugin</artifactId>
> > <configuration>
> > <source>1.6</source>
> > <target>1.6</target>
> > </configuration>
> > </plugin>
> > <plugin>
> > <artifactId>maven-surefire-plugin</artifactId>
> > <version>2.2</version>
> > <configuration>
> > <suiteXmlFiles>
> > <suiteXmlFile>
> > src/test/resources/testng.xml
> > </suiteXmlFile>
> > </suiteXmlFiles>
> > <forkMode>pertest</forkMode>
> > <childDelegation>false</childDelegation>
> > </configuration>
> > </plugin>
> > </plugins>
> > </build>
> >
> > Do I need the maven-ejb plugin? I'd appreciate any pointers.
> >
> > Thanks
> > -sud
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/JBoss-Embedded-Container-%2B-Maven-%2B-howto--tf4255161s177.html#a12115874
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>