Skip to content

Instantly share code, notes, and snippets.

@brmeyer
Forked from stliu/gist:3451036
Created August 24, 2012 14:12
Show Gist options
  • Save brmeyer/3451049 to your computer and use it in GitHub Desktop.
Save brmeyer/3451049 to your computer and use it in GitHub Desktop.
build EAP4
Hibernate Core
ant -lib lib clean jar junitreport -Dhibernate.test.validatefailureexpected=true
JPA-API
ant clean jar javadoc
ANNOTATIONS
ant clean jar junit junitreport -Dhibernate-core.home=../core -Dhibernate-core.jar=../core/build/hibernate3.jar
Entity Manager
when I build entitymanager, all the unit tests failed with the error below“Testsuite: org.hibernate.ejb.test.association.AssociationTestTests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
Testcase: null took 0 secCaused an ERRORForked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.”
and before unit test runs, there is a log message“ [junit] WARNING: multiple versions of ant detected in path for junit[junit] jar:file:/usr/local/bin/ant-1.7.1/lib/ant.jar!/org/apache/tools/ant/Project.class[junit] and jar:file:/home/stliu/eap4/core/lib/ant-1.6.5.jar!/org/apache/tools/ant/Project.class ”
so I removed all the ant-*.jar in core/lib, then all tests success.
But there is another error when junitinstrument target runs. Because of the completest target's task javac's destdir attribute's value is “${classes.dir}”, so when the unit tests class were compiled, they will be output to build/classes directory, but the task in the target instrument of common/common-build.xml will try to get the unit tests classes in the ${testclasses.dir}, so the target of instrument failed, due to it can't found directory of entitymanager/build/testclasses/....
so I add below to build.xml to override the same target<target name="instrument" depends="compiletest"description="Instrument the persistent classes"><instrument verbose="true"><fileset dir="${classes.dir}/org/hibernate"><include name="**/*.class"/><exclude name="**/*Test$*.class"/><exclude name="**/*Test.class"/><exclude name="**/*Tests.class"/></fileset></instrument></target>
ant clean jar javadoc junit junitinstrument junitreport -Dhibernate-core.home=../core -Dhibernate-core.jar=../core/build/hibernate3.jar -Ddisable.ivy=true -Dcommon.dir=../common
Validator
ant clean jar javadoc junit junitinstrument junitreport -Dhibernate-core.home=../core -Dhibernate-core.jar=../core/build/hibernate3.jar -Ddisable.ivy=true -Dcommon.dir=../common
Search
the other components are built using “ant clean jar javadoc junit junitinstrument junitreport -Dhibernate-core.home=../core -Dhibernate-core.jar=../core/build/hibernate3.jar -Ddisable.ivy=true”
sometimes you will need to run unit test with difference databases, so you'll need to create a JBQA issue to request access to the supported databases in the QA lab.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment