Package org.xwiki.rendering.test.cts
Class AbstractRenderingTest
- java.lang.Object
-
- org.xwiki.rendering.test.cts.AbstractRenderingTest
-
- Direct Known Subclasses:
RenderingTest
,RenderingTest
public abstract class AbstractRenderingTest extends Object
A generic JUnit Test used byCompatibilityTestSuite
to run a single CTS test.- Since:
- 13.0
- Version:
- $Id: 80705db788821b15c1c614d1e3ee7aca6dfe2efe $
-
-
Constructor Summary
Constructors Constructor Description AbstractRenderingTest(TestData testData, String metadataSyntaxId, org.xwiki.component.manager.ComponentManager componentManager)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
execute()
Executes a single test.protected void
executeInputTest()
Executes the test as an input test.protected void
executeOutputTest()
Executes the test as an output test.protected TestData
getTestData()
protected abstract void
throwAssertionException(String message, String expected, String result)
-
-
-
Constructor Detail
-
AbstractRenderingTest
public AbstractRenderingTest(TestData testData, String metadataSyntaxId, org.xwiki.component.manager.ComponentManager componentManager)
- Parameters:
testData
- the data for a single testmetadataSyntaxId
- the Syntax id of the syntax used as Metadata in the generated XDOM for parserscomponentManager
- seegetComponentManager()
-
-
Method Detail
-
execute
public void execute() throws Exception
Executes a single test.- Throws:
Exception
- if an error happened during the test
-
getTestData
protected TestData getTestData()
-
executeInputTest
protected void executeInputTest() throws Exception
Executes the test as an input test. This means:- Parse the Syntax input
- Render the generated XDOM using the CTS Renderer
- Compare result with the CTS Output
- Throws:
Exception
- if an error happens, for example if a Parser or Renderer cannot be found
-
executeOutputTest
protected void executeOutputTest() throws Exception
Executes the test as an output test. This means:- Parse the CTS input
- Render the generated XDOM using the Syntax Renderer
- Compare result with the Syntax Output
- Throws:
Exception
- if an error happens, for example if a Parser or Renderer cannot be found
-
-