< prev index next >
test/java/util/stream/test/org/openjdk/tests/java/util/stream/FlatMapOpTest.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 22,32 ****
*/
/*
* @test
* @summary flat-map operations
! * @bug 8044047
*/
package org.openjdk.tests.java.util.stream;
import org.testng.annotations.Test;
--- 22,32 ----
*/
/*
* @test
* @summary flat-map operations
! * @bug 8044047 8076458
*/
package org.openjdk.tests.java.util.stream;
import org.testng.annotations.Test;
*** 128,138 ****
DoubleStream.of(1, 2).peek(e -> before.getAndIncrement()).
flatMap(i -> DoubleStream.of(i, i).onClose(onClose::getAndIncrement)).count();
assertEquals(before.get(), onClose.get());
}
! @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
public void testOps(String name, TestData.OfRef<Integer> data) {
Collection<Integer> result = exerciseOps(data, s -> s.flatMap(mfId));
assertEquals(data.size(), result.size());
result = exerciseOps(data, s -> s.flatMap(mfNull));
--- 128,138 ----
DoubleStream.of(1, 2).peek(e -> before.getAndIncrement()).
flatMap(i -> DoubleStream.of(i, i).onClose(onClose::getAndIncrement)).count();
assertEquals(before.get(), onClose.get());
}
! @Test(dataProvider = "StreamTestData<Integer>.small", dataProviderClass = StreamTestDataProvider.class)
public void testOps(String name, TestData.OfRef<Integer> data) {
Collection<Integer> result = exerciseOps(data, s -> s.flatMap(mfId));
assertEquals(data.size(), result.size());
result = exerciseOps(data, s -> s.flatMap(mfNull));
*** 146,156 ****
exerciseOps(data, s -> s.flatMap((Integer e) -> IntStream.range(0, e).boxed().limit(10)));
}
//
! @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class)
public void testIntOps(String name, TestData.OfInt data) {
Collection<Integer> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToInt(j -> j)));
assertEquals(data.size(), result.size());
assertContents(data, result);
--- 146,156 ----
exerciseOps(data, s -> s.flatMap((Integer e) -> IntStream.range(0, e).boxed().limit(10)));
}
//
! @Test(dataProvider = "IntStreamTestData.small", dataProviderClass = IntStreamTestDataProvider.class)
public void testIntOps(String name, TestData.OfInt data) {
Collection<Integer> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream().mapToInt(j -> j)));
assertEquals(data.size(), result.size());
assertContents(data, result);
*** 161,171 ****
exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, e).limit(10)));
}
//
! @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);
--- 161,171 ----
exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, e).limit(10)));
}
//
! @Test(dataProvider = "LongStreamTestData.small", 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);
*** 176,186 ****
exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e).limit(10)));
}
//
! @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);
--- 176,186 ----
exerciseOps(data, s -> s.flatMap(e -> LongStream.range(0, e).limit(10)));
}
//
! @Test(dataProvider = "DoubleStreamTestData.small", 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);
< prev index next >