public class PaxExam
extends org.junit.runner.Runner
implements org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable
@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.
| Modifier and Type | Method and Description |
|---|---|
void |
filter(org.junit.runner.manipulation.Filter filter) |
org.junit.runner.Description |
getDescription() |
void |
run(org.junit.runner.notification.RunNotifier notifier) |
void |
sort(org.junit.runner.manipulation.Sorter sorter) |
public PaxExam(Class<?> klass) throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationErrorpublic org.junit.runner.Description getDescription()
getDescription in interface org.junit.runner.DescribablegetDescription in class org.junit.runner.Runnerpublic void run(org.junit.runner.notification.RunNotifier notifier)
run in class org.junit.runner.Runnerpublic void filter(org.junit.runner.manipulation.Filter filter)
throws org.junit.runner.manipulation.NoTestsRemainException
filter in interface org.junit.runner.manipulation.Filterableorg.junit.runner.manipulation.NoTestsRemainExceptionpublic void sort(org.junit.runner.manipulation.Sorter sorter)
sort in interface org.junit.runner.manipulation.SortableCopyright © 2006–2014 OPS4J - Open Participation Software for Java. All rights reserved.