com.consol.citrus.testng
Class AbstractTestNGCitrusTest

java.lang.Object
  extended by org.springframework.test.context.testng.AbstractTestNGSpringContextTests
      extended by com.consol.citrus.testng.AbstractTestNGCitrusTest
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.testng.IHookable, org.testng.ITestNGListener
Direct Known Subclasses:
TestNGCitrusTestBuilder

@ContextConfiguration(locations={"classpath:com/consol/citrus/spring/root-application-ctx.xml","classpath:citrus-context.xml","classpath:com/consol/citrus/functions/citrus-function-ctx.xml","classpath:com/consol/citrus/validation/citrus-validationmatcher-ctx.xml"})
public abstract class AbstractTestNGCitrusTest
extends org.springframework.test.context.testng.AbstractTestNGSpringContextTests

Abstract base test implementation for testng test cases. Providing test listener support and loading basic application context files for Citrus.

Author:
Christoph Deppisch

Field Summary
protected  org.slf4j.Logger log
          Logger
 
Fields inherited from class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
applicationContext, logger
 
Constructor Summary
AbstractTestNGCitrusTest()
           
 
Method Summary
 void afterSuite(org.testng.ITestContext testContext)
          Runs tasks after test suite.
 void beforeSuite(org.testng.ITestContext testContext)
          Runs tasks before test suite.
 void beforeTest(org.testng.ITestContext testContext)
          Runs tasks before tests.
protected  org.springframework.context.support.ClassPathXmlApplicationContext createApplicationContext()
          Creates the Spring application context.
protected  TestContext createTestContext()
          Creates a new test context.
protected  void executeTest()
          Executes the test case.
protected  void executeTest(org.testng.ITestContext testContext)
          Executes the test case.
protected  Object[][] getParameterValues()
          Hook for subclasses to provide individual test parameters.
protected  TestCase getTestCase()
          Gets the test case from application context.
protected  TestContext prepareTestContext(TestContext testContext)
          Prepares the test context.
protected  Object[][] provideTestParameters()
          Default data provider automatically adding parameters as variables to test case.
 
Methods inherited from class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
run, setApplicationContext, springTestContextAfterTestClass, springTestContextAfterTestMethod, springTestContextBeforeTestClass, springTestContextBeforeTestMethod, springTestContextPrepareTestInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.slf4j.Logger log
Logger

Constructor Detail

AbstractTestNGCitrusTest

public AbstractTestNGCitrusTest()
Method Detail

beforeSuite

public void beforeSuite(org.testng.ITestContext testContext)
                 throws Exception
Runs tasks before test suite.

Parameters:
testContext - the test context.
Throws:
Exception - on error.

beforeTest

public void beforeTest(org.testng.ITestContext testContext)
Runs tasks before tests.

Parameters:
testContext - the test context.

executeTest

protected void executeTest()
Executes the test case.


executeTest

protected void executeTest(org.testng.ITestContext testContext)
Executes the test case.

Parameters:
testContext - the test context.

prepareTestContext

protected TestContext prepareTestContext(TestContext testContext)
Prepares the test context. Provides a hook for test context modifications before the test gets executed.

Parameters:
testContext - the test context.
Returns:
the (prepared) test context.

createTestContext

protected TestContext createTestContext()
                                 throws Exception
Creates a new test context.

Returns:
the new citrus test context.
Throws:
Exception - on error.

getTestCase

protected TestCase getTestCase()
Gets the test case from application context.

Returns:
the new test case.

createApplicationContext

protected org.springframework.context.support.ClassPathXmlApplicationContext createApplicationContext()
Creates the Spring application context.

Returns:

afterSuite

public void afterSuite(org.testng.ITestContext testContext)
Runs tasks after test suite.

Parameters:
testContext - the test context.

provideTestParameters

protected Object[][] provideTestParameters()
Default data provider automatically adding parameters as variables to test case.

Parameters:
testContext - the current TestNG test context.
Returns:

getParameterValues

protected Object[][] getParameterValues()
Hook for subclasses to provide individual test parameters.

Returns:


Copyright © 2008-2013 ConSol* Consulting&Solutions GmbH. All Rights Reserved.