Testing: Need help with PostgreSQL and Jboss embedded
idyoshin Feb 19, 2010 11:26 AMgood day community,
I've run into strange problem. I need to run tests on mine application with SEAM, I have a developer database on postgreSQL (actually our application is tight to postgreSQL).
but my application doesn't starts inside of the tests:
[testng] FAILED CONFIGURATION: @BeforeSuite startSeam [testng] org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS): [testng] [testng] *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State} [testng] [testng] jboss.jca:name=lexDatasource,service=DataSourceBinding [testng] -> jboss:service=invoker,type=jrmp{Create:** NOT FOUND **} [testng] -> jboss:service=invoker,type=jrmp{Start:** NOT FOUND **} [testng] [testng] [testng] *** CONTEXTS IN ERROR: Name -> Error [testng] [testng] jboss:service=invoker,type=jrmp -> ** NOT FOUND ** [testng] [testng] [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.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1024) [testng] at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915) [testng] at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58) [testng] ... Removed 15 stack frames [testng] SKIPPED CONFIGURATION: @BeforeClass setupClass [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
I've started with seam-gen and than modified the ant script (acording for tests) (actually it deploys the dev-ds.xml to the bootstrap/deploy and compiles everything with groovy 'cause I'm using it sometimes) :
<target name="copytestclasses" if="eclipse.running" description="Copy classes compiled by eclipse to the test dir"> <mkdir dir="${test.dir}"/> <copy todir="${test.dir}"> <fileset dir="classes/main"> <include name="**/*.class"/> </fileset> </copy> <copy todir="${test.dir}"> <fileset dir="classes/hot"> <include name="**/*.class"/> </fileset> </copy> <copy todir="${test.dir}"> <fileset dir="classes/test"> <include name="**/*.class"/> </fileset> </copy> </target> <target name="buildtest" depends="init,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"/> <exclude name="components-*.properties"/> </fileset> <fileset dir="${basedir}/view"/> </copy> <copy tofile="${test.dir}/META-INF/persistence.xml" file="${basedir}/resources/META-INF/persistence-test.xml"/> <copy tofile="${test.dir}/import.sql" file="${basedir}/resources/import-test.sql"/> <copy tofile="${test.dir}/components.properties" file="${basedir}/resources/components-test.properties"/> <copy tofile="${basedir}/bootstrap/deploy/lex-test-ds.xml" file="${basedir}/resources/lex-dev-ds.xml"/> <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"> <fail message="Cannot run tests because path to project contains spaces."> <condition> <contains string="${basedir}" substring=" "/> </condition> </fail> <condition property="incompatible.jdk" value="true"> <and> <equals arg1="${ant.java.version}" arg2="1.6"/> <not><available classname="javax.xml.bind.JAXB"/></not> </and> </condition> <fail if="incompatible.jdk">You are using an incompatible JDK 6. Please use Sun JDK 6 Update 4 (1.6.0_04) or newer or use Open JDK 6.</fail> <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"> <jvmarg line="-Dsun.lang.ClassLoader.allowArraySyntax=true"/> <classpath refid="test.path"/> <xmlfileset dir="${test.dir}" includes="*Test.xml"/> </testng> </target> <target name="javadoc" depends="compile"> <mkdir dir="${dist.dir}/apidoc"/> <javadoc classpathref="build.classpath" encoding="utf-8" destdir="${dist.dir}/apidoc" private="on" use="true" version="true" windowtitle="${project.name} API Documentation" doctitle="${project.name} API Documentation" link="http://java.sun.com/j2se/5.0/docs/api"> <packageset dir="${src.action.dir}" defaultexcludes="yes"> <include name="*/**"/> </packageset> <packageset dir="${src.model.dir}" defaultexcludes="yes"> <include name="*/**"/> </packageset> </javadoc> </target>
Any idea?