Class SlingAnnotationsTestRunner

java.lang.Object
org.junit.runner.Runner
org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
org.junit.runners.BlockJUnit4ClassRunner
org.apache.sling.junit.annotations.SlingAnnotationsTestRunner
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Orderable, org.junit.runner.manipulation.Sortable

public class SlingAnnotationsTestRunner extends org.junit.runners.BlockJUnit4ClassRunner
TestRunner which uses a TestObjectProcessor to handle annotations in test classes. A test that has RunWith=SlingAnnotationsTestRunner can use @TestReference, for example, to access OSGi services. FYI - {#link TeleporterRule} is another way of executing server-side tests, including OSGi service injection.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Object
     
    void
    run(org.junit.runner.notification.RunNotifier notifier)
     

    Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner

    collectInitializationErrors, computeTestMethods, createTest, describeChild, getChildren, getTestRules, isIgnored, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout

    Methods inherited from class org.junit.runners.ParentRunner

    childrenInvoker, classBlock, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, order, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolation

    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 Details

    • SlingAnnotationsTestRunner

      public SlingAnnotationsTestRunner(Class<?> clazz) throws org.junit.runners.model.InitializationError
      Throws:
      org.junit.runners.model.InitializationError
  • Method Details

    • createTest

      protected Object createTest() throws Exception
      Overrides:
      createTest in class org.junit.runners.BlockJUnit4ClassRunner
      Throws:
      Exception
    • run

      public void run(org.junit.runner.notification.RunNotifier notifier)
      Overrides:
      run in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>