Java 类java.util.stream.DoubleStreamTestDataProvider 实例源码

项目:openjdk-jdk10    文件:CountTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testOps(String name, TestData.OfDouble data) {
    long expectedCount = data.size();

    withData(data).
            terminal(DoubleStream::count).
            expectedResult(expectedCount).
            exercise();

    withData(data).
            terminal(s -> s.filter(e -> true), DoubleStream::count).
            expectedResult(expectedCount).
            exercise();

    expectedCount = data.into(new HashSet<>()).size();
    withData(data).
            terminal(DoubleStream::distinct, DoubleStream::count).
            expectedResult(expectedCount).
            exercise();
    withData(data).
            terminal(s -> s.unordered().distinct(), DoubleStream::count).
            expectedResult(expectedCount).
            exercise();
}
项目:openjdk9    文件:CountTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testOps(String name, TestData.OfDouble data) {
    long expectedCount = data.size();

    withData(data).
            terminal(DoubleStream::count).
            expectedResult(expectedCount).
            exercise();

    withData(data).
            terminal(s -> s.filter(e -> true), DoubleStream::count).
            expectedResult(expectedCount).
            exercise();

    expectedCount = data.into(new HashSet<>()).size();
    withData(data).
            terminal(DoubleStream::distinct, DoubleStream::count).
            expectedResult(expectedCount).
            exercise();
    withData(data).
            terminal(s -> s.unordered().distinct(), DoubleStream::count).
            expectedResult(expectedCount).
            exercise();
}
项目:jdk8u-jdk    文件:MatchOpTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleStream(String name, TestData.OfDouble data) {
    for (DoublePredicate p : DOUBLE_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpFalse), doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpEven), doubleKinds.get(kind).apply(p));
        }
    }
}
项目:jdk8u-jdk    文件:CountTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testOps(String name, TestData.OfDouble data) {
    AtomicLong expectedCount = new AtomicLong();
    data.stream().forEach(e -> expectedCount.incrementAndGet());

    withData(data).
            terminal(DoubleStream::count).
            expectedResult(expectedCount.get()).
            exercise();
}
项目:openjdk-jdk10    文件:MatchOpTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleStream(String name, TestData.OfDouble data) {
    for (DoublePredicate p : DOUBLE_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpFalse), doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpEven), doubleKinds.get(kind).apply(p));
        }
    }
}
项目:openjdk-jdk10    文件:FlatMapOpTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleOps(String name, TestData.OfDouble data) {
    Collection<Double> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToDouble(j -> j)));
    assertEquals(data.size(), result.size());
    assertContents(data, result);

    result = exerciseOps(data, s -> DoubleStream.empty());
    assertEquals(0, result.size());
}
项目:openjdk9    文件:MatchOpTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleStream(String name, TestData.OfDouble data) {
    for (DoublePredicate p : DOUBLE_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpFalse), doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpEven), doubleKinds.get(kind).apply(p));
        }
    }
}
项目:openjdk9    文件:FlatMapOpTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleOps(String name, TestData.OfDouble data) {
    Collection<Double> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToDouble(j -> j)));
    assertEquals(data.size(), result.size());
    assertContents(data, result);

    result = exerciseOps(data, s -> DoubleStream.empty());
    assertEquals(0, result.size());
}
项目:jdk8u_jdk    文件:MatchOpTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleStream(String name, TestData.OfDouble data) {
    for (DoublePredicate p : DOUBLE_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpFalse), doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpEven), doubleKinds.get(kind).apply(p));
        }
    }
}
项目:jdk8u_jdk    文件:CountTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testOps(String name, TestData.OfDouble data) {
    AtomicLong expectedCount = new AtomicLong();
    data.stream().forEach(e -> expectedCount.incrementAndGet());

    withData(data).
            terminal(DoubleStream::count).
            expectedResult(expectedCount.get()).
            exercise();
}
项目:lookaside_java-1.8.0-openjdk    文件:MatchOpTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleStream(String name, TestData.OfDouble data) {
    for (DoublePredicate p : DOUBLE_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpFalse), doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpEven), doubleKinds.get(kind).apply(p));
        }
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:CountTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testOps(String name, TestData.OfDouble data) {
    AtomicLong expectedCount = new AtomicLong();
    data.stream().forEach(e -> expectedCount.incrementAndGet());

    withData(data).
            terminal(DoubleStream::count).
            expectedResult(expectedCount.get()).
            exercise();
}
项目:infobip-open-jdk-8    文件:MatchOpTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleStream(String name, TestData.OfDouble data) {
    for (DoublePredicate p : DOUBLE_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpFalse), doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpEven), doubleKinds.get(kind).apply(p));
        }
    }
}
项目:infobip-open-jdk-8    文件:CountTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testOps(String name, TestData.OfDouble data) {
    AtomicLong expectedCount = new AtomicLong();
    data.stream().forEach(e -> expectedCount.incrementAndGet());

    withData(data).
            terminal(DoubleStream::count).
            expectedResult(expectedCount.get()).
            exercise();
}
项目:jdk8u-dev-jdk    文件:MatchOpTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleStream(String name, TestData.OfDouble data) {
    for (DoublePredicate p : DOUBLE_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpFalse), doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpEven), doubleKinds.get(kind).apply(p));
        }
    }
}
项目:jdk8u-dev-jdk    文件:CountTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testOps(String name, TestData.OfDouble data) {
    AtomicLong expectedCount = new AtomicLong();
    data.stream().forEach(e -> expectedCount.incrementAndGet());

    withData(data).
            terminal(DoubleStream::count).
            expectedResult(expectedCount.get()).
            exercise();
}
项目:OLD-OpenJDK8    文件:MatchOpTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleStream(String name, TestData.OfDouble data) {
    for (DoublePredicate p : DOUBLE_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpFalse), doubleKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(dpEven), doubleKinds.get(kind).apply(p));
        }
    }
}
项目:OLD-OpenJDK8    文件:CountTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testOps(String name, TestData.OfDouble data) {
    AtomicLong expectedCount = new AtomicLong();
    data.stream().forEach(e -> expectedCount.incrementAndGet());

    withData(data).
            terminal(DoubleStream::count).
            expectedResult(expectedCount.get()).
            exercise();
}
项目:jdk8u-jdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:jdk8u-jdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleParSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:openjdk-jdk10    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:openjdk-jdk10    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleParSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:openjdk-jdk10    文件:FlatMapOpTest.java   
@Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleOpsX(String name, TestData.OfDouble data) {
    exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).asDoubleStream()));
    exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).limit(10).asDoubleStream()));
}
项目:openjdk9    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:openjdk9    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleParSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:openjdk9    文件:FlatMapOpTest.java   
@Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleOpsX(String name, TestData.OfDouble data) {
    exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).asDoubleStream()));
    exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).limit(10).asDoubleStream()));
}
项目:jdk8u_jdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:jdk8u_jdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleParSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleParSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:infobip-open-jdk-8    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:infobip-open-jdk-8    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleParSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:jdk8u-dev-jdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:jdk8u-dev-jdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleParSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:OLD-OpenJDK8    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:OLD-OpenJDK8    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
public void testDoubleParSpliterators(String name, TestData.OfDouble data) {
    for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
        SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}