[jdom-interest] Current test suite failures[eg]

philip.nelson at omniresources.com philip.nelson at omniresources.com
Sun Apr 15 20:39:59 PDT 2001


Here are the current failures in the test suite code I uploaded to cvs
today.  A little explanation is in order.  

First, TCU stands for Test Case for a Use case , TCM for a test case for a
method.  The order of terms is return value type, method under test, (test
case class), followed by a string I put in the test to indicate what the
failure is.  These point you to the class and method where the test came
from and what was tested.

So far these tests cover Comment, Verifier, Attribute, Namespace, DocType
and Element.  Document is nearly complete but I didn't include that test
output yet.  These are all run together in the Alltests class, but the build
test runs some additional tests that are not complete yet.

There were 14 failures:
1)
test_TCM__String_checkNamespaceURI_String(org.jdom.test.cases.TestVerifier)
"validated invalid URI with null"
2) test_TCU__testDefaultNamespaces(org.jdom.test.cases.TestElement) "allowed
multiple default namespaces for element"

There are already TODO items for these

3)
test_TCM__OrgJdomElement_addContent_OrgJdomComment(org.jdom.test.cases.TestE
lement) "NullPointer  Exception"
4)
test_TCM__OrgJdomElement_setChildren_List(org.jdom.test.cases.TestElement)
"didn't catch null children List"
5)
test_TCM__OrgJdomElement_addContent_OrgJdomElement(org.jdom.test.cases.TestE
lement) "NullPointer  Exception"
6)
test_TCM__OrgJdomElement_addContent_OrgJdomProcessingInstruction(org.jdom.te
st.cases.TestElement) "NullPointer  Exception"
7)
test_TCM__OrgJdomElement_addContent_OrgJdomEntity(org.jdom.test.cases.TestEl
ement) "NullPointer  Exception"
8)
test_TCM__OrgJdomElement_addContent_String(org.jdom.test.cases.TestElement)
"didn't catch null String"
9) test_TCM__OrgJdomElement_setText_String(org.jdom.test.cases.TestElement)
"didn't catch null text"
10)
test_TCM__OrgJdomElement_setMixedContent_List(org.jdom.test.cases.TestElemen
t) "didn't catch null mixed content List"
11)
test_TCM__OrgJdomElement_addAttribute_OrgJdomAttribute(org.jdom.test.cases.T
estElement) "Null Pointer exception"
13)
test_TCM__OrgJdomElement_addContent_OrgJdomCDATA(org.jdom.test.cases.TestEle
ment) "didn't catch null CDATA element"
14)
test_TCM__OrgJdomElement_setAttributes_List(org.jdom.test.cases.TestElement)
"didn't catch bad data in list"

These are all various flavors of not handling nulls passed to the add or set
methods.  In some cases nulls are checked, in some not.  Sometimes there is
no failure at all (until you output anyway).  Sometimes there is an NPE.  I
think we need to define this behaviour and then code it.  Here is what I
suggest.

1 - All add methods should check for nulls and throw an IllegalAddException
if found.
2 - All set<List> methods like should assume that null means the same as
Collections.EMPTY_LIST and do that, though I imagine that is debatable.
3 - A set for a scalar value should fail with an IllegalArgumentException

12) test_TCM__Object_clone(org.jdom.test.cases.TestElement) "deep clone
CDATA not a clone"

This is new after the the last update I got from CVS.  The test is failing
because the clone and orginal share the same hashcode which was not the case
before.  Perhaps this OK since the text is immutable but I would have
thought that object.clone would have returned a different hashcode value for
the clone.

FAILURES!!!
Tests run: 132,  Failures: 14,  Errors: 0



More information about the jdom-interest mailing list