Rio Project 4.2 API Documentation



org.rioproject.test
Class RioTestRunner

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
          extended by org.junit.runners.BlockJUnit4ClassRunner
              extended by org.rioproject.test.RioTestRunner
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

public class RioTestRunner
extends org.junit.runners.BlockJUnit4ClassRunner

RioTestRunner is a custom extension of BlockJUnit4ClassRunner

NOTE: RioTestRunner requires JUnit 4.5. or later


Constructor Summary
RioTestRunner(Class<?> clazz)
          Constructs a new RioTestRunner
 
Method Summary
protected  Object createTest()
          Delegates to BlockJUnit4ClassRunner.createTest() to create the test
protected  TestConfig createTestConfig(String testClassName)
          Creates A testConfig.
protected  TestManager getManager()
          Get the TestManager associated with this runner.
 void run(org.junit.runner.notification.RunNotifier notifier)
          Check whether the test is enabled in the first place.
protected  void runChild(org.junit.runners.model.FrameworkMethod method, org.junit.runner.notification.RunNotifier notifier)
           
protected  org.junit.runners.model.Statement withAfterClasses(org.junit.runners.model.Statement statement)
           
protected  org.junit.runners.model.Statement withPotentialTimeout(org.junit.runners.model.FrameworkMethod method, Object target, org.junit.runners.model.Statement next)
           
 
Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, computeTestMethods, describeChild, getChildren, methodBlock, methodInvoker, possiblyExpectingExceptions, testName, validateConstructor, validateInstanceMethods, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, filter, getDescription, getName, getTestClass, setScheduler, sort, validatePublicVoidNoArgMethods, withBeforeClasses
 
Methods inherited from class org.junit.runner.Runner
testCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RioTestRunner

public RioTestRunner(Class<?> clazz)
              throws org.junit.runners.model.InitializationError
Constructs a new RioTestRunner

Parameters:
clazz - the Class object corresponding to the test class to be run
Throws:
org.junit.runners.model.InitializationError - If the class cannot be created
Method Detail

withAfterClasses

protected org.junit.runners.model.Statement withAfterClasses(org.junit.runners.model.Statement statement)
Overrides:
withAfterClasses in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>

run

public void run(org.junit.runner.notification.RunNotifier notifier)
Check whether the test is enabled in the first place. This prevents classes with a non-matching @IfPropertySet annotation from running altogether, even skipping the execution of prepareTestInstance listener methods. This method also creates and initializes a TestManager providing Rio testing functionality to standard JUnit tests.

Overrides:
run in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
See Also:
createTestConfig(String)

createTest

protected Object createTest()
                     throws Exception
Delegates to BlockJUnit4ClassRunner.createTest() to create the test

Overrides:
createTest in class org.junit.runners.BlockJUnit4ClassRunner
Throws:
Exception
See Also:
BlockJUnit4ClassRunner#createTest(), first checks for TestManager injection

withPotentialTimeout

protected org.junit.runners.model.Statement withPotentialTimeout(org.junit.runners.model.FrameworkMethod method,
                                                                 Object target,
                                                                 org.junit.runners.model.Statement next)
Overrides:
withPotentialTimeout in class org.junit.runners.BlockJUnit4ClassRunner

createTestConfig

protected TestConfig createTestConfig(String testClassName)
Creates A testConfig. Can be overridden by subclasses.

Parameters:
testClassName - The name of the test class to be run
Returns:
A TestConfig

getManager

protected final TestManager getManager()
Get the TestManager associated with this runner.

Returns:
The created Manager

runChild

protected void runChild(org.junit.runners.model.FrameworkMethod method,
                        org.junit.runner.notification.RunNotifier notifier)
Overrides:
runChild in class org.junit.runners.BlockJUnit4ClassRunner

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.