org.xwiki.rendering.test.cts
Class CompatibilityTestSuite

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.junit.runners.ParentRunner<org.junit.runner.Runner>
          extended by org.junit.runners.Suite
              extended by org.xwiki.rendering.test.cts.CompatibilityTestSuite
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

public class CompatibilityTestSuite
extends org.junit.runners.Suite

Run all tests found in resources files located in the classpath, for a given Syntax. The algorithm is the following:

Usage Example


 @RunWith(CompatibilityTestSuite.class)
 @Syntax("xwiki/2.0")
 @Scope("simple")
 public class IntegrationTests
 {
 }
 

It's also possible to get access to the underlying Component Manager used, for example in order to register Mock implementations of components. For example:


 @RunWith(CompatibilityTestSuite.class)
 @Syntax("xwiki/2.0")
 @Scope("simple")
 public class IntegrationTests
 {
     @Initialized
     public void initialize(ComponentManager componentManager)
     {
         // Init mocks here for example
     }
 }
 

Since:
4.1M1
Version:
$Id: 68f0176227dcd7160f2059348d3e0b9a15ab7655 $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.junit.runners.Suite
org.junit.runners.Suite.SuiteClasses
 
Constructor Summary
CompatibilityTestSuite(Class<?> klass)
          Only called reflectively.
 
Method Summary
protected  List<org.junit.runner.Runner> getChildren()
           
 org.junit.runner.Description getDescription()
          
 
Methods inherited from class org.junit.runners.Suite
describeChild, emptySuite, runChild
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, collectInitializationErrors, filter, 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

CompatibilityTestSuite

public CompatibilityTestSuite(Class<?> klass)
                       throws Exception
Only called reflectively. Do not use programmatically.

Parameters:
klass - the test instance class on which this Test Suite is applied
Throws:
Exception - if we fail to locate or load test data, if the RenderingTest isn't a valid JUnit Test class or if we cannot locate the Component Manager
Method Detail

getChildren

protected List<org.junit.runner.Runner> getChildren()
Overrides:
getChildren in class org.junit.runners.Suite

getDescription

public org.junit.runner.Description getDescription()

We override this method so that the JUnit results are not displayed in a test hierarchy with a single test result for each node (as it would be otherwise since RenderingTest has a single test method).

Specified by:
getDescription in interface org.junit.runner.Describable
Overrides:
getDescription in class org.junit.runners.ParentRunner<org.junit.runner.Runner>


Copyright © 2004–2014 XWiki. All rights reserved.