diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-11-08 13:20:47 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-11-08 13:20:47 +0100 |
commit | d6a532c420a93b211a9747c5fb807a3f2767fa22 (patch) | |
tree | 572bc13c87a726cbc7132043cc1d10af795f442b /src/test/java/io/trygvis/esper | |
parent | ff34cdc13bc8ba0943cded8009b9869a455894f6 (diff) | |
download | esper-testing-d6a532c420a93b211a9747c5fb807a3f2767fa22.tar.gz esper-testing-d6a532c420a93b211a9747c5fb807a3f2767fa22.tar.bz2 esper-testing-d6a532c420a93b211a9747c5fb807a3f2767fa22.tar.xz esper-testing-d6a532c420a93b211a9747c5fb807a3f2767fa22.zip |
o Slurping down the entire list of projects.
Diffstat (limited to 'src/test/java/io/trygvis/esper')
-rw-r--r-- | src/test/java/io/trygvis/esper/testing/gitorious/TestXmlParsing.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/java/io/trygvis/esper/testing/gitorious/TestXmlParsing.java b/src/test/java/io/trygvis/esper/testing/gitorious/TestXmlParsing.java new file mode 100644 index 0000000..63ae319 --- /dev/null +++ b/src/test/java/io/trygvis/esper/testing/gitorious/TestXmlParsing.java @@ -0,0 +1,24 @@ +package io.trygvis.esper.testing.gitorious; + +import junit.framework.*; +import org.dom4j.*; + +import java.io.*; +import java.util.*; + +public class TestXmlParsing extends TestCase { + public void testProjectParsing() throws Exception { + try (InputStream stream = getClass().getResourceAsStream("/gitorious/projects-2.xml")) { + Document document = GitoriousClient.xmlReader.readDocument(stream); + + List<GitoriousProject> projects = GitoriousProject.projectsFromXml("http://gitorious.org", document.getRootElement()); + + assertNotNull(projects); + assertEquals(20, projects.size()); + + GitoriousProject project = projects.get(3); + assertEquals("aed-ii", project.slug); + assertEquals(2, project.repositories.size()); + } + } +} |