-
15. Re: trouble running testng
matt.nirgue Dec 17, 2008 10:10 AM (in response to ajanz)Mine is a
little
shorter since I use Maven but here's what I think you should have in your classpath to make it work...<classpathentry kind="src" output="target/classes" path="src/main/java"/> <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/> <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/bootstrap"/> <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/> <classpathentry kind="output" path="target/classes"/>
-
16. Re: trouble running testng
ajanz Dec 17, 2008 4:19 PM (in response to ajanz)so i have to edit the file directly? it doesn't appear in project explorer.
but i don't see which of your entries should be responsible to get it work.
i will do a test and give response
-
17. Re: trouble running testng
ajanz Dec 17, 2008 4:59 PM (in response to ajanz)ah ok i tried to run the ant task testng. so then the correct environment is used.
but now i got following error
test:
[testng] [Parser] Running:
[testng] D:\Projekte\JBossSeam\workspace\myproject\test-build\ManagerTest.xml
[testng] ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Real: name=vfsfile:/D:/Projekte/JBossSeam/workspace/myproject/bootstrap/deploy/jbpm-enterprise.ear state=PostClassLoader mode=Manual requiredState=Real
[testng] org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/D:/Projekte/JBossSeam/workspace/myproject/bootstrap/deploy/jbpm-enterprise.ear/jbpm-enterprise.jar
[testng] at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
[testng] at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:175)
[testng] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
[testng] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:906)
[testng] at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
[testng] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
[testng] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
[testng] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
[testng] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
[testng] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
[testng] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
[testng] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
[testng] at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
[testng] at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
[testng] at org.jboss.embedded.DeploymentScanner.start(DeploymentScanner.java:105)
[testng] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[testng] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng] at java.lang.reflect.Method.invoke(Method.java:585)
[testng] at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
[testng] at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
[testng] at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
[testng] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
[testng] at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
[testng] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
[testng] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
[testng] at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
[testng] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
[testng] at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
[testng] at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
[testng] at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
[testng] at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
[testng] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
[testng] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
[testng] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
[testng] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
[testng] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
[testng] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
[testng] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
[testng] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:309)
[testng] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:279)
[testng] at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
[testng] at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96)
[testng] at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130)
[testng] at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142)
[testng] at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
[testng] at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
[testng] at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
[testng] at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1041)
[testng] at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
[testng] at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
[testng] at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
[testng] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[testng] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng] at java.lang.reflect.Method.invoke(Method.java:585)
[testng] at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
[testng] at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:394)
[testng] at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
[testng] at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:79)
[testng] at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:165)
[testng] at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
[testng] at org.testng.TestRunner.runWorkers(TestRunner.java:678)
[testng] at org.testng.TestRunner.privateRun(TestRunner.java:624)
[testng] at org.testng.TestRunner.run(TestRunner.java:495)
[testng] at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
[testng] at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
[testng] at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
[testng] at org.testng.SuiteRunner.run(SuiteRunner.java:190)
[testng] at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
[testng] at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
[testng] at org.testng.TestNG.run(TestNG.java:699)
[testng] at org.testng.TestNG.privateMain(TestNG.java:824)
[testng] at org.testng.TestNG.main(TestNG.java:802)
[testng] Caused by: java.lang.IllegalStateException: Container configuration not found: Standard Stateless SessionBean available: []
[testng] at org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.determineContainerConfiguration(JBossEnterpriseBeanMetaData.java:648)
[testng] at org.jboss.ejb.deployers.EjbDeployer.deploy(EjbDeployer.java:261)
[testng] at org.jboss.ejb.deployers.EjbDeployer.deploy(EjbDeployer.java:60)
[testng] at org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer.deploy(AbstractSimpleVFSRealDeployer.java:56)
[testng] at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65)
[testng] at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
[testng] at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
[testng] ... 72 more
[testng] FAILED CONFIGURATION: @BeforeClass init
[testng] org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
[testng] *** CONTEXTS IN ERROR: Name -> Error
[testng] vfsfile:/D:/Projekte/JBossSeam/workspace/myproject/bootstrap/deploy/jbpm-enterprise.ear -> java.lang.IllegalStateException: Container configuration not found: Standard Stateless SessionBean available: []
[testng] at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576)
[testng] at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559)
[testng] at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:149)
[testng] at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
[testng] at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
[testng] at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
[testng] at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1041)
[testng] at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
[testng] at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
[testng] at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
[testng] ... Removed 22 stack frames
[testng] SKIPPED CONFIGURATION: @BeforeMethod begin
[testng] SKIPPED CONFIGURATION: @AfterMethod end
[testng] SKIPPED CONFIGURATION: @BeforeMethod begin
[testng] SKIPPED CONFIGURATION: @AfterMethod end
[testng] SKIPPED CONFIGURATION: @BeforeMethod begin
[testng] SKIPPED CONFIGURATION: @AfterMethod end
[testng] SKIPPED CONFIGURATION: @AfterClass cleanup
[testng] SKIPPED: getworkflowtypes
[testng] SKIPPED: testMyWorkflows
[testng] SKIPPED: testCreateTasks
[testng] ===============================================
[testng] ManagerTest
[testng] Tests run: 3, Failures: 0, Skips: 3
[testng] Configuration Failures: 1, Skips: 7
[testng] ===============================================
[testng] ===============================================
[testng] ManagerTest
[testng] Total tests run: 3, Failures: 0, Skips: 3
[testng] Configuration Failures: 1, Skips: 7
[testng] =============================================== -
18. Re: trouble running testng
matt.nirgue Dec 17, 2008 7:33 PM (in response to ajanz)I had an error quite similar to this one... and it was classpath issue if I remember correctly :/
Have you tried to look into the examples Seam provides? Maybe you've missed something in your Ant file...
I'm sorry I can't help you much more since I don't use Ant but Maven to build my project, launch my tests...
Post your Ant file here... I'll try to take a look at it tomorrow but I'm not promising you anything... it's been a while since I used Ant! :/
-
19. Re: trouble running testng
ajanz Dec 18, 2008 12:16 PM (in response to ajanz)ok...here it is...
<target name="buildtest" depends="compiletest,copytestclasses" description="Build the tests">
<copy todir="${test.dir}">
<fileset dir="${basedir}/resources">
<exclude name="META-INF/persistence*.xml"/>
<exclude name="import*.sql"/>
<exclude name="${project.name}-*-ds.xml"/>
</fileset>
</copy>
<copy tofile="${test.dir}/META-INF/persistence.xml"
file="${basedir}/resources/META-INF/persistence-test.xml"
overwrite="true"/>
<copy tofile="${test.dir}/import.sql"
file="${basedir}/resources/import-test.sql"
overwrite="true"/>
<copy todir="${test.dir}" flatten="true">
<fileset dir="${src.test.dir}">
<include name="**/*Test.xml" />
</fileset>
</copy>
</target>
<target name="test" depends="buildtest" description="Run the tests">
<taskdef resource="testngtasks" classpath="${testng.jar}" />
<path id="test.path">
<path path="${test.dir}" />
<fileset dir="${lib.dir}/test">
<include name="*.jar"/>
</fileset>
<path path="${bootstrap.dir}" />
<path refid="build.classpath" />
</path>
<testng outputdir="${basedir}/test-report">
<classpath refid="test.path" />
<xmlfileset dir="${test.dir}" includes="*Test.xml" />
</testng>
</target> -
20. Re: trouble running testng
matt.nirgue Dec 19, 2008 11:34 AM (in response to ajanz)I don't get what's wrong with your configuration :/
your boostrap folder is in your classpath, as your resources... Did you get all the needed jars (jboss-embedded-all, jboss-embedded-api, thirdparty-all, etc.) and put them in your classpath ?
-
21. Re: trouble running testng
cretz Apr 20, 2009 8:52 PM (in response to ajanz)I too was experiencing this issue. I finally realized one of my dependencies has a jndi.properties in its classpath w/ "java.naming.provider.url=jnp://localhost:1099". Since Seam's examples tell you to put your test classes ahead of all other JAR's, it seems that the other JAR's jndi.properties is read instead.
So...make sure none of your JARs on your classpath have a jndi.properties in them that will override yours...or (untested) put your test project at the bottom (last) of the classpath w/ it's own jndi.properties w/out the jnp url.