You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/03/10 13:32:22 UTC

incubator-tinkerpop git commit: Add unit test for IteratorUtils.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 95666275c -> c94ca2e81


Add unit test for IteratorUtils.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/c94ca2e8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/c94ca2e8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/c94ca2e8

Branch: refs/heads/master
Commit: c94ca2e81452eeb16b86ef8501f90652f535a995
Parents: 9566627
Author: Stephen Mallette <sp...@apache.org>
Authored: Tue Mar 10 08:32:02 2015 -0400
Committer: Stephen Mallette <sp...@apache.org>
Committed: Tue Mar 10 08:32:02 2015 -0400

----------------------------------------------------------------------
 .../util/iterator/IteratorUtilsTest.java        | 28 ++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c94ca2e8/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtilsTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtilsTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtilsTest.java
new file mode 100644
index 0000000..884e124
--- /dev/null
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtilsTest.java
@@ -0,0 +1,28 @@
+package org.apache.tinkerpop.gremlin.util.iterator;
+
+import org.junit.Test;
+
+import java.util.Iterator;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class IteratorUtilsTest {
+    @Test
+    public void shouldIterateSingleObject() {
+        final Iterator<String> itty = IteratorUtils.of("test");
+        assertEquals("test", itty.next());
+        assertFalse(itty.hasNext());
+    }
+
+    @Test
+    public void shouldIteratePairOfObjects() {
+        final Iterator<String> itty = IteratorUtils.of("test1", "test2");
+        assertEquals("test1", itty.next());
+        assertEquals("test2", itty.next());
+        assertFalse(itty.hasNext());
+    }
+}