From 1ad9401c3f0c9ebc63546fb9e6905110a474a9dd Mon Sep 17 00:00:00 2001
From: Trygve Laugstøl <trygvis@inamo.no>
Date: Thu, 6 Dec 2012 15:46:12 +0100
Subject: o Sucking in all new events. Stops as soon as it has fetched an
 entire page with only old events.

---
 .../esper/testing/nexus/TestXmlParsing.java        | 47 +++++++++++-----------
 1 file changed, 23 insertions(+), 24 deletions(-)

(limited to 'src/test')

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());
         }
-- 
cgit v1.2.3