Guest User

Untitled

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