|
|||||||||||
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 junit.extensions.xml.XMLTestCase
Test Case for running XML Script based testing.
Field Summary | |
private org.w3c.dom.Element |
m_element
The element to be processed. |
private java.lang.String |
m_filename
The name of the test xml script file - found from the classpath. |
private IXMLTest |
m_parent
Parent test. |
private XMLObjectCache |
m_procedures
Map of the procedures for this test case. |
private XMLPropertyCache |
m_properties
A Map of all objects that have been found - keyed by the string name. |
Fields inherited from class junit.framework.TestCase |
|
Fields inherited from interface junit.extensions.xml.XMLConstants |
ACTION, ACTUALOBJ, ACTUALREFID, ADD, ASSERTENABLED, ASSERTEQUALS, ASSERTNOTEQUALS, ASSERTNOTNULL, ASSERTNOTSAME, ASSERTNULL, ASSERTSAME, CALL, CASE, CHOOSE, CLASSNAME, COLUMN, CONFIRM, DEBUG, DEFAULT, DELIMITER, DIALOG, DUMP, ECHO, ENABLED, ENCODING, EVALUATE, EXPECTEDOBJ, EXPECTEDREFID, FAIL, FILE, FOCUS, FOREACH, ID, INDEX, JFCFILELOC, LESSTHAN, LISTITEM, LOG, MARK, MESSAGE, METHOD, MODE, NAME, OTHERWISE, PATHREFID, PROCEDURE, PROPERTY, RECURSIVE, REFID, RELATIVE, REMOVE, ROW, SAVE, STDERR, STDOUT, STOPWATCH, SUITE, SWITCH, TABLECELL, TAGHANDLERS, TAGNAME, TEST, TYPE, USERE, VALUE, WHEN, WHILE |
Constructor Summary | |
XMLTestCase(java.lang.String filename,
org.w3c.dom.Element element)
The default constructor that is needed to createa a test case. |
Method Summary | |
void |
addProcedure(IXMLProcedure proc)
Add a procedure definition. |
void |
addProperty(java.lang.String name,
java.lang.Object obj)
Add each found object into the cache map. |
void |
callProcedure(java.lang.String name,
org.w3c.dom.Element element)
Call a procedure by name. |
void |
clearProperties()
For each test (method) element, the found objects has to be cleared. |
boolean |
getDebug()
Get the debug state. |
IXMLProcedure |
getProcedure(java.lang.String name)
Get a procedure definition. |
XMLObjectCache |
getProcedureCache()
Get the procedure cache. |
java.lang.Object |
getProperty(java.lang.String name)
Retrieve the object that was found previously. |
XMLObjectCache |
getPropertyCache()
Get the property cache. |
java.lang.String |
getPropertyName(java.lang.Object comp)
Get the name of a component which has been found. |
java.lang.String[] |
getPropertyNames()
Get the names of the found objects. |
void |
processChildren(org.w3c.dom.Element element)
Process the child XML Elements. |
void |
removeProperty(java.lang.String name)
Remove the object with the name given. |
java.lang.String |
resolveProperties(java.lang.String s)
Resolve embeded property names withing a string. |
void |
runBare()
Sets up, executes and then tears down a test. |
protected void |
runTest()
Executes a test. |
void |
runXMLTest()
This method is the one that actually performs the test by processing the elements. |
void |
setParent(IXMLTest parent)
Set the parent of the test case. |
void |
setUp()
Default setUp which does nothing. |
static junit.framework.Test |
suite()
Returns an empty suite. |
void |
tearDown()
Default tearDown which does nothing. |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, setName, 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 |
Methods inherited from interface junit.extensions.xml.IXMLTestCase |
getName, setName |
Methods inherited from interface junit.framework.Test |
countTestCases, run |
Field Detail |
private org.w3c.dom.Element m_element
private IXMLTest m_parent
private java.lang.String m_filename
private XMLObjectCache m_procedures
private XMLPropertyCache m_properties
Constructor Detail |
public XMLTestCase(java.lang.String filename, org.w3c.dom.Element element)
filename
- The name of the test xml script file
(found from the classpath)element
- The Element to be processedMethod Detail |
public final boolean getDebug()
getDebug
in interface IXMLTest
public final void setParent(IXMLTest parent)
setParent
in interface IXMLTest
parent
- of the test case.public final IXMLProcedure getProcedure(java.lang.String name)
getProcedure
in interface IXMLTest
name
- Name of the procedure.
public final XMLObjectCache getProcedureCache()
getProcedureCache
in interface IXMLTest
public final java.lang.Object getProperty(java.lang.String name)
getProperty
in interface IXMLTest
name
- The name of the object that was found
public final XMLObjectCache getPropertyCache()
getPropertyCache
in interface IXMLTest
public final java.lang.String getPropertyName(java.lang.Object comp)
getPropertyName
in interface IXMLTest
comp
- Component to locate
public final java.lang.String[] getPropertyNames()
getPropertyNames
in interface IXMLTest
public void setUp() throws java.lang.Exception
java.lang.Exception
- An instance of java.lang.Exception can be thrownTestCase.setUp()
public final void addProcedure(IXMLProcedure proc)
addProcedure
in interface IXMLTest
proc
- Procedure to be added.public final void callProcedure(java.lang.String name, org.w3c.dom.Element element) throws XMLException
callProcedure
in interface IXMLTestCase
name
- Name of the procedure to be called.element
- Element of the call
XMLException
- may be thrown.public final void processChildren(org.w3c.dom.Element element) throws XMLException
processChildren
in interface IXMLTestCase
element
- Element which has children to be processed.
XMLException
- may be thrown during processing.public final void removeProperty(java.lang.String name)
removeProperty
in interface IXMLTest
name
- Name of the object to be removedpublic final java.lang.String resolveProperties(java.lang.String s)
resolveProperties
in interface IXMLTest
s
- String to be resolved.
public void runBare() throws java.lang.Throwable
java.lang.Throwable
- exceptions thrown by code.public final void runXMLTest() throws java.lang.Exception
java.lang.Exception
- An instance of java.lang.Exception can be thrown.public static junit.framework.Test suite()
public final void addProperty(java.lang.String name, java.lang.Object obj)
addProperty
in interface IXMLTest
name
- The name of the found object.obj
- The actual object that was found.public final void clearProperties()
clearProperties
in interface IXMLTest
public void tearDown() throws java.lang.Exception
java.lang.Exception
- An instance of java.lang.Exception can be thrownTestCase.setUp()
protected void runTest() throws java.lang.Throwable
java.lang.Throwable
- exceptions thrown by code.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |