aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-12-05 13:09:49 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2012-12-07 20:06:53 +0100
commit1c2c16858e95db9ae90726fa0da69b88457c1807 (patch)
treedca86c80f715281bf39388de2a42fdba9e0ceef7 /src/test/java
parent6d1dc3b1ca077312674ef05cd88ca5a7858bffd2 (diff)
downloadesper-testing-1c2c16858e95db9ae90726fa0da69b88457c1807.tar.gz
esper-testing-1c2c16858e95db9ae90726fa0da69b88457c1807.tar.bz2
esper-testing-1c2c16858e95db9ae90726fa0da69b88457c1807.tar.xz
esper-testing-1c2c16858e95db9ae90726fa0da69b88457c1807.zip
o More common XML parsing and HTTP client code. o Reimplemented the Nexus code to consume the timeline instead of calculating its own diff.
Diffstat (limited to 'src/test/java')
-rwxr-xr-xsrc/test/java/io/trygvis/esper/testing/nexus/TestXmlParsing.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/java/io/trygvis/esper/testing/nexus/TestXmlParsing.java b/src/test/java/io/trygvis/esper/testing/nexus/TestXmlParsing.java
index 6495d86..038de34 100755
--- a/src/test/java/io/trygvis/esper/testing/nexus/TestXmlParsing.java
+++ b/src/test/java/io/trygvis/esper/testing/nexus/TestXmlParsing.java
@@ -3,7 +3,9 @@ package io.trygvis.esper.testing.nexus;
import static com.google.common.collect.Iterables.*;
import static com.google.common.collect.Lists.*;
import static io.trygvis.esper.testing.nexus.ArtifactXml.repositoryFilter;
+import io.trygvis.esper.testing.util.*;
import junit.framework.*;
+import org.jdom2.*;
import java.io.*;
import java.util.*;
@@ -44,4 +46,21 @@ public class TestXmlParsing extends TestCase {
assertEquals(2, flatArtifact.files.size());
}
}
+
+ public void testTimelineParsing() throws Exception {
+ XmlParser parser = new XmlParser();
+
+ try (InputStream stream = getClass().getResourceAsStream("/nexus/recentlyDeployedArtifacts.xml")) {
+ Document document = parser.parseDocument(stream).some();
+
+ NexusEvent event = NexusFeedParser.parseEvent(document.getRootElement().getChild("channel").getChild("item")).some();
+
+ assertTrue(event instanceof NewSnapshotEvent);
+ NewSnapshotEvent nse = (NewSnapshotEvent) event;
+ assertEquals("org.example", nse.artifactId.groupId);
+ assertEquals("example", nse.artifactId.artifactId);
+ assertEquals("1.0-SNAPSHOT", nse.artifactId.version);
+ assertEquals("20121204.122640-536", nse.snapshotTimestamp);
+ }
+ }
}