public abstract class DOMTestCase extends DOMTest
Constructor and Description |
---|
DOMTestCase()
This constructor is for DOMTestCase's that make specific demands for
parser configuration.
|
DOMTestCase(DOMTestDocumentBuilderFactory factory)
This constructor is for DOMTestCase's that do not add any requirements
for parser configuration.
|
Modifier and Type | Method and Description |
---|---|
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.
|
void |
assertEquals(String assertID,
boolean expected,
boolean actual)
Asserts that values of expected and actual are equal.
|
void |
assertEquals(String assertID,
Collection expected,
Collection actual)
Asserts that each entry in actual exactly matches with an entry in
expected.
|
void |
assertEquals(String assertID,
Collection expected,
NodeList actual)
Asserts that each entry in actual exactly matches with an entry in
expected.
|
void |
assertEquals(String assertID,
double expected,
double actual)
Asserts that values of expected and actual are equal.
|
void |
assertEquals(String assertID,
int expected,
int actual)
Asserts that values of expected and actual are equal.
|
void |
assertEquals(String assertID,
String expected,
String actual)
Asserts that expected.equals(actual) is true
|
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.
|
void |
assertEqualsAutoCase(String context,
String assertID,
String expected,
String actual)
Asserts that expected.equalsIgnoreCase(actual) is true
|
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.
|
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.
|
void |
assertEqualsIgnoreCase(String assertID,
String expected,
String actual)
Asserts that expected.equalsIgnoreCase(actual) is true
|
void |
assertFalse(String assertID,
boolean actual)
Asserts that actual==false
|
void |
assertFalse(String assertID,
Object actual)
Asserts that actual==false
|
void |
assertInstanceOf(String assertID,
Class cls,
Object obj)
Asserts that obj is an instance of cls
|
void |
assertNotEquals(String assertID,
double expected,
double actual)
Asserts that values of expected and actual are not equal.
|
void |
assertNotEquals(String assertID,
int expected,
int actual)
Asserts that values of expected and actual are not equal.
|
void |
assertNotEquals(String assertID,
String expected,
String actual)
Asserts that values of expected and actual are not equal.
|
void |
assertNotEqualsAutoCase(String context,
String assertID,
String expected,
String actual)
Asserts that expected.equalsIgnoreCase(actual) is false
|
void |
assertNotEqualsIgnoreCase(String assertID,
String expected,
String actual)
Asserts that expected.equalsIgnoreCase(actual) is false
|
void |
assertNotNull(String assertID,
Object actual)
Asserts that actual != null
|
void |
assertNull(String assertID,
Object actual)
Asserts that actual == null
|
void |
assertSame(String assertID,
Object expected,
Object actual)
Asserts that actual and expected are the same object
|
void |
assertSize(String assertID,
int expectedSize,
Collection collection)
Asserts that the length of the collection is the expected size.
|
void |
assertSize(String assertID,
int expectedSize,
NamedNodeMap collection)
Asserts that the length of the collection is the expected size.
|
void |
assertSize(String assertID,
int expectedSize,
NodeList collection)
Asserts that the length of the collection is the expected size.
|
void |
assertTrue(String assertID,
boolean actual)
Asserts that actual==true
|
void |
assertTrue(String assertID,
Object actual)
Asserts that actual==true
|
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
|
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
|
boolean |
equals(Collection expected,
Collection actual)
Compares the values in actual and expected ignoring order.
|
boolean |
equals(double expected,
double actual)
Compares the values of actual and expected.
|
boolean |
equals(int expected,
int actual)
Compares the values of actual and expected.
|
boolean |
equals(List expected,
List actual)
Compares the values in actual and expected.
|
boolean |
equals(String expected,
String actual)
Compares the values of actual and expected.
|
boolean |
equalsAutoCase(String context,
Collection expected,
Collection actual)
Compares the values in actual and expected ignoring case and order.
|
boolean |
equalsAutoCase(String context,
List expected,
List actual)
Compares the values in actual and expected ignoring case.
|
boolean |
equalsAutoCase(String context,
String expected,
String actual)
Compares the value of actual and expected ignoring case.
|
boolean |
equalsIgnoreCase(Collection expected,
Collection actual)
Compares the values in actual and expected ignoring case and order.
|
boolean |
equalsIgnoreCase(List expected,
List actual)
Compares the values in actual and expected ignoring case.
|
boolean |
equalsIgnoreCase(String expected,
String actual)
Compares the value of actual and expected ignoring case.
|
void |
fail(String assertID)
Fail test
|
abstract void |
runTest()
Body of test
|
boolean |
same(Object expected,
Object actual)
Compares the identity of actual and expected.
|
void |
setFramework(DOMTestFramework framework)
Sets test framework to be used by test.
|
int |
size(Collection collection)
Gets the size of the collection
|
int |
size(NamedNodeMap collection)
Gets the size of the collection
|
int |
size(NodeList collection)
Gets the size of the collection
|
void |
wait(int millisecond)
Wait
|
createStream, createTempURI, createXPathEvaluator, getContentType, getFactory, getImplementation, getMutationCount, getResourceURI, getTargetURI, hasFeature, hasSetting, isCoalescing, isExpandEntityReferences, isHasNullString, isIgnoringElementContentWhitespace, isNamespaceAware, isSigned, isValidating, load, preload, setFactory
public DOMTestCase()
public DOMTestCase(DOMTestDocumentBuilderFactory factory)
factory
- document factory to be used by test, may not be null.public static void doMain(Class testClass, String[] args)
testClass
- test classargs
- arguments to test classpublic void setFramework(DOMTestFramework framework)
framework
- public void wait(int millisecond)
millisecond
- milliseconds to waitpublic void fail(String assertID)
assertID
- identifier of assertionpublic void assertTrue(String assertID, boolean actual)
assertID
- identifier of assertionactual
- actual valuepublic void assertTrue(String assertID, Object actual)
assertID
- identifier of assertionactual
- actual valuepublic void assertFalse(String assertID, boolean actual)
assertID
- identifier of assertionactual
- actual valuepublic void assertFalse(String assertID, Object actual)
assertID
- identifier of assertionactual
- actual valuepublic void assertNull(String assertID, Object actual)
assertID
- identifier of assertionactual
- actual valuepublic void assertNotNull(String assertID, Object actual)
assertID
- identifier of assertionactual
- actual valuepublic void assertSame(String assertID, Object expected, Object actual)
assertID
- identifier of assertionactual
- actual valuepublic void assertInstanceOf(String assertID, Class cls, Object obj)
assertID
- identifier of assertionobj
- objectcls
- class, may not be null.public void assertSize(String assertID, int expectedSize, NodeList collection)
assertID
- identifier of assertionexpectedSize
- expected sizecollection
- collectionpublic void assertSize(String assertID, int expectedSize, NamedNodeMap collection)
assertID
- identifier of assertionexpectedSize
- expected sizecollection
- collectionpublic void assertSize(String assertID, int expectedSize, Collection collection)
assertID
- identifier of assertionexpectedSize
- expected sizecollection
- collectionpublic void assertEqualsIgnoreCase(String assertID, String expected, String actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertEqualsIgnoreCase(String assertID, Collection expected, Collection actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertEqualsIgnoreCase(String assertID, List expected, List actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertEqualsAutoCase(String context, String assertID, String expected, String actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertEqualAutoCase(String context, String assertID, Collection expected, Collection actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertEqualsAutoCase(String context, String assertID, List expected, List actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertEquals(String assertID, String expected, String actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertEquals(String assertID, int expected, int actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertEquals(String assertID, double expected, double actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertEquals(String assertID, boolean expected, boolean actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertEquals(String assertID, Collection expected, NodeList actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertEquals(String assertID, Collection expected, Collection actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertNotEqualsIgnoreCase(String assertID, String expected, String actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertNotEqualsAutoCase(String context, String assertID, String expected, String actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertNotEquals(String assertID, String expected, String actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertNotEquals(String assertID, int expected, int actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertNotEquals(String assertID, double expected, double actual)
assertID
- identifier of assertionactual
- actual valueexpected
- Expected value, may not be null.public void assertURIEquals(String assertID, String scheme, String path, String host, String file, String name, String query, String fragment, Boolean isAbsolute, String actual)
assertID
- identifier of assertionscheme
- 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.public boolean same(Object expected, Object actual)
expected
- expectedactual
- actualpublic boolean equalsIgnoreCase(String expected, String actual)
expected
- expectedactual
- actualpublic boolean equalsIgnoreCase(Collection expected, Collection actual)
expected
- expectedactual
- actualpublic boolean equalsIgnoreCase(List expected, List actual)
expected
- expectedactual
- actualpublic boolean equalsAutoCase(String context, String expected, String actual)
expected
- expectedactual
- actualpublic boolean equalsAutoCase(String context, Collection expected, Collection actual)
expected
- expectedactual
- actualpublic boolean equalsAutoCase(String context, List expected, List actual)
expected
- expectedactual
- actualpublic boolean equals(String expected, String actual)
expected
- expectedactual
- actualpublic boolean equals(int expected, int actual)
expected
- expectedactual
- actualpublic boolean equals(double expected, double actual)
expected
- expectedactual
- actualpublic boolean equals(Collection expected, Collection actual)
expected
- expectedactual
- actualpublic boolean equals(List expected, List actual)
expected
- expectedactual
- actualpublic int size(Collection collection)
collection
- collection, may not be null.public int size(NamedNodeMap collection)
collection
- collection, may not be null.public int size(NodeList collection)
collection
- collection, may not be null.