aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/io/trygvis
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-12-06 15:46:12 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2012-12-07 20:07:00 +0100
commit1ad9401c3f0c9ebc63546fb9e6905110a474a9dd (patch)
treef63889309b3d9fbcfc6108340f352e0c8fce664c /src/test/java/io/trygvis
parent8ac0faa2b83dde165d45ab62c932ba0f26f42e54 (diff)
downloadesper-testing-1ad9401c3f0c9ebc63546fb9e6905110a474a9dd.tar.gz
esper-testing-1ad9401c3f0c9ebc63546fb9e6905110a474a9dd.tar.bz2
esper-testing-1ad9401c3f0c9ebc63546fb9e6905110a474a9dd.tar.xz
esper-testing-1ad9401c3f0c9ebc63546fb9e6905110a474a9dd.zip
o Sucking in all new events. Stops as soon as it has fetched an entire page with only old events.
Diffstat (limited to 'src/test/java/io/trygvis')
-rwxr-xr-xsrc/test/java/io/trygvis/esper/testing/nexus/TestXmlParsing.java47
1 files changed, 23 insertions, 24 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 8382fd3..97c3946 100755
--- a/src/test/java/io/trygvis/esper/testing/nexus/TestXmlParsing.java
+++ b/src/test/java/io/trygvis/esper/testing/nexus/TestXmlParsing.java
@@ -55,30 +55,29 @@ public class TestXmlParsing extends TestCase {
List<Element> items = document.getRootElement().getChild("channel").getChildren("item");
- NexusEvent event = NexusFeedParser.parseEvent(items.get(0)).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", nse.snapshotTimestamp);
- assertEquals("536", nse.buildNumber);
-
- event = NexusFeedParser.parseEvent(items.get(1)).some();
- assertTrue(event instanceof 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", nse.snapshotTimestamp);
- assertEquals("536", nse.buildNumber);
-
- event = NexusFeedParser.parseEvent(items.get(2)).some();
- assertTrue(event instanceof NewReleaseEvent);
- NewReleaseEvent nre = (NewReleaseEvent) event;
- assertEquals("org.example", nre.artifactId.groupId);
- assertEquals("example", nre.artifactId.artifactId);
- assertEquals("1.10", nre.artifactId.version);
+ NewSnapshotEvent e = (NewSnapshotEvent) NexusFeedParser.parseEvent(items.get(0)).some();
+ NexusEvent event = e.event;
+ assertEquals("2012-12-04T13:26:40.000+01:00", event.date.toString());
+ assertEquals("developer", event.creator);
+ assertEquals("org.example", event.artifactId.groupId);
+ assertEquals("example", event.artifactId.artifactId);
+ assertEquals("1.0-SNAPSHOT", event.artifactId.version);
+ assertEquals("2012-12-04 12:26:40", e.snapshotTimestamp.toString("yyyy-MM-dd hh:mm:ss"));
+ assertEquals(536, e.buildNumber);
+
+ e = (NewSnapshotEvent) NexusFeedParser.parseEvent(items.get(1)).some();
+ event = e.event;
+ assertEquals("org.example", event.artifactId.groupId);
+ assertEquals("example", event.artifactId.artifactId);
+ assertEquals("1.0-SNAPSHOT", event.artifactId.version);
+ assertEquals("2012-12-04 12:26:40", e.snapshotTimestamp.toString("yyyy-MM-dd hh:mm:ss"));
+ assertEquals(536, e.buildNumber);
+
+ NewReleaseEvent nre = (NewReleaseEvent) NexusFeedParser.parseEvent(items.get(2)).some();
+ event = nre.event;
+ assertEquals("org.example", event.artifactId.groupId);
+ assertEquals("example", event.artifactId.artifactId);
+ assertEquals("1.10", event.artifactId.version);
assertEquals(3, items.size());
}