|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
junit.extensions.jfcunit.JFCTestCase
junit.extensions.jfcunit.xml.JFCXMLTestCase
This class will handle the processing of <test> nodes.
This tag handler invokes the test case given.
| Attribute | Description | Required | Default | Values |
| name | name of the test case | Yes | N/A | Alpha Numeric Name |
| robot | Use a robot or send events directly to AWT Event queue. | No | false | true if events are to be sent via the Robot |
| assertexit | Assert the System.exit() command, ExitException will be thrown by the security manager and the application will not exit. | No | false | true if the system exist should be asserted. |
<test name="Login"> ... </test> <test name="Logout" assertexit="true"> ... </test>
The above runs the defined testcase.
| Nested Class Summary |
| Nested classes inherited from class junit.extensions.jfcunit.JFCTestCase |
|
| 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 junit.framework.Test |
m_parent
Parent test case. |
private XMLObjectCache |
m_procedures
Map of procedures. |
private XMLObjectCache |
m_properties
A Map of all objects that have been found - keyed by the string name. |
| Fields inherited from class junit.extensions.jfcunit.JFCTestCase |
|
| Fields inherited from class junit.framework.TestCase |
|
| Fields inherited from interface junit.extensions.jfcunit.xml.JFCXMLConstants |
ALT, ALTGR, AMOUNT, ASSERTEXIT, AWTTHREAD, BUTTON1, BUTTON2, BUTTON3, CASEINDEPENDENT, CLASS, CLICK, CLICKS, CODE, CONTAINER, CONTAINS, CTRL, DESTINATION, DOWN, DRAG, DURATION, EDITOR, ENDSWITH, EQUALS, FIND, FINDER, FLUSH, ICONDESCRIPTION, ICONFILE, INDEXDELIMITER, INDEXES, KEY, LABEL, MATCH, META, MODIFIERS, NODEVALUE, OPERATION, PATH, PATHDELIMITER, PAUSE, POINT, POPUPTRIGGER, POSITION, RECORDING, REFERENCE, RESUME, ROBOT, ROTATION, SHIFT, SHOW, SLEEP, SLEEPTIME, SOURCE, STARTSWITH, STRING, SUBCOMPONENT, TERMINATOR, TITLE, UP, WAIT |
| 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 |
| Fields inherited from interface junit.extensions.jfcunit.eventdata.EventDataConstants |
CENTER, CUSTOM, DEFAULT_HOLDTIME, DEFAULT_ISPOPUPTRIGGER, DEFAULT_KEY_MODIFIERS, DEFAULT_MOUSE_MODIFIERS, DEFAULT_NUMBEROFCLICKS, DEFAULT_POPUP_MODIFIERS, DEFAULT_POSITION, DEFAULT_SCROLL_AMOUNT, DEFAULT_SLEEPTIME, DEFAULT_WHEEL_ROTATION, DOWN_ARROW_SUBCOMPONENT, EAST, EDITOR_SUBCOMPONENT, INVALID_SUBCOMPONENT, INVALID_TEXT_OFFSET, NORTH, NORTH_EAST, NORTH_WEST, OFFSET, PERCENT, POSITIONSTRINGS, SOUTH, SOUTH_EAST, SOUTH_WEST, UP_ARROW_SUBCOMPONENT, WEST |
| Constructor Summary | |
JFCXMLTestCase(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 to the test case. |
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 callElement)
Call the procedure with the given 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 the procedure withthe given name. |
XMLObjectCache |
getProcedureCache()
Returns the cahce of procedures. |
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 properties. |
private void |
loadProcedures(org.w3c.dom.Element element)
Process the child XML elements. |
void |
processChildren(org.w3c.dom.Element element)
Process the child XML elements. |
void |
removeProperty(java.lang.String name)
Remove the property with the name given. |
java.lang.String |
resolveProperties(java.lang.String s)
Resolve embeded property names withing a string. |
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 test case. |
protected void |
setUp()
Default setUp which does nothing. |
static junit.framework.Test |
suite()
Returns an empty suite. |
protected void |
tearDown()
Default tearDown which does nothing. |
| Methods inherited from class junit.extensions.jfcunit.JFCTestCase |
awtSleep, awtSleep, createNoExitSecurityManager, flushAWT, getAssertExit, getError, getHelper, getLockWait, hasError, isAWTRunning, pause, pauseAWT, resetError, resetForcedWait, resetSleepTime, resumeAWT, runBare, runCode, setAssertExit, setError, setForcedWait, setHelper, setLockWait, setSleepTime, sleep |
| 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 java.lang.String m_filename
private junit.framework.Test m_parent
private XMLObjectCache m_procedures
private XMLObjectCache m_properties
| Constructor Detail |
public JFCXMLTestCase(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 processed| Method Detail |
public final boolean getDebug()
getDebug in interface IXMLTestpublic final void setParent(IXMLTest parent)
setParent in interface IXMLTestparent - Parent test case.public final IXMLProcedure getProcedure(java.lang.String name)
getProcedure in interface IXMLTestname - Name of the procedure to return.
public final XMLObjectCache getProcedureCache()
getProcedureCache in interface IXMLTestpublic final java.lang.Object getProperty(java.lang.String name)
getProperty in interface IXMLTestname - The name of the object that was found
public final XMLObjectCache getPropertyCache()
getPropertyCache in interface IXMLTestpublic final java.lang.String getPropertyName(java.lang.Object comp)
getPropertyName in interface IXMLTestcomp - Component to locate
public final java.lang.String[] getPropertyNames()
getPropertyNames in interface IXMLTestpublic final void addProcedure(IXMLProcedure proc)
addProcedure in interface IXMLTestproc - Procedure to be added.
public final void callProcedure(java.lang.String name,
org.w3c.dom.Element callElement)
throws XMLException
callProcedure in interface IXMLTestCasename - Name of the procedure.callElement - Element which contains the attributes to
be passed to the procedures.
XMLException - is thrown if the element cannot be understood.
public final void processChildren(org.w3c.dom.Element element)
throws XMLException
processChildren in interface IXMLTestCaseelement - Element which contains the children to
be processed.
XMLException - may be thrown.
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()
throws java.lang.Exception
java.lang.Exception - An instance of java.lang.Exception can be thrown.
public final void addProperty(java.lang.String name,
java.lang.Object obj)
addProperty in interface IXMLTestname - The name of the found objectobj - The actual object that was foundpublic final void clearProperties()
clearProperties in interface IXMLTestpublic final void removeProperty(java.lang.String name)
removeProperty in interface IXMLTestname - Name of the object to be removedpublic java.lang.String resolveProperties(java.lang.String s)
resolveProperties in interface IXMLTests - String to be resolved.
protected void setUp()
throws java.lang.Exception
setUp in class JFCTestCasejava.lang.Exception - An instance of java.lang.Exception can be thrownTestCase.setUp()
protected void runTest()
throws java.lang.Throwable
runTest in class JFCTestCasejava.lang.Throwable - exceptions thrown by code.
protected void tearDown()
throws java.lang.Exception
tearDown in class JFCTestCasejava.lang.Exception - An instance of java.lang.Exception can be thrownTestCase.setUp()
private void loadProcedures(org.w3c.dom.Element element)
throws XMLException
element - Element which contains the children to
be processed.
XMLException - is thrown if the element cannot be understood.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||