Guest User

Untitled

a guest
Dec 9th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. Hibernate Core
  2. ant -lib lib clean jar junitreport -Dhibernate.test.validatefailureexpected=true
  3. JPA-API
  4. ant clean jar javadoc
  5. ANNOTATIONS
  6. ant clean jar junit junitreport -Dhibernate-core.home=../core -Dhibernate-core.jar=../core/build/hibernate3.jar
  7.  
  8.  
  9. Entity Manager
  10. 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
  11. 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.”
  12. 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 ”
  13. so I removed all the ant-*.jar in core/lib, then all tests success.
  14. 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/....
  15. 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>
  16.  
  17.  
  18. ant clean jar javadoc junit junitinstrument junitreport -Dhibernate-core.home=../core -Dhibernate-core.jar=../core/build/hibernate3.jar -Ddisable.ivy=true -Dcommon.dir=../common
  19.  
  20.  
  21. Validator
  22. ant clean jar javadoc junit junitinstrument junitreport -Dhibernate-core.home=../core -Dhibernate-core.jar=../core/build/hibernate3.jar -Ddisable.ivy=true -Dcommon.dir=../common
  23.  
  24. Search
  25. 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”
  26. 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.
Add Comment
Please, Sign In to add comment