public class

TestViewHeadingFragmentTransformer

extends TestCase
java.lang.Object
   ↳ junit.framework.Assert
     ↳ junit.framework.TestCase
       ↳ com.atlassian.confluence.content.render.xhtml.view.TestViewHeadingFragmentTransformer

Class Overview

Test the transformation from storage to view of heading elements which have an anchor embedded.

The acceptance test testMacroInHeader (in MacrosAcceptanceTest) also tests headers that contain macros.

Summary

Public Constructors
TestViewHeadingFragmentTransformer()
Public Methods
void testAlignedHeading()
Tests transformation of header if the alignment style is defined.
void testAnchorContainsBodylessLink()
Tests headings that contain links without a body (they use the default value).
void testAnchorContainsBodylessMacro()
Tests headings that contain bodyless macros.
void testAnchorContainsLinkBody()
Tests headings that contain links with a body.
void testAnchorContainsMacroBody()
Tests headings that contain bodied macros.
void testAnchorTruncation()
Tests truncation of anchors where we have had to fall back on using Text from the output rather than text from the storage.
void testEmptyHeading()
Test a header with no text which should be discarded.
void testEscapeChars()
Tests headings using HTML and XML entities
void testHandles()
Test it only handles h1..h6
void testHeadingNullContext()
Test the use of a null context (used in some more complex tests).
void testHeadingOtherContext()
Test the use of a sub type of RenderContext that is not a page or space context.
void testHeadingPageContext()
Test the addition of an anchor prefix for a page context.
void testHeadingSimpleContext()
Test the use of a DefaultConversionContext without a RenderContext (used in some more complex tests).
void testHeadingSpaceContext()
Test the addition of an anchor prefix for a space context no longer takes place (since 4.0).
void testHeadings()
Test basic transformation of each header.
void testMultipleHeaders()
Tests multiple headers in a row.
Protected Methods
void setUp()
void tearDown()
[Expand]
Inherited Methods
From class junit.framework.TestCase
From class junit.framework.Assert
From class java.lang.Object
From interface junit.framework.Test

Public Constructors

public TestViewHeadingFragmentTransformer ()

Public Methods

public void testAlignedHeading ()

Tests transformation of header if the alignment style is defined.

Throws
Exception if unexpected problem

public void testAnchorContainsBodylessLink ()

Tests headings that contain links without a body (they use the default value). There is no storage format text so we fall back to using text from the output.

Throws
Exception if unexpected problem

public void testAnchorContainsBodylessMacro ()

Tests headings that contain bodyless macros. There is no storage format text so we fall back to using text from the output.

Throws
Exception if unexpected problem

public void testAnchorContainsLinkBody ()

Tests headings that contain links with a body. The text in the storage format (the text of the link's body) should become the basis for the anchor.

Throws
Exception if unexpected problem

public void testAnchorContainsMacroBody ()

Tests headings that contain bodied macros. The text in the storage format (the text of the macros's body) should become the basis for the anchor.

Throws
Exception if unexpected problem

public void testAnchorTruncation ()

Tests truncation of anchors where we have had to fall back on using Text from the output rather than text from the storage. Normally bodyless macros and links.

Throws
Exception if unexpected problem

public void testEmptyHeading ()

Test a header with no text which should be discarded.

Throws
Exception if unexpected problem

public void testEscapeChars ()

Tests headings using HTML and XML entities

Throws
Exception if unexpected problem

public void testHandles ()

Test it only handles h1..h6

Throws
Exception if unexpected problem

public void testHeadingNullContext ()

Test the use of a null context (used in some more complex tests). The anchor is given no prefix.

Throws
Exception if unexpected problem

public void testHeadingOtherContext ()

Test the use of a sub type of RenderContext that is not a page or space context. One might get added in the future.

Throws
Exception if unexpected problem

public void testHeadingPageContext ()

Test the addition of an anchor prefix for a page context.

Throws
Exception if unexpected problem

public void testHeadingSimpleContext ()

Test the use of a DefaultConversionContext without a RenderContext (used in some more complex tests). The anchor is given no prefix.

Throws
Exception if unexpected problem

public void testHeadingSpaceContext ()

Test the addition of an anchor prefix for a space context no longer takes place (since 4.0).

Throws
Exception if unexpected problem

public void testHeadings ()

Test basic transformation of each header.

Throws
Exception if unexpected problem

public void testMultipleHeaders ()

Tests multiple headers in a row.

Throws
Exception if unexpected problem

Protected Methods

protected void setUp ()

Throws
Exception

protected void tearDown ()

Throws
Exception