public class PaxExamServer
extends org.junit.rules.ExternalResource
Example
public class MyTest {
@Rule
public PaxExamServer exam = new PaxExamServer();
}
This rule starts a Pax Exam container before each test and stops it after the test. The
configuration options for the exam container are taken from a method in the test class annotated
with Configuration. The test class must contain a unique no-args method with this
annotation and with return type Option[].
Alternatively, you can pass a class literal to the PaxExamServer constructor. In this
case, the @Configuration method will be taken from the class argument.
This test rule can be used with any plain old unit test or in combination with other JUnit
runners. Do not use this rule in combination with the PaxExam runner.
PaxExamServer can also be used as a class rule. In this case, test container is started
once before running all tests of the class and is stopped when all tests have run.
| Constructor and Description |
|---|
PaxExamServer() |
PaxExamServer(Class<?> configClass) |
public PaxExamServer()
public PaxExamServer(Class<?> configClass)
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
apply in interface org.junit.rules.TestRuleapply in class org.junit.rules.ExternalResourceprotected void before()
throws Exception
before in class org.junit.rules.ExternalResourceExceptionprotected void after()
after in class org.junit.rules.ExternalResourceCopyright © 2006–2014 OPS4J - Open Participation Software for Java. All rights reserved.