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

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

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

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

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

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

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

    expectedCount = data.into(new HashSet<>()).size();
    withData(data).
            terminal(LongStream::distinct, LongStream::count).
            expectedResult(expectedCount).
            exercise();
    withData(data).
            terminal(s -> s.unordered().distinct(), LongStream::count).
            expectedResult(expectedCount).
            exercise();
}
项目:jdk8u-jdk    文件:MatchOpTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongStream(String name, TestData.OfLong data) {
    for (LongPredicate p : LONG_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpFalse), longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpEven), longKinds.get(kind).apply(p));
        }
    }
}
项目:jdk8u-jdk    文件:CountTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testOps(String name, TestData.OfLong data) {
    AtomicLong expectedCount = new AtomicLong();
    data.stream().forEach(e -> expectedCount.incrementAndGet());

    withData(data).
            terminal(LongStream::count).
            expectedResult(expectedCount.get()).
            exercise();
}
项目:openjdk-jdk10    文件:MatchOpTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongStream(String name, TestData.OfLong data) {
    for (LongPredicate p : LONG_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpFalse), longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpEven), longKinds.get(kind).apply(p));
        }
    }
}
项目:openjdk-jdk10    文件:FlatMapOpTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongOps(String name, TestData.OfLong data) {
    Collection<Long> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToLong(j -> j)));
    assertEquals(data.size(), result.size());
    assertContents(data, result);

    result = exerciseOps(data, s -> LongStream.empty());
    assertEquals(0, result.size());
}
项目:openjdk9    文件:MatchOpTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongStream(String name, TestData.OfLong data) {
    for (LongPredicate p : LONG_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpFalse), longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpEven), longKinds.get(kind).apply(p));
        }
    }
}
项目:openjdk9    文件:FlatMapOpTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongOps(String name, TestData.OfLong data) {
    Collection<Long> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToLong(j -> j)));
    assertEquals(data.size(), result.size());
    assertContents(data, result);

    result = exerciseOps(data, s -> LongStream.empty());
    assertEquals(0, result.size());
}
项目:jdk8u_jdk    文件:MatchOpTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongStream(String name, TestData.OfLong data) {
    for (LongPredicate p : LONG_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpFalse), longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpEven), longKinds.get(kind).apply(p));
        }
    }
}
项目:jdk8u_jdk    文件:CountTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testOps(String name, TestData.OfLong data) {
    AtomicLong expectedCount = new AtomicLong();
    data.stream().forEach(e -> expectedCount.incrementAndGet());

    withData(data).
            terminal(LongStream::count).
            expectedResult(expectedCount.get()).
            exercise();
}
项目:lookaside_java-1.8.0-openjdk    文件:MatchOpTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongStream(String name, TestData.OfLong data) {
    for (LongPredicate p : LONG_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpFalse), longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpEven), longKinds.get(kind).apply(p));
        }
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:CountTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testOps(String name, TestData.OfLong data) {
    AtomicLong expectedCount = new AtomicLong();
    data.stream().forEach(e -> expectedCount.incrementAndGet());

    withData(data).
            terminal(LongStream::count).
            expectedResult(expectedCount.get()).
            exercise();
}
项目:infobip-open-jdk-8    文件:MatchOpTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongStream(String name, TestData.OfLong data) {
    for (LongPredicate p : LONG_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpFalse), longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpEven), longKinds.get(kind).apply(p));
        }
    }
}
项目:infobip-open-jdk-8    文件:CountTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testOps(String name, TestData.OfLong data) {
    AtomicLong expectedCount = new AtomicLong();
    data.stream().forEach(e -> expectedCount.incrementAndGet());

    withData(data).
            terminal(LongStream::count).
            expectedResult(expectedCount.get()).
            exercise();
}
项目:jdk8u-dev-jdk    文件:MatchOpTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongStream(String name, TestData.OfLong data) {
    for (LongPredicate p : LONG_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpFalse), longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpEven), longKinds.get(kind).apply(p));
        }
    }
}
项目:jdk8u-dev-jdk    文件:CountTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testOps(String name, TestData.OfLong data) {
    AtomicLong expectedCount = new AtomicLong();
    data.stream().forEach(e -> expectedCount.incrementAndGet());

    withData(data).
            terminal(LongStream::count).
            expectedResult(expectedCount.get()).
            exercise();
}
项目:OLD-OpenJDK8    文件:MatchOpTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongStream(String name, TestData.OfLong data) {
    for (LongPredicate p : LONG_PREDICATES) {
        setContext("p", p);
        for (Kind kind : Kind.values()) {
            setContext("kind", kind);
            exerciseTerminalOps(data, longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpFalse), longKinds.get(kind).apply(p));
            exerciseTerminalOps(data, s -> s.filter(lpEven), longKinds.get(kind).apply(p));
        }
    }
}
项目:OLD-OpenJDK8    文件:CountTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testOps(String name, TestData.OfLong data) {
    AtomicLong expectedCount = new AtomicLong();
    data.stream().forEach(e -> expectedCount.incrementAndGet());

    withData(data).
            terminal(LongStream::count).
            expectedResult(expectedCount.get()).
            exercise();
}
项目:jdk8u-jdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:jdk8u-jdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongParSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:openjdk-jdk10    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:openjdk-jdk10    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongParSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:openjdk-jdk10    文件:FlatMapOpTest.java   
@Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongOpsX(String name, TestData.OfLong data) {
    exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e)));
    exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e).limit(10)));
}
项目:openjdk9    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:openjdk9    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongParSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:openjdk9    文件:FlatMapOpTest.java   
@Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongOpsX(String name, TestData.OfLong data) {
    exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e)));
    exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e).limit(10)));
}
项目:jdk8u_jdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:jdk8u_jdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongParSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongParSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:infobip-open-jdk-8    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:infobip-open-jdk-8    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongParSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:jdk8u-dev-jdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:jdk8u-dev-jdk    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongParSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}
项目:OLD-OpenJDK8    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.stream()).spliterator());
    }
}
项目:OLD-OpenJDK8    文件:StreamSpliteratorTest.java   
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
public void testLongParSpliterators(String name, TestData.OfLong data) {
    for (Function<LongStream, LongStream> f : longStreamFunctions()) {
        SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.parallelStream()).spliterator());
    }
}