TestNG Configuration for database
fenixx Mar 24, 2009 8:22 AMHi all,
I want to test my application with the Eclipse TestNG Plugin in my EJB-Project. Therefore I created two persistence.xml: One for the EJBs and a seperated for my tests
The structure of the project:
MyEJBProject
-src
-----main
---------resources
--------->META-INF
--------->persistence.xml (for the normal EJBs)
-----test
--------->java/mypackage
------------------------------>MyTest.java
-----resources
--------->META-INF
--------------------->persistence.xml (for the tests)
--------->myejbproject-ds.xml
-bootstrap
-testng.xml
A simple test(without database access) works fine. But with a database access, I get the following exception, although I don't use any EJBs in my test:
FAILED CONFIGURATION: @BeforeSuite startSeam
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
*** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
jboss.j2ee:jar=classes,name=AServiceBean,service=EJB3
-> <UNKNOWN>{Described:** UNRESOLVED Demands 'persistence.units:jar=classes.jar,unitName=MYAPP **}
jboss.j2ee:jar=classes,name=BServiceBean,service=EJB3
-> <UNKNOWN>{Described:** UNRESOLVED Demands 'persistence.units:jar=classes.jar,unitName=MYAPP **}
persistence.units:jar=classes.jar,unitName=MYAPP
-> <UNKNOWN>{Described:** UNRESOLVED Demands 'jboss.jca:name=jdbc/myapp,service=DataSourceBinding **}
*** CONTEXTS IN ERROR: Name -> Error
<UNKNOWN> -> ** UNRESOLVED Demands 'jboss.jca:name=jdbc/myapp,service=DataSourceBinding **
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559)
at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:128)
at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289)
at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15)
at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1024)
at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915)
at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)Is there any extra configuration needed, if you have 2 persistence.xmls?