public class

PaxExam

extends Runner
implements Filterable Sortable
java.lang.Object
   ↳ org.junit.runner.Runner
     ↳ org.ops4j.pax.exam.junit.PaxExam
Known Direct Subclasses

Class Overview

Default JUnit runner for Pax Exam. To use this runner, annotate your test class with @RunWith(PaxExam.class).

The optional class-level annotation @ExamReactorStrategy defines the restart behaviour of the test reactor which defaults to PerMethod in OSGi mode and to PerSuite otherwise.

The test class may contain one or more methods annotated by @Configuration, returning a list of options for configuring the test container.

If there is more than one configuration method, each test method is run for each configuration.

The JUnit annotations @Rule, @Before, @After work as expected, the corresponding actions are executed within the Pax Exam test container.

The JUnit annotations @BeforeClass, @AfterClass are of limited use only: The corresponding actions will be executed in the driver, but not in the Pax Exam test container.)

The javax.inject.Inject annotation can be used on fields to inject dependencies into the test class. In Java EE and CDI modes, injection is performed by the CDI bean manager. In web mode, injection is performed by CDI or by Spring, depending on the configured injector.

In OSGi mode, Pax Exam injects OSGi services, obtained from the service registry with the default Pax Exam system timeout. The optional @Filter annotation can be used on an injection point to define an LDAP filter or to customize the timeout.

For parameterized tests, use PaxExamParameterized instead of this runner.

Summary

Public Constructors
PaxExam(Class<?> klass)
Public Methods
void filter(Filter filter)
Description getDescription()
void run(RunNotifier notifier)
void sort(Sorter sorter)
[Expand]
Inherited Methods
From class org.junit.runner.Runner
From class java.lang.Object
From interface org.junit.runner.Describable
From interface org.junit.runner.manipulation.Filterable
From interface org.junit.runner.manipulation.Sortable

Public Constructors

public PaxExam (Class<?> klass)

Throws
InitializationError

Public Methods

public void filter (Filter filter)

Throws
NoTestsRemainException

public Description getDescription ()

public void run (RunNotifier notifier)

public void sort (Sorter sorter)