|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTestCase
com.ssx.xml.output.TestsForXmlOutput
Common tests for all XmlOutput derivatives.
Field Summary | |
protected static String |
END_OF_LINE_MARKER
The line break sequence to use when formatting |
protected static String |
EXPAND_QNAMES
A testing switch - show namespace names rather than prefixes on output where applicable (ie. |
protected static String |
INDENT_SPACER
The characters used in a single indentation when formating |
protected static String |
USE_FORMATTING
Add line breaks and indenting to the XML output where applicable (ie. |
protected static String |
USE_SINGLE_QUOTE
Surround attribute values with single quotes |
Constructor Summary | |
TestsForXmlOutput(String name)
|
Method Summary | |
protected abstract String |
getXmlText(XmlOutput output)
Convert the XmlOutput object to a string |
protected abstract XmlOutput |
newXmlOutput(HashMap properties)
Create a new XmlOutput instance |
void |
testAddDuplicateAttribute_Name()
Attempting to add a duplicate attribute will cause an exception |
void |
testAddDuplicateAttribute_Namespace()
Attempting to add a duplicate attribute will cause an exception |
void |
testAddNamespaceNodes()
Namespace nodes can be added to any entity |
void |
testAttributes_AddComment()
Comments can be added to the XML anywhere |
void |
testAttributes_AddInvalidComment()
Comments may not contain the stirng '-->' and they can not end with a dash (-). |
void |
testAttributes_addProcessingInstruction()
Processing instructions can be added to the HTML |
void |
testAttributes_addText()
Text can be added anywhere in the body of the root element |
void |
testAttributes_addTextWithEncoding()
Any reserved values found in text are encoded (Note that ' and " do not need to be encoded here) |
void |
testAttributes_CallAfterClose()
An method called after the output has been closed will throw and Exception. |
void |
testAttributes_DigitStartingName()
Attribute names can only start with a leter or the allowed punctuation. |
void |
testAttributes_EncodeSpecialChars()
Other illeagal characters will be replaced if they are found in an attribute value. |
void |
testAttributes_EscapeQuotes()
If the same quote is used in an attribute value as is used to delimit attribute values it will need to be escaped using an entity reference. |
void |
testAttributes_Invalid()
Attributes can only be added to entities directly after a call to startElement. |
void |
testAttributes()
Attributes can be added to entities with the writeAttribute method. |
void |
testAttributesNullValue()
If the attribute value is null the attribute will not be added to the entity. |
void |
testElements_DigitStartingName()
element names can only start with a leter or the allowed punctuation. |
void |
testElements_Nested()
Subsequent calls after startElement, excluding endElement, will fill the body of the initial element. |
void |
testElements_rootElements()
An XML document requires exaclty one root element |
void |
testElements_Sequential()
To write an empty element call endElement directly after calling startElement. |
void |
testElements_startEndMatching()
The each start element call must be matched by exactly one endElement call. |
void |
testElements_Unballanced()
Each startElement call must be matched by an endElement call or an error will be thrown when the stream is closed. |
void |
testFormatting()
Line breaks and indenting can be added to the output stream to format is for human reading. |
void |
testFormatting2()
Formatting will only be added between entities that have no intervening character data. |
void |
testFormatting3()
Testing a larger collection of entities - just to see what happens. |
void |
testRedundantNamespaceDeclarationsAreIgnored()
|
void |
testResolveNamespacePrefixes()
The prefixes used with entities and attributes are resolved into namespaces and associated with the entities base on the XML Namspace spec. |
void |
testValidateNamespacePrefixes()
Namespace prefixes used with attribute names are validated against the namespaces in scope. |
void |
testValidateNamespacePrefixes2()
Namespace prefixes used with entity names are validated against the namespaces in scope. |
void |
testWritePIFirst()
Test that a PI can be written as the first output |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final String USE_SINGLE_QUOTE
protected static final String USE_FORMATTING
protected static final String END_OF_LINE_MARKER
protected static final String INDENT_SPACER
protected static final String EXPAND_QNAMES
Constructor Detail |
public TestsForXmlOutput(String name)
name
- The test suite nameMethod Detail |
protected abstract XmlOutput newXmlOutput(HashMap properties)
properties
- The Sink configuration properties
protected abstract String getXmlText(XmlOutput output)
output
- An XmlOutput instance
public void testElements_rootElements()
public void testElements_Nested()
public void testElements_Sequential()
public void testElements_startEndMatching()
public void testElements_Unballanced()
public void testElements_DigitStartingName()
public void testAttributes()
public void testAttributes_Invalid()
public void testAttributes_DigitStartingName()
public void testAttributes_EscapeQuotes()
public void testAttributes_EncodeSpecialChars()
public void testAttributes_AddComment()
public void testAttributes_AddInvalidComment()
public void testAttributes_addText()
public void testAttributes_addTextWithEncoding()
public void testAttributes_addProcessingInstruction()
public void testAttributes_CallAfterClose()
public void testFormatting()
public void testFormatting2()
public void testFormatting3()
public void testAddNamespaceNodes()
public void testResolveNamespacePrefixes()
public void testValidateNamespacePrefixes()
public void testValidateNamespacePrefixes2()
public void testAddDuplicateAttribute_Name()
public void testAddDuplicateAttribute_Namespace()
public void testAttributesNullValue()
public void testWritePIFirst()
public void testRedundantNamespaceDeclarationsAreIgnored()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |