You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apex.apache.org by th...@apache.org on 2015/11/12 04:23:17 UTC

[22/22] incubator-apex-malhar git commit: Using DataTorrent rss feed for test, #comment MLHR-1899

Using DataTorrent rss feed for test, #comment MLHR-1899


Project: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/commit/90d5774f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/tree/90d5774f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/diff/90d5774f

Branch: refs/heads/devel-3
Commit: 90d5774ff0b9f50b0d7198dcbaa3463d270f7f52
Parents: 5325bf8
Author: Pramod Immaneni <pr...@datatorrent.com>
Authored: Wed Nov 11 16:26:10 2015 -0800
Committer: Thomas Weise <th...@datatorrent.com>
Committed: Wed Nov 11 18:16:03 2015 -0800

----------------------------------------------------------------------
 .../RomeSyndicationOperatorTest.java            |   32 +-
 .../romesyndication/datatorrent_feed.rss        |  894 ++++++++++++++
 .../datatorrent_feed_updated.rss                | 1134 ++++++++++++++++++
 3 files changed, 2043 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/90d5774f/contrib/src/test/java/com/datatorrent/contrib/romesyndication/RomeSyndicationOperatorTest.java
----------------------------------------------------------------------
diff --git a/contrib/src/test/java/com/datatorrent/contrib/romesyndication/RomeSyndicationOperatorTest.java b/contrib/src/test/java/com/datatorrent/contrib/romesyndication/RomeSyndicationOperatorTest.java
index 7dde42b..6701908 100644
--- a/contrib/src/test/java/com/datatorrent/contrib/romesyndication/RomeSyndicationOperatorTest.java
+++ b/contrib/src/test/java/com/datatorrent/contrib/romesyndication/RomeSyndicationOperatorTest.java
@@ -18,17 +18,10 @@
  */
 package com.datatorrent.contrib.romesyndication;
 
-import com.datatorrent.contrib.romesyndication.RomeFeedEntry;
-import com.datatorrent.contrib.romesyndication.RomeStreamProvider;
-import com.datatorrent.contrib.romesyndication.RomeSyndicationOperator;
-import com.datatorrent.common.util.BaseOperator;
 import com.datatorrent.api.DAG;
 import com.datatorrent.api.DefaultInputPort;
 import com.datatorrent.api.LocalMode;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
+import com.datatorrent.common.util.BaseOperator;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Assert;
@@ -38,6 +31,11 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  *
  */
@@ -101,11 +99,11 @@ public class RomeSyndicationOperatorTest
     {
       InputStream is;
       if (index == 0) {
-        is = getClass().getResourceAsStream("/com/datatorrent/contrib/romesyndication/cnn_topstories.rss");
+        is = getClass().getResourceAsStream("/com/datatorrent/contrib/romesyndication/datatorrent_feed.rss");
         ++index;
       }
       else {
-        is = getClass().getResourceAsStream("/com/datatorrent/contrib/romesyndication/cnn_topstories_updated.rss");
+        is = getClass().getResourceAsStream("/com/datatorrent/contrib/romesyndication/datatorrent_feed_updated.rss");
       }
       return is;
     }
@@ -132,16 +130,16 @@ public class RomeSyndicationOperatorTest
       LocalMode.Controller lc = lma.getController();
       lc.setHeartbeatMonitoringEnabled(false);
       lc.run(10000);
-      Assert.assertEquals("Entries size", entries.size(), 81);
+      Assert.assertEquals("Entries size", entries.size(), 10);
       // Check first entry
-      Assert.assertEquals("First entry title", entries.get(0).getSyndEntry().getTitle(), "Our favorite surprise homecomings");
-      Assert.assertEquals("First entry URI", entries.get(0).getSyndEntry().getUri(), "http://www.cnn.com/video/#/video/us/2012/09/21/soldier-surprises-daughter-maine.wabi");
+      Assert.assertEquals("First entry title", entries.get(0).getSyndEntry().getTitle(), "Dimensions Computation (Aggregate Navigator) Part 1: Intro");
+      Assert.assertEquals("First entry URI", entries.get(0).getSyndEntry().getUri(), "https://www.datatorrent.com/?p=2399");
       // Check first entry from second run
-      Assert.assertEquals("Second run first entry title", entries.get(74).getSyndEntry().getTitle(), "Watch chimney deliver the news");
-      Assert.assertEquals("Second run first entry URI", entries.get(74).getSyndEntry().getUri(), "http://www.cnn.com/video/#/video/world/2013/03/13/nr-white-smoke-means-new-pope.cnn");
+      Assert.assertEquals("Second run first entry title", entries.get(7).getSyndEntry().getTitle(), "Building Applications with Apache Apex and Malhar");
+      Assert.assertEquals("Second run first entry URI", entries.get(7).getSyndEntry().getUri(), "https://www.datatorrent.com/?p=2054");
       // Check last entry
-      Assert.assertEquals("Last entry title", entries.get(80).getSyndEntry().getTitle(), "How the smoke process works");
-      Assert.assertEquals("Last entry URI", entries.get(80).getSyndEntry().getUri(), "http://www.cnn.com/2013/03/12/world/europe/vatican-chapel-stove/index.html");
+      Assert.assertEquals("Last entry title", entries.get(9).getSyndEntry().getTitle(), "Dimensions Computation (Aggregate Navigator) Part 2: Implementation");
+      Assert.assertEquals("Last entry URI", entries.get(9).getSyndEntry().getUri(), "https://www.datatorrent.com/?p=2401");
     }
     catch (Exception ex) {
       logger.error(ex.getMessage());