org.w3c.domts

Class DOMTestCase

public abstract class DOMTestCase extends DOMTest

This is an abstract base class for generated DOM tests
Constructor Summary
DOMTestCase()
This constructor is for DOMTestCase's that make specific demands for parser configuration. setFactory should be called before the end of the tests constructor to set the factory.
DOMTestCase(DOMTestDocumentBuilderFactory factory)
This constructor is for DOMTestCase's that do not add any requirements for parser configuration.
Method Summary
voidassertEqualAutoCase(String context, String assertID, Collection expected, Collection actual)
Asserts that each entry in actual is matched with an entry in expected that only differs by case.
voidassertEquals(String assertID, String expected, String actual)
Asserts that expected.equals(actual) is true
voidassertEquals(String assertID, int expected, int actual)
Asserts that values of expected and actual are equal.
voidassertEquals(String assertID, double expected, double actual)
Asserts that values of expected and actual are equal.
voidassertEquals(String assertID, boolean expected, boolean actual)
Asserts that values of expected and actual are equal.
voidassertEquals(String assertID, Collection expected, NodeList actual)
Asserts that each entry in actual exactly matches with an entry in expected.
voidassertEquals(String assertID, Collection expected, Collection actual)
Asserts that each entry in actual exactly matches with an entry in expected.
voidassertEqualsAutoCase(String context, String assertID, String expected, String actual)
Asserts that expected.equalsIgnoreCase(actual) is true
voidassertEqualsAutoCase(String context, String assertID, List expected, List actual)
Asserts that each entry in actual is matched with an entry in expected that only differs by case.
voidassertEqualsIgnoreCase(String assertID, String expected, String actual)
Asserts that expected.equalsIgnoreCase(actual) is true
voidassertEqualsIgnoreCase(String assertID, Collection expected, Collection actual)
Asserts that each entry in actual is matched with an entry in expected that only differs by case.
voidassertEqualsIgnoreCase(String assertID, List expected, List actual)
Asserts that each entry in actual is matched with an entry in expected that only differs by case.
voidassertFalse(String assertID, boolean actual)
Asserts that actual==false
voidassertFalse(String assertID, Object actual)
Asserts that actual==false
voidassertInstanceOf(String assertID, Class cls, Object obj)
Asserts that obj is an instance of cls
voidassertNotEquals(String assertID, String expected, String actual)
Asserts that values of expected and actual are not equal.
voidassertNotEquals(String assertID, int expected, int actual)
Asserts that values of expected and actual are not equal.
voidassertNotEquals(String assertID, double expected, double actual)
Asserts that values of expected and actual are not equal.
voidassertNotEqualsAutoCase(String context, String assertID, String expected, String actual)
Asserts that expected.equalsIgnoreCase(actual) is false
voidassertNotEqualsIgnoreCase(String assertID, String expected, String actual)
Asserts that expected.equalsIgnoreCase(actual) is false
voidassertNotNull(String assertID, Object actual)
Asserts that actual !
voidassertNull(String assertID, Object actual)
Asserts that actual == null
voidassertSame(String assertID, Object expected, Object actual)
Asserts that actual and expected are the same object
voidassertSize(String assertID, int expectedSize, NodeList collection)
Asserts that the length of the collection is the expected size.
voidassertSize(String assertID, int expectedSize, NamedNodeMap collection)
Asserts that the length of the collection is the expected size.
voidassertSize(String assertID, int expectedSize, Collection collection)
Asserts that the length of the collection is the expected size.
voidassertTrue(String assertID, boolean actual)
Asserts that actual==true
voidassertTrue(String assertID, Object actual)
Asserts that actual==true
voidassertURIEquals(String assertID, String scheme, String path, String host, String file, String name, String query, String fragment, Boolean isAbsolute, String actual)
Asserts aspects of a URI
static voiddoMain(Class testClass, String[] args)
This method is called by the main() for each test and locates the appropriate test framework and runs the specified test
booleanequals(String expected, String actual)
Compares the values of actual and expected.
booleanequals(int expected, int actual)
Compares the values of actual and expected.
booleanequals(double expected, double actual)
Compares the values of actual and expected.
booleanequals(Collection expected, Collection actual)
Compares the values in actual and expected ignoring order.
booleanequals(List expected, List actual)
Compares the values in actual and expected.
booleanequalsAutoCase(String context, String expected, String actual)
Compares the value of actual and expected ignoring case.
booleanequalsAutoCase(String context, Collection expected, Collection actual)
Compares the values in actual and expected ignoring case and order.
booleanequalsAutoCase(String context, List expected, List actual)
Compares the values in actual and expected ignoring case.
booleanequalsIgnoreCase(String expected, String actual)
Compares the value of actual and expected ignoring case.
booleanequalsIgnoreCase(Collection expected, Collection actual)
Compares the values in actual and expected ignoring case and order.
booleanequalsIgnoreCase(List expected, List actual)
Compares the values in actual and expected ignoring case.
voidfail(String assertID)
Fail test
abstract voidrunTest()
Body of test
booleansame(Object expected, Object actual)
Compares the identity of actual and expected.
voidsetFramework(DOMTestFramework framework)
Sets test framework to be used by test.
intsize(Collection collection)
Gets the size of the collection
intsize(NamedNodeMap collection)
Gets the size of the collection
intsize(NodeList collection)
Gets the size of the collection
voidwait(int millisecond)
Wait

Constructor Detail

DOMTestCase

public DOMTestCase()
This constructor is for DOMTestCase's that make specific demands for parser configuration. setFactory should be called before the end of the tests constructor to set the factory.

DOMTestCase

public DOMTestCase(DOMTestDocumentBuilderFactory factory)
This constructor is for DOMTestCase's that do not add any requirements for parser configuration.

Parameters: factory document factory to be used by test, may not be null.

Method Detail

assertEqualAutoCase

public void assertEqualAutoCase(String context, String assertID, Collection expected, Collection actual)
Asserts that each entry in actual is matched with an entry in expected that only differs by case. Order is not significant.

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertEquals

public void assertEquals(String assertID, String expected, String actual)
Asserts that expected.equals(actual) is true

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertEquals

public void assertEquals(String assertID, int expected, int actual)
Asserts that values of expected and actual are equal.

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertEquals

public void assertEquals(String assertID, double expected, double actual)
Asserts that values of expected and actual are equal.

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertEquals

public void assertEquals(String assertID, boolean expected, boolean actual)
Asserts that values of expected and actual are equal.

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertEquals

public void assertEquals(String assertID, Collection expected, NodeList actual)
Asserts that each entry in actual exactly matches with an entry in expected. Order is not significant.

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertEquals

public void assertEquals(String assertID, Collection expected, Collection actual)
Asserts that each entry in actual exactly matches with an entry in expected. Order is not significant.

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertEqualsAutoCase

public void assertEqualsAutoCase(String context, String assertID, String expected, String actual)
Asserts that expected.equalsIgnoreCase(actual) is true

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertEqualsAutoCase

public void assertEqualsAutoCase(String context, String assertID, List expected, List actual)
Asserts that each entry in actual is matched with an entry in expected that only differs by case. Order is significant.

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertEqualsIgnoreCase

public void assertEqualsIgnoreCase(String assertID, String expected, String actual)
Asserts that expected.equalsIgnoreCase(actual) is true

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertEqualsIgnoreCase

public void assertEqualsIgnoreCase(String assertID, Collection expected, Collection actual)
Asserts that each entry in actual is matched with an entry in expected that only differs by case. Order is not significant.

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertEqualsIgnoreCase

public void assertEqualsIgnoreCase(String assertID, List expected, List actual)
Asserts that each entry in actual is matched with an entry in expected that only differs by case. Order is significant.

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertFalse

public void assertFalse(String assertID, boolean actual)
Asserts that actual==false

Parameters: assertID identifier of assertion actual actual value

assertFalse

public void assertFalse(String assertID, Object actual)
Asserts that actual==false

Parameters: assertID identifier of assertion actual actual value

assertInstanceOf

public void assertInstanceOf(String assertID, Class cls, Object obj)
Asserts that obj is an instance of cls

Parameters: assertID identifier of assertion obj object cls class, may not be null.

assertNotEquals

public void assertNotEquals(String assertID, String expected, String actual)
Asserts that values of expected and actual are not equal.

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertNotEquals

public void assertNotEquals(String assertID, int expected, int actual)
Asserts that values of expected and actual are not equal.

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertNotEquals

public void assertNotEquals(String assertID, double expected, double actual)
Asserts that values of expected and actual are not equal.

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertNotEqualsAutoCase

public void assertNotEqualsAutoCase(String context, String assertID, String expected, String actual)
Asserts that expected.equalsIgnoreCase(actual) is false

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertNotEqualsIgnoreCase

public void assertNotEqualsIgnoreCase(String assertID, String expected, String actual)
Asserts that expected.equalsIgnoreCase(actual) is false

Parameters: assertID identifier of assertion actual actual value expected Expected value, may not be null.

assertNotNull

public void assertNotNull(String assertID, Object actual)
Asserts that actual != null

Parameters: assertID identifier of assertion actual actual value

assertNull

public void assertNull(String assertID, Object actual)
Asserts that actual == null

Parameters: assertID identifier of assertion actual actual value

assertSame

public void assertSame(String assertID, Object expected, Object actual)
Asserts that actual and expected are the same object

Parameters: assertID identifier of assertion actual actual value

assertSize

