com.atlassian.webdriver.testing.runner
Class AbstractProductContextRunner

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 com.atlassian.webdriver.testing.runner.AbstractInjectingRunner
                  extended by com.atlassian.webdriver.testing.runner.AbstractProductContextRunner
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable
Direct Known Subclasses:
ProductContextRunner

public abstract class AbstractProductContextRunner
extends AbstractInjectingRunner

Given a tested product supporting injection, injects framework members into the test class and object before running the test.

The underlying product, or its binder, MUST implement the InjectionContext for this to work.

Since:
2.1

Constructor Summary
AbstractProductContextRunner(Class<?> klass)
          Constructor compatible with the underlying default JUnit4 runner.
 
Method Summary
protected  InjectionContext getInjectionContext()
           
protected abstract  TestedProduct<?> getProduct()
          The product must support injection, such that InjectingTestedProducts.supportsInjection(com.atlassian.pageobjects.TestedProduct) returns true.
 
Methods inherited from class com.atlassian.webdriver.testing.runner.AbstractInjectingRunner
classBlock, methodInvoker
 
Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, computeTestMethods, createTest, describeChild, getChildren, getTestRules, methodBlock, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classRules, filter, getDescription, getName, getRunnerAnnotations, getTestClass, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, 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

AbstractProductContextRunner

public AbstractProductContextRunner(Class<?> klass)
                             throws org.junit.runners.model.InitializationError
Constructor compatible with the underlying default JUnit4 runner.

Throws:
org.junit.runners.model.InitializationError - if the test class is malformed.
Method Detail

getInjectionContext

protected final InjectionContext getInjectionContext()
Specified by:
getInjectionContext in class AbstractInjectingRunner

getProduct

protected abstract TestedProduct<?> getProduct()
The product must support injection, such that InjectingTestedProducts.supportsInjection(com.atlassian.pageobjects.TestedProduct) returns true. Otherwise this runner will fail at runtime when trying to perform injection.

Returns:
product instance


Copyright © 2014 Atlassian. All rights reserved.