Methods Summary |
---|
protected void | setUp()
super.setUp();
try {
factory = new DOMDocumentBuilderFactory(DOMDocumentBuilderFactory
.getConfiguration1());
builder = factory.getBuilder();
} catch (Exception e) {
fail("Unexpected exception" + e.getMessage());
}
|
protected void | tearDown()
factory = null;
builder = null;
super.tearDown();
|
public void | testHasAttribute1()Runs the test case.
Document doc;
Element element;
boolean state;
doc = (Document) load("staff", builder);
element = doc.getDocumentElement();
state = element.hasAttribute("");
assertFalse("elementhasattribute01", state);
|
public void | testHasAttribute3()
Document doc;
Element element;
boolean state;
Attr attribute;
doc = (Document) load("staff", builder);
element = doc.createElement("address");
attribute = doc.createAttribute("domestic");
state = element.hasAttribute("domestic");
assertFalse("elementhasattribute03_False", state);
element.setAttributeNode(attribute);
state = element.hasAttribute("domestic");
assertTrue("elementhasattribute03_True", state);
|
public void | testHasAttribute4()
Document doc;
Element element;
boolean state;
Attr attribute;
doc = (Document) load("staff", builder);
element = doc.createElement("address");
attribute = doc.createAttribute("domestic");
element.setAttributeNode(attribute);
state = element.hasAttribute("domestic");
assertTrue("elementhasattribute04", state);
|