changeset 7610:34e0d5420ce9

Cut off execution time for java/util/stream/Streams/BasicTest.java
author Tristan Yan <tristan.yan@oracle.com>
date Tue, 12 Mar 2013 13:26:46 +0800
parents 88776f695148
children cfc1cdcbd8b5
files test/java/util/stream/Streams/BasicTest.java
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/util/stream/Streams/BasicTest.java	Mon Mar 11 22:20:29 2013 -0400
+++ b/test/java/util/stream/Streams/BasicTest.java	Tue Mar 12 13:26:46 2013 +0800
@@ -73,7 +73,7 @@
     @Test
     public void testGenerate() {
         final int randomValue = rand.nextInt();
-        final int randomSize= rand.nextInt(Integer.MAX_VALUE);
+        final int randomSize= rand.nextInt(2 << 10);
         IntStream is = Streams.generateInt(() -> randomValue);
         assertEquals(is.spliterator().getExactSizeIfKnown(), -1);
 
@@ -103,8 +103,8 @@
         }
 
         //below is time-consuming, need watch out if it's gonna affect our test
-        int start = rand.nextInt();
-        int end = rand.nextInt();
+        int start = rand.nextInt(2 << 12);
+        int end = rand.nextInt(2 << 12);
 
         if(start > end) {
             start = start ^ end;
@@ -121,7 +121,6 @@
         while(it2.hasNext())
             assertEquals(it2.nextInt(), start += step);
         assertTrue(start + step > end);
-
     }
 
     @Test