public void assertSize(String assertID, int expectedSize, NodeList collection)
Asserts that the length of the collection is the expected size.

Parameters: assertID identifier of assertion expectedSize expected size collection collection

assertSize

public void assertSize(String assertID, int expectedSize, NamedNodeMap collection)
Asserts that the length of the collection is the expected size.

Parameters: assertID identifier of assertion expectedSize expected size collection collection

assertSize

public void assertSize(String assertID, int expectedSize, Collection collection)
Asserts that the length of the collection is the expected size.

Parameters: assertID identifier of assertion expectedSize expected size collection collection

assertTrue

public void assertTrue(String assertID, boolean actual)
Asserts that actual==true

Parameters: assertID identifier of assertion actual actual value

assertTrue

public void assertTrue(String assertID, Object actual)
Asserts that actual==true

Parameters: assertID identifier of assertion actual actual value

assertURIEquals

public void assertURIEquals(String assertID, String scheme, String path, String host, String file, String name, String query, String fragment, Boolean isAbsolute, String actual)
Asserts aspects of a URI

Parameters: assertID identifier of assertion scheme Expected scheme, for example, "file". If null, scheme is ignored. path Expected path, for example, "/DOM/Test". If null, path is ignored. host Expected host, for example, "www.w3.org". If null, host is ignored. file Expected file, for example, "staff.xml". If null, file is ignored. name Expected name, for example, "staff". If null, name is ignored. name Expected name, for example, "staff". If null, name is ignored. isAbsolute if Boolean.TRUE, URI must be absolute. Null indicates no assertion. actual URI to be tested.

doMain

public static void doMain(Class testClass, String[] args)
This method is called by the main() for each test and locates the appropriate test framework and runs the specified test

Parameters: testClass test class args arguments to test class

equals

public boolean equals(String expected, String actual)
Compares the values of actual and expected.

Parameters: expected expected actual actual

Returns: true if actual and expected are equal.

equals

public boolean equals(int expected, int actual)
Compares the values of actual and expected.

Parameters: expected expected actual actual

Returns: true if actual and expected are equal.

equals

public boolean equals(double expected, double actual)
Compares the values of actual and expected.

Parameters: expected expected actual actual

Returns: true if actual and expected are equal.

equals

public boolean equals(Collection expected, Collection actual)
Compares the values in actual and expected ignoring order.

Parameters: expected expected actual actual

Returns: true if actual and expected are equal.

equals

public boolean equals(List expected, List actual)
Compares the values in actual and expected.

Parameters: expected expected actual actual

Returns: true if actual and expected are equal.

equalsAutoCase

public boolean equalsAutoCase(String context, String expected, String actual)
Compares the value of actual and expected ignoring case.

Parameters: expected expected actual actual

Returns: true if actual and expected are equal ignoring case.

equalsAutoCase

public boolean equalsAutoCase(String context, Collection expected, Collection actual)
Compares the values in actual and expected ignoring case and order.

Parameters: expected expected actual actual

Returns: true if actual and expected are equal ignoring case.

equalsAutoCase

public boolean equalsAutoCase(String context, List expected, List actual)
Compares the values in actual and expected ignoring case.

Parameters: expected expected actual actual

Returns: true if actual and expected are equal ignoring case.

equalsIgnoreCase

public boolean equalsIgnoreCase(String expected, String actual)
Compares the value of actual and expected ignoring case.

Parameters: expected expected actual actual

Returns: true if actual and expected are equal ignoring case.

equalsIgnoreCase

public boolean equalsIgnoreCase(Collection expected, Collection actual)
Compares the values in actual and expected ignoring case and order.

Parameters: expected expected actual actual

Returns: true if actual and expected are equal ignoring case.

equalsIgnoreCase

public boolean equalsIgnoreCase(List expected, List actual)
Compares the values in actual and expected ignoring case.

Parameters: expected expected actual actual

Returns: true if actual and expected are equal ignoring case.

fail

public void fail(String assertID)
Fail test

Parameters: assertID identifier of assertion

runTest

public abstract void runTest()
Body of test

Throws: Throwable

same

public boolean same(Object expected, Object actual)
Compares the identity of actual and expected.

Parameters: expected expected actual actual

Returns: true if actual and expected are the same object.

setFramework

public void setFramework(DOMTestFramework framework)
Sets test framework to be used by test.

Parameters: framework

size

public int size(Collection collection)
Gets the size of the collection

Parameters: collection collection, may not be null.

Returns: size of collection

size

public int size(NamedNodeMap collection)
Gets the size of the collection

Parameters: collection collection, may not be null.

Returns: size of collection

size

public int size(NodeList collection)
Gets the size of the collection

Parameters: collection collection, may not be null.

Returns: size of collection

wait

public void wait(int millisecond)
Wait

Parameters: millisecond milliseconds to wait