<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and | |
limitations under the License. | |
--> | |
<document> | |
<properties> | |
<title>JUnit Testing</title> | |
<author email="sebawagner@apache.org"> | |
OpenMeetings Team | |
</author> | |
</properties> | |
<body> | |
<section name="Introduction"> | |
<p> | |
Automatic tests are the significant part of development process. | |
Below is the instruction of how to run Openmeetings | |
<a href="http://junit.org" rel="nofollow">JUnit</a> | |
tests. | |
</p> | |
</section> | |
<section name="Details"> | |
<ol> | |
<li>running tests using command line: </li> | |
<li> | |
<ul> | |
<li>all tests: | |
<div class="xmlcode"> | |
ant test | |
</div> | |
</li> | |
<li>subset of tests by mask: | |
<div class="xmlcode"> | |
ant -Dtestcases=TestError* test | |
</div> | |
</li> | |
</ul> | |
</li> | |
<li>running tests from Eclipse IDE: </li> | |
<li> | |
<ul> | |
<li> | |
<div class="xmlcode"> | |
ant -Ddb=<your_DB> prepare-eclipse | |
</div> | |
</li> | |
<li>Start Eclipse </li> | |
<li>Load workspace with Openmeetings project (or refresh existing | |
project) | |
</li> | |
<li>Select "Debug Configurations..." </li> | |
</ul> | |
</li> | |
</ol> | |
<p> | |
<a class="fancybox-buttons" href="images/DebugConfigurations.png"> | |
<img src="images/DebugConfigurations.png" alt="" width="367" | |
height="262" /> | |
</a> | |
</p> | |
<ul> | |
<li>Create New Junit configuration, give it a name and select test | |
class | |
</li> | |
</ul> | |
<p> | |
<a class="fancybox-buttons" href="images/NewConfiguration.png"> | |
<img src="images/NewConfiguration.png" alt="" width="420" | |
height="206" /> | |
</a> | |
</p> | |
<ul> | |
<li>Select Arguments tab </li> | |
<li>Add the following code to the VM section | |
<div class="xmlcode"> | |
-javaagent:${workspace_loc:Openmeetings}/build/lib/om/openjpa-bundle-2.2.1.jar | |
-Dwebapps.root=${workspace_loc:Openmeetings}/dist/red5/webapps/openmeetings | |
</div> | |
</li> | |
<li>To avoid temporary files being created in OM root, modify | |
"Working Directory" as follows | |
<div class="xmlcode">${workspace_loc:Openmeetings}/build/junit</div> | |
</li> | |
</ul> | |
<p> | |
<a class="fancybox-buttons" href="images/Arguments.png"> | |
<img src="images/Arguments.png" alt="" width="435" height="410" /> | |
</a> | |
</p> | |
<ul> | |
<li>Select Debug </li> | |
</ul> | |
<ul> | |
<li>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. </li> | |
</ul> | |
</section> | |
</body> | |
</document> |