blob: 6c55079fe4a1745b240027d7ba92d8e458037619 [file] [log] [blame]
<?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 xmlns="http://maven.apache.org/XDOC/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>JUnit Testing</title>
<author email="dev@openmeetings.apache.org">Apache 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:
<source>mvn test</source>
</li>
<li>subset of tests by mask:
<source>mvn test -Dtest=TestUserService</source>
</li>
</ul>
</li>
<li>running tests from Eclipse IDE: </li>
<li>
<ul>
<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
<source>-javaagent:/home/solomax/.m2/repository/org/apache/openjpa/openjpa/2.4.1/openjpa-2.4.1.jar -Dom.home=${workspace_loc:openmeetings-web}/src/main/webapp/ -Dbackups.dir=${workspace_loc:openmeetings-web}/target/test-data</source>
</li>
<li>To avoid temporary files being created in OM root, modify
"Working Directory" as follows
<source>${workspace_loc:openmeetings-web/target}</source>
</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>
</section>
</body>
</document>