public class

TestStorageXhtmlCleaner

extends XMLTestCase
java.lang.Object
   ↳ XMLTestCase
     ↳ com.atlassian.confluence.content.render.xhtml.TestStorageXhtmlCleaner

Class Overview

Tests for the storage format cleaner

Summary

Constants
String ANTISAMY_STORAGE_FORMAT_POLICY
Fields
public static XhtmlCleaner TEST_CLEANER
Public Constructors
TestStorageXhtmlCleaner()
Public Methods
static void assertNotModifiedByCleaning(String xmlFragment, XMLTestCase testCase)
void testAcAnchorAllowSpaceAndPunctuation()
void testAcceptAdditionalHrefAttributes()
void testCDataEncoded()
void testCDataEncodedInRichTextMacroBody()
void testCSS21Additions()
CONFDEV-1263 - update the CSS 2.0 policy file to support CSS 2.1 additions
void testCleanStyleAttribute()
void testCommentsAreRemoved()
void testControlCharactersInCDataAreStripped()
void testDelElementsArePermitted()
void testDoNotResolveEntities()
void testDoNotResolveEntitiesInAttributeValues()
void testDuplicateAttributesRemoved()
void testEmbeddedImageAllSupportedAttributesRetained()
CONFDEV-5931 Test that title attributes are retained on images (For some reason ac:style only allows empty but doesn't drop the attribute.)
void testEmptyHeadingHandling()
Test for CONFDEV-1496.
void testEmptyMacroTagIsPassed()
void testEmptyParagraphHandling()
Test for CONFDEV-1496.
void testEmptyTagsPreserved()
void testFilterFormElement()
void testIdAttributesRemoved()
void testInsElementsArePermitted()
void testInvalidEntitiesAreEncoded()
void testIsCleanUrlAttribute()
void testLinkAndResourceIdentifierIsPassed()
void testLinkWithUnsupportedSchemeIsCleaned()
void testMacroBodyInMacroBody()
During some DaisyDiff experimenting we discovered that the versions of Cyberneko and Xerces DaisyDiff was bringing in causes a bug that this test is for catching.
void testParagraphClosingStillOccursInRichTextLinkBody()
void testRemoveFormComponents()
void testReplacedEntitiesInPlainTextMacroBody()
void testSpanMayHaveStyle()
void testStorageFormatEmbeddedExternalImage()
CONFDEV-2700
void testStorageFormatEmbeddedImagesAreCleaned()
void testStorageFormatEmbeddedImagesCanBeEmpty()
void testStorageFormatEmbeddedWebImageCleaned()
void testStorageFormatNestedRichTextMacroBodyWithBlockElementsInsideOtherBlockElements()
void testStorageFormatPlainTextMacroBodyIsPassed()
void testStorageFormatRichTextLinkBodyWithBlockElementsInsideOtherBlockElements()
void testStorageFormatRichTextMacroBodyInlineElementsInsideOtherInlineElements()
void testStorageFormatRichTextMacroBodyWithBlockElementsInsideOtherBlockElements()
void testStripCiteAttribute()
void testStripEventHandlerAttribute()
void testStripHeadElement()
void testStripInlineStylesheets()
void testStripJavascriptHrefFromAttribute()
void testStripJavascriptUrlFromInlineCss()
void testStripObjectElement()
void testStripScriptElement()
void testStripUnknownAttribute()
void testStripUnknownElement()
void testStripUriAttributesFromImageElement()
void testSupplementaryMultiLingualPlaneCodePoints()
CONFDEV-5428
void testSupplementaryMultiLingualPlaneCodePointsInCData()
CONFDEV-5428
void testTagBalancing()
Protected Methods
void setUp()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ANTISAMY_STORAGE_FORMAT_POLICY

Constant Value: "com/atlassian/confluence/content/render/xhtml/antisamy-confluence-storage.xml"

Fields

public static XhtmlCleaner TEST_CLEANER

Public Constructors

public TestStorageXhtmlCleaner ()

Public Methods

public static void assertNotModifiedByCleaning (String xmlFragment, XMLTestCase testCase)

Throws
Exception

public void testAcAnchorAllowSpaceAndPunctuation ()

Throws
Exception

public void testAcceptAdditionalHrefAttributes ()

Throws
Exception

public void testCDataEncoded ()

Throws
Exception

public void testCDataEncodedInRichTextMacroBody ()

Throws
Exception

public void testCSS21Additions ()

CONFDEV-1263 - update the CSS 2.0 policy file to support CSS 2.1 additions

Throws
Exception

public void testCleanStyleAttribute ()

Throws
Exception

public void testCommentsAreRemoved ()

Throws
Exception

public void testControlCharactersInCDataAreStripped ()

Throws
Exception

public void testDelElementsArePermitted ()

Throws
Exception

public void testDoNotResolveEntities ()

Throws
Exception

public void testDoNotResolveEntitiesInAttributeValues ()

Throws
Exception

public void testDuplicateAttributesRemoved ()

Throws
Exception

public void testEmbeddedImageAllSupportedAttributesRetained ()

CONFDEV-5931 Test that title attributes are retained on images (For some reason ac:style only allows empty but doesn't drop the attribute.)

Throws
Exception

public void testEmptyHeadingHandling ()

Test for CONFDEV-1496. Heading elements that are empty will be dropped. Just ensure we don't wrap the heading around the following paragraph.

Throws
Exception

public void testEmptyMacroTagIsPassed ()

Throws
Exception

public void testEmptyParagraphHandling ()

Test for CONFDEV-1496.

Throws
Exception

public void testEmptyTagsPreserved ()

Throws
Exception

public void testFilterFormElement ()

Throws
Exception

public void testIdAttributesRemoved ()

Throws
Exception

public void testInsElementsArePermitted ()

Throws
Exception

public void testInvalidEntitiesAreEncoded ()

Throws
Exception

public void testIsCleanUrlAttribute ()

Throws
Exception

public void testLinkAndResourceIdentifierIsPassed ()

Throws
Exception

public void testLinkWithUnsupportedSchemeIsCleaned ()

Throws
Exception

public void testMacroBodyInMacroBody ()

During some DaisyDiff experimenting we discovered that the versions of Cyberneko and Xerces DaisyDiff was bringing in causes a bug that this test is for catching.

Throws
Exception

public void testParagraphClosingStillOccursInRichTextLinkBody ()

Throws
Exception

public void testRemoveFormComponents ()

Throws
Exception

public void testReplacedEntitiesInPlainTextMacroBody ()

Throws
Exception

public void testSpanMayHaveStyle ()

Throws
Exception

public void testStorageFormatEmbeddedExternalImage ()

CONFDEV-2700

Throws
Exception

public void testStorageFormatEmbeddedImagesAreCleaned ()

Throws
Exception

public void testStorageFormatEmbeddedImagesCanBeEmpty ()

Throws
Exception

public void testStorageFormatEmbeddedWebImageCleaned ()

Throws
Exception

public void testStorageFormatNestedRichTextMacroBodyWithBlockElementsInsideOtherBlockElements ()

Throws
Exception

public void testStorageFormatPlainTextMacroBodyIsPassed ()

Throws
Exception

public void testStorageFormatRichTextLinkBodyWithBlockElementsInsideOtherBlockElements ()

Throws
Exception

public void testStorageFormatRichTextMacroBodyInlineElementsInsideOtherInlineElements ()

Throws
Exception

public void testStorageFormatRichTextMacroBodyWithBlockElementsInsideOtherBlockElements ()

Throws
Exception

public void testStripCiteAttribute ()

Throws
Exception

public void testStripEventHandlerAttribute ()

Throws
Exception

public void testStripHeadElement ()

Throws
Exception

public void testStripInlineStylesheets ()

Throws
Exception

public void testStripJavascriptHrefFromAttribute ()

Throws
Exception

public void testStripJavascriptUrlFromInlineCss ()

Throws
Exception

public void testStripObjectElement ()

Throws
Exception

public void testStripScriptElement ()

Throws
Exception

public void testStripUnknownAttribute ()

Throws
Exception

public void testStripUnknownElement ()

Throws
Exception

public void testStripUriAttributesFromImageElement ()

Throws
Exception

public void testSupplementaryMultiLingualPlaneCodePoints ()

CONFDEV-5428

Throws
Exception

public void testSupplementaryMultiLingualPlaneCodePointsInCData ()

CONFDEV-5428

Throws
Exception

public void testTagBalancing ()

Throws
Exception

Protected Methods

protected void setUp ()

Throws
Exception