Introduction

Automatic tests are the significant part of development process. Below is the instruction of how to run Openmeetings JUnit tests.

Details

  1. running tests using command line:
    • all tests:
      ant test
    • subset of tests by mask:
      ant -Dtestcases=TestError* test
  2. running tests from Eclipse IDE:
    • ant -Ddb=<your_DB> prepare-eclipse
    • Start Eclipse
    • Load workspace with Openmeetings project (or refresh existing project)
    • Select "Debug Configurations..."

  • Create New Junit configuration, give it a name and select test class

  • Select Arguments tab
  • Add the following code to the VM section
    -javaagent:${workspace_loc:Openmeetings}/build/lib/om/openjpa-bundle-2.2.2.jar -Dom.home=${workspace_loc:Openmeetings}/openmeetings-web/src/main/webapp/ -Dbackups.dir=${workspace_loc:Openmeetings}/build/lib/junit/backups
  • To avoid temporary files being created in OM root, modify "Working Directory" as follows
    ${workspace_loc:Openmeetings}/build/junit

  • Select Debug
  • Note: You need a file called "persistence.xml" in src/META-INF if you run the JUnit test from inside Eclipse. Normally "ant prepare-eclipse" should do that for you.