You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by Garrett Rooney <ro...@electricjellyfish.net> on 2006/06/23 00:52:31 UTC
[PATCH] Refactor parser tests
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
operations.
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.
-garrett
[[[
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
URI.
* 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.
]]]
Re: [PATCH] Refactor parser tests
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 6/22/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> [[[
> 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
> URI.
>
> * 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.
> ]]]
Oops, forgot the change to build.xml. This log should also include:
* build/build.xml
(compile.parser): Copy all the contents of the resource directory.
-garrett