changeset 8086:283f3f84d229

Ensure code for parallel evaluation and nulls gets covered by tests.
author psandoz
date Thu, 11 Apr 2013 15:59:55 +0200
parents 706617f66a64
children a3a9bb95a904
files test-ng/bootlib/java/util/stream/StreamTestDataProvider.java test-ng/tests/org/openjdk/tests/java/util/stream/DistinctOpTest.java
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test-ng/bootlib/java/util/stream/StreamTestDataProvider.java	Thu Apr 11 15:11:49 2013 +0200
+++ b/test-ng/bootlib/java/util/stream/StreamTestDataProvider.java	Thu Apr 11 15:59:55 2013 +0200
@@ -125,7 +125,7 @@
 
                 // ORDERED
                 list.add(arrayDataDescr("array:" + i, content));
-                // not ORDERED
+                // not ORDERED, DISTINCT
                 list.add(collectionDataDescr("HashSet:" + i, new HashSet<>(Arrays.asList(content))));
             }
 
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/DistinctOpTest.java	Thu Apr 11 15:11:49 2013 +0200
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/DistinctOpTest.java	Thu Apr 11 15:59:55 2013 +0200
@@ -70,6 +70,12 @@
         Collection<Integer> node = exerciseOps(data, s -> s.distinct());
         assertUnique(node);
 
+        node = withData(data).
+                stream(s -> s.unordered().distinct()).
+                parallelEqualityAsserter(LambdaTestHelpers::assertContentsUnordered).
+                exercise();
+        assertUnique(node);
+
         node = exerciseOps(data, s -> s.distinct().distinct());
         assertUnique(node);
     }