Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Virgo/Test"

(Virgo Test Framework)
(DmKernelTestRunner)
Line 27: Line 27:
 
=== DmKernelTestRunner ===
 
=== DmKernelTestRunner ===
  
The dmKernelTestRunner, which should probably be renamed to VirgoKernelTestRunner, is for testing components that need a Virgo kernel environment complete with kernel and user regions. It is invoked via the JUnit @RunWith class annotation, for example:
+
The DmKernelTestRunner, which should probably be renamed to VirgoKernelTestRunner, is for testing components that need a Virgo kernel environment complete with kernel and user regions. It is invoked via the JUnit @RunWith class annotation, for example:
 
<pre>
 
<pre>
 
import org.junit.runner.RunWith;
 
import org.junit.runner.RunWith;
Line 35: Line 35:
 
public abstract class AbstractKernelIntegrationTest { ...
 
public abstract class AbstractKernelIntegrationTest { ...
 
</pre>
 
</pre>
 +
 +
The DmKernelTestRunner extends the function of the OsgiTestRunner to wait for the user region to start.
  
 
== Annotations ==
 
== Annotations ==

Revision as of 07:12, 21 June 2010



Virgo tests are implemented using JUnit and EasyMock. In addition, integration tests which require an OSGi environment use the Virgo test framework.

Virgo Test Framework

The Virgo Test Framework is maintained in its own git repository.

Test Runners

The test framework supports two test runners.

OsgiTestRunner

The OsgiTestRunner is for testing components that need a simple OSGi environment. It is invoked via the JUnit @RunWith class annotation, for example:

import org.junit.runner.RunWith;
import org.eclipse.virgo.test.framework.OsgiTestRunner;

@RunWith(OsgiTestRunner.class)
public class EventLogIntegrationTests { ...

OsgiTestRunner launches Equinox, installs the project containing the testcase class as a bundle, starts the bundle, and then runs the testcase class from inside the bundle using a standard JUnit runner.

DmKernelTestRunner

The DmKernelTestRunner, which should probably be renamed to VirgoKernelTestRunner, is for testing components that need a Virgo kernel environment complete with kernel and user regions. It is invoked via the JUnit @RunWith class annotation, for example:

import org.junit.runner.RunWith;
import org.eclipse.virgo.test.framework.dmkernel.DmKernelTestRunner;
 
@RunWith(DmKernelTestRunner.class)
public abstract class AbstractKernelIntegrationTest { ...

The DmKernelTestRunner extends the function of the OsgiTestRunner to wait for the user region to start.

Annotations

Back to the top