[jdom-interest] Failing tests

Philip Nelson panmanphil at yahoo.com
Sun Apr 7 13:23:32 PDT 2002


I needed to wipe out the original jdom src directory for this to show up, even
though I got the latest this morning.  Anyway, I can verify what you're seeing.
 I am preparing an update for the test suite now.


<NeedThisOffMyChest>
I am glad you caught this.  I think that of the major code contributors, only a
couple regularly run the tests.  Now I have to assume that everybody tests
their code before they commit it.  So, does everybody write their own code from
scratch to test it?  I guess what I am getting at is that if you just put your
test code into a junit test, we could all benefit, and I would assume then
everybody would regularly run the test suite.  Even if I had unlimited amounts
of time for JDOM, which I don't, the chances of me coming back later and
writing a test that fully excercises the subtle nuances of the code you just
changed or added is slim.
</NeedThisOffMyChest>

besides, it is so amazingly easy to code tests.  If you are unsure of where to
put the test, just create your own test suite class, copied from one of the
existing classes.  Put the source in the src/java/org/jdom/test/cases directory
and build.  Then run build test and it will be run.  Then when the code is
released, we can either add the whole class to the test suite or put the
methods in appropriate existing classes as needed.

Right now I am trying to convince ant and junit that it's ok to use different
xml parsers and different jdom jar files.  I should be done with that soon. 
Then I am going to try and add in the Canonicalizer from the XML Security suite
that should make certain types of testing much easier by allowing document
comparisons with document produced by jdom and non jdom code.

FWIW, there is an additional subtle bug running the testui from the build file.
 You must uncheck the reload every time checkbox or you get ClassCast problems
because JUnit has it's own class loader but the xml classes are loaded by the
java class loader.  I don't there there is a way around that since ant requires
a parser to load.


--- Elliotte Rusty Harold <elharo at metalab.unc.edu> wrote:
> I found one problem in the FilterListRandomizer class where OurCDATA 
> setParent() returns CDATA instead of Text. This prevents the tests 
> from compiling fully. This appears to have been the cause of all the 
> breakages except in XMLOutputter. If you don't have the most recent 
> CVS you probably won't see this. To fix this, just change
> 
> 
> 
> 		public CDATA setParent(Element parent)
> 		{
> 			return super.setParent(parent);
> 		}
> 
> to
> 
> 
> 
> 		public Text setParent(Element parent)
> 		{
> 			return super.setParent(parent);
> 		}
> 
> -- 
> 
> +-----------------------+------------------------+-------------------+
> | Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
> +-----------------------+------------------------+-------------------+
> |          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
> |             http://www.cafeconleche.org/books/bible2/              |
> |   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
> +----------------------------------+---------------------------------+
> |  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
> |  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
> +----------------------------------+---------------------------------+


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/



More information about the jdom-interest mailing list