Class ExecutionPlanExpectationHelper
- java.lang.Object
-
- de.bmiag.tapir.executiontest.expectation.plan.ExecutionPlanExpectationHelper
-
public class ExecutionPlanExpectationHelper extends java.lang.Object
Provides some convenience methods in order to build readable execution plan expectations.- Since:
- 2.0.0
- Author:
- Oliver Libutzki <[email protected]>
-
-
Constructor Summary
Constructors Constructor Description ExecutionPlanExpectationHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutionPlanExpectation
executionPlan()
Constructs an execution plan expectation without any child expectations.ExecutionPlanExpectation
executionPlan(java.util.List<StructuralElementExpectation> children)
Constructs an execution plan expectation with the given child expectations.void
runTest(java.lang.Class<?> testClass, ExecutionPlanExpectation executionPlanExpectation)
Obtains the execution plan for given testClass and asserts it against theExecutionPlanExpectation
.void
runTest(java.lang.Class<?> testClass, java.util.Map<java.lang.String,java.lang.String> properties, ExecutionPlanExpectation executionPlanExpectation)
After setting the given properties as JVM System properties the execution plan for given testClass is obtained and asserted against theExecutionPlanExpectation
.TestClassExpectation
testClass(java.lang.Class<?> javaClass, TestParameterExpectation testParameter, java.util.List<TestStepExpectation> steps)
Constructs a parameterized (single parameter) test class expectation for the given parameters.TestClassExpectation
testClass(java.lang.Class<?> javaClass, java.util.List<TestParameterExpectation> testParameters, java.lang.Iterable<TestStepExpectation> steps)
Constructs a parameterized (multiple parameters) test class expectation for the given parameters.TestClassExpectation
testClass(java.lang.Class<?> javaClass, java.util.List<TestStepExpectation> steps)
Constructs a test class expectation for the given parameters.TestParameterExpectation
testParameter(java.lang.String name, java.lang.Object value)
Constructs a test parameter expectation for the given parameters.TestStepExpectation
testStep(java.lang.String name)
Constructs a test step expectation for the given name.TestStepExpectation
testStep(java.lang.String name, TestParameterExpectation testParameter)
Constructs a parameterized (single parameter) test step expectation for the given name.TestStepExpectation
testStep(java.lang.String name, java.util.List<TestParameterExpectation> testParameters)
Constructs a parameterized (multiple parameters) test step expectation for the given name.TestSuiteExpectation
testSuite(java.lang.Class<?> javaClass, java.util.List<StructuralElementExpectation> children)
Constructs a test suite expectation for the given parameters.
-
-
-
Method Detail
-
executionPlan
public ExecutionPlanExpectation executionPlan()
Constructs an execution plan expectation without any child expectations.- Returns:
- the execution plan expectation
-
executionPlan
public ExecutionPlanExpectation executionPlan(java.util.List<StructuralElementExpectation> children)
Constructs an execution plan expectation with the given child expectations.- Parameters:
children
- child expectations- Returns:
- the execution plan expectation
-
testSuite
public TestSuiteExpectation testSuite(java.lang.Class<?> javaClass, java.util.List<StructuralElementExpectation> children)
Constructs a test suite expectation for the given parameters.- Parameters:
javaClass
- the java class which the test suite should base onchildren
- the child expectations- Returns:
- the test suite expectation
-
testClass
public TestClassExpectation testClass(java.lang.Class<?> javaClass, java.util.List<TestStepExpectation> steps)
Constructs a test class expectation for the given parameters.- Parameters:
javaClass
- the java class which the test suite should base onsteps
- the step expectations- Returns:
- the test class expectation
-
testClass
public TestClassExpectation testClass(java.lang.Class<?> javaClass, TestParameterExpectation testParameter, java.util.List<TestStepExpectation> steps)
Constructs a parameterized (single parameter) test class expectation for the given parameters.- Parameters:
javaClass
- the java class which the test suite should base ontestParameter
- the expected parametersteps
- the step expectations- Returns:
- the test class expectation
-
testClass
public TestClassExpectation testClass(java.lang.Class<?> javaClass, java.util.List<TestParameterExpectation> testParameters, java.lang.Iterable<TestStepExpectation> steps)
Constructs a parameterized (multiple parameters) test class expectation for the given parameters.- Parameters:
javaClass
- the java class which the test suite should base ontestParameters
- the expected parameterssteps
- the step expectations- Returns:
- the test class expectation
-
testStep
public TestStepExpectation testStep(java.lang.String name)
Constructs a test step expectation for the given name.- Parameters:
name
- Name of the test step- Returns:
- the test step expectation
-
testStep
public TestStepExpectation testStep(java.lang.String name, TestParameterExpectation testParameter)
Constructs a parameterized (single parameter) test step expectation for the given name.- Parameters:
name
- Name of the test steptestParameter
- the expected parameter- Returns:
- the test step expectation
-
testStep
public TestStepExpectation testStep(java.lang.String name, java.util.List<TestParameterExpectation> testParameters)
Constructs a parameterized (multiple parameters) test step expectation for the given name.- Parameters:
name
- Name of the test steptestParameters
- the expected parameters- Returns:
- the test step expectation
-
testParameter
public TestParameterExpectation testParameter(java.lang.String name, java.lang.Object value)
Constructs a test parameter expectation for the given parameters.- Parameters:
name
- expected name of the parametervalue
- expected value of the parameter- Returns:
- the test parameter expectation
-
runTest
public void runTest(java.lang.Class<?> testClass, java.util.Map<java.lang.String,java.lang.String> properties, ExecutionPlanExpectation executionPlanExpectation)
After setting the given properties as JVM System properties the execution plan for given testClass is obtained and asserted against theExecutionPlanExpectation
.- Parameters:
testClass
- the test class to be executedproperties
- the properties to setexecutionPlanExpectation
- the expected execution plan
-
runTest
public void runTest(java.lang.Class<?> testClass, ExecutionPlanExpectation executionPlanExpectation)
Obtains the execution plan for given testClass and asserts it against theExecutionPlanExpectation
.- Parameters:
testClass
- the test class to be executedexecutionPlanExpectation
- the expected execution plan
-
-