abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Rooney" <roo...@electricjellyfish.net>
Subject [PATCH] Refactor parser tests
Date Thu, 22 Jun 2006 22:52:31 GMT
This change moves the code for reading xml files off of disk into a
common base class for the parser tests, and makes the
AtomConformanceTest and FeedParserTest use the new base class.

Note that for this to work, you also need to rename some of the
resources in parser/src/test/resources, they now need to live in
directories that match the name of their original home on the net.

For example, the files that currently live in resources/conformance
are really from www.snellspace.com/public, so they get moved to
resources/www.snellspace.com/public.  Similarly, the ones in
resources/feedparser get moved to
resources/www.feedparser.org/tests/welformed/atom10.  I didn't include
this in the diff because if you apply that sort of patch it'll give
you the removal but not the add, since diffs don't hold rename

There's also a follow up patch for this that does the same stuff for
the feed validator tests, but well, it's really huge, so I split it
out, and I'm also waiting on some license questions from the feed
validator guys.


Move code for reading xml files off of disk into a common base class.

[ in parser/src/java/org/apache/abdera/test/parser/stax ]

* BaseParserTestCase.java: New file.

* AtomConformanceTest.java
  Extend BaseParserTestCase.
  (parse): Removed.
  (testContentTypes, testOrder, testLink): Don't call .toString() on our

* FeedParserTest.java
  Extend BaseParserTestCase.
  (parse): Removed.
  (baseURI): New member.
  (setUp): New method, initializes baseURI.
  (testAtom10Namespace, testEntryAuthorEmail, testEntryAuthorName,
   testEntryContentBase64, testEntryContentBase642): Use our baseURI to
   resolve the actual URI, and pass it to parse.

View raw message