@ContextConfiguration(classes=CitrusSpringConfig.class) public abstract class AbstractTestNGCitrusTest extends org.springframework.test.context.testng.AbstractTestNGSpringContextTests
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractTestNGCitrusTest.FakeExecutionCallBack
Class faking test execution as callback.
|
Modifier and Type | Field and Description |
---|---|
protected Citrus |
citrus
Citrus instance
|
protected org.slf4j.Logger |
log
Logger
|
Constructor and Description |
---|
AbstractTestNGCitrusTest() |
Modifier and Type | Method and Description |
---|---|
void |
afterSuite(org.testng.ITestContext testContext)
Runs tasks after test suite.
|
void |
beforeSuite(org.testng.ITestContext testContext)
Runs tasks before test suite.
|
protected TestLoader |
createTestLoader(String testName,
String packageName)
Creates new test loader which has TestNG test annotations set for test execution.
|
protected void |
executeTest()
Executes the test case.
|
protected String[] |
getParameterNames(Method method)
Read parameter names form method annotation.
|
protected TestCase |
getTestCase()
Constructs the test case to execute.
|
protected void |
injectTestParameters(Method method,
TestCase testCase,
Object[] parameterValues)
Methods adds optional TestNG parameters as variables to the test case.
|
protected TestContext |
prepareTestContext(TestContext testContext)
Prepares the test context.
|
protected Object |
resolveAnnotatedResource(org.testng.ITestResult testResult,
Class<?> parameterType,
TestContext context)
Resolves value for annotated method parameter.
|
protected Object[] |
resolveParameter(org.testng.ITestResult testResult,
Method method,
TestCase testCase,
TestContext context,
int invocationCount)
Resolves method arguments supporting TestNG data provider parameters as well as
CitrusResource annotated methods. |
void |
run(org.testng.IHookCallBack callBack,
org.testng.ITestResult testResult) |
protected void |
run(org.testng.ITestResult testResult,
Method method,
TestLoader testLoader,
int invocationCount)
Run method prepares and executes test case.
|
protected final org.slf4j.Logger log
protected Citrus citrus
public void run(org.testng.IHookCallBack callBack, org.testng.ITestResult testResult)
run
in interface org.testng.IHookable
run
in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
protected void run(org.testng.ITestResult testResult, Method method, TestLoader testLoader, int invocationCount)
testResult
- method
- testLoader
- invocationCount
- protected Object[] resolveParameter(org.testng.ITestResult testResult, Method method, TestCase testCase, TestContext context, int invocationCount)
CitrusResource
annotated methods.testResult
- method
- testCase
- context
- invocationCount
- protected Object resolveAnnotatedResource(org.testng.ITestResult testResult, Class<?> parameterType, TestContext context)
testResult
- parameterType
- public void beforeSuite(org.testng.ITestContext testContext) throws Exception
testContext
- the test context.Exception
- on error.public void afterSuite(org.testng.ITestContext testContext)
testContext
- the test context.protected void executeTest()
protected TestContext prepareTestContext(TestContext testContext)
testContext
- the test context.protected TestLoader createTestLoader(String testName, String packageName)
testName
- packageName
- protected TestCase getTestCase()
protected void injectTestParameters(Method method, TestCase testCase, Object[] parameterValues)
method
- the method currently executedtestCase
- the constructed Citrus test.Copyright © 2008–2017 ConSol Software GmbH. All rights reserved.