|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--junit.framework.Assert | +--junit.framework.TestCase | +--org.arch4j.xml.XMLStreamTest
Description: Test the SpiderLogic event-based XML parser. Basic approach of this class is to create an XML file during setup and test the parser's handling of it.
Constructor Summary | |
XMLStreamTest(String name)
|
Method Summary | |
protected void |
assertAttribute(int elementIndex,
String attributeName,
String expectedValue)
|
protected void |
assertNumberOfElements(int numberOfElements)
|
protected void |
assertWellFormed()
|
void |
characters(char[] buffer,
int start,
int length)
this method is called when the parser encounters plain text outside of a bracketed tag. |
protected void |
createFile1(String pathname)
|
protected void |
createFile2(String pathname)
|
protected void |
deleteFile(String pathname)
|
void |
endDocument()
called when parser reaches the end of the document |
void |
endElement(String name)
this method is called whenever the parser encounters the end of an element |
void |
error(String message,
String source,
int line,
int column)
this method is called by the parser if it encounters a recoverable error. |
void |
fatalError(String message,
String source,
int line,
int column)
this method is called by the parser if it encounters a non-recoverable error. |
protected void |
setUp()
|
void |
startDocument()
this method is called by the parser at the start of a document |
void |
startElement(String name,
Map attributes)
this method is called when the parser encounters a starting element tag. |
static junit.framework.Test |
suite()
|
void |
testFatalError()
|
void |
testSuccess()
|
void |
warning(String message,
String source,
int line,
int column)
this method is called by the parser if it encounters a warning situation. |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public XMLStreamTest(String name)
Method Detail |
protected void setUp()
setUp
in class junit.framework.TestCase
public static junit.framework.Test suite()
public void testSuccess()
public void testFatalError()
protected void assertAttribute(int elementIndex, String attributeName, String expectedValue)
protected void assertWellFormed()
protected void assertNumberOfElements(int numberOfElements)
protected void deleteFile(String pathname)
protected void createFile1(String pathname) throws IOException
IOException
protected void createFile2(String pathname) throws IOException
IOException
public void startDocument()
startDocument
in interface XMLHandler
public void characters(char[] buffer, int start, int length)
characters
in interface XMLHandler
buffer
- buffer containing plain text charactersstart
- start index of plain text characters in bufferlength
- number of characters in plain textpublic void startElement(String name, Map attributes)
startElement
in interface XMLHandler
attributes
- a map of attribute names and values found in this elementpublic void endElement(String name)
endElement
in interface XMLHandler
name
- the tag of the element that is endingpublic void endDocument()
endDocument
in interface XMLHandler
public void error(String message, String source, int line, int column)
error
in interface XMLHandler
message
- error message generated by parsersource
- source of XML document - generally a file nameline
- line number of document on which error occurred.column
- column number at which error occurred.public void fatalError(String message, String source, int line, int column)
fatalError
in interface XMLHandler
message
- error message generated by parsersource
- source of XML document - generally a file nameline
- line number of document on which error occurred.column
- column number at which error occurred.public void warning(String message, String source, int line, int column)
warning
in interface XMLHandler
message
- error message generated by parsersource
- source of XML document - generally a file nameline
- line number of document on which error occurred.column
- column number at which error occurred.
|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |