1 /* 2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 package org.openjdk.tests.java.util.stream; 24 25 import org.testng.annotations.Test; 26 27 import java.util.ArrayList; 28 import java.util.Iterator; 29 import java.util.List; 30 import java.util.function.Supplier; 31 import java.util.Spliterator; 32 import java.util.stream.*; 33 34 import static org.testng.Assert.*; 35 import static org.testng.Assert.assertEquals; 36 37 /** 38 * SpliteratorTest 39 * 40 * @author Brian Goetz 41 */ 42 @Test 43 public class SpliteratorTest { 44 45 @Test(dataProvider = "Spliterator<Integer>", dataProviderClass = StreamTestDataProvider.class ) testSpliterator(String name, Supplier<Spliterator<Integer>> supplier)46 public void testSpliterator(String name, Supplier<Spliterator<Integer>> supplier) { 47 SpliteratorTestHelper.testSpliterator(supplier); 48 } 49 50 @Test(dataProvider = "IntSpliterator", dataProviderClass = IntStreamTestDataProvider.class ) testIntSpliterator(String name, Supplier<Spliterator.OfInt> supplier)51 public void testIntSpliterator(String name, Supplier<Spliterator.OfInt> supplier) { 52 SpliteratorTestHelper.testIntSpliterator(supplier); 53 } 54 55 @Test(dataProvider = "LongSpliterator", dataProviderClass = LongStreamTestDataProvider.class ) testLongSpliterator(String name, Supplier<Spliterator.OfLong> supplier)56 public void testLongSpliterator(String name, Supplier<Spliterator.OfLong> supplier) { 57 SpliteratorTestHelper.testLongSpliterator(supplier); 58 } 59 60 @Test(dataProvider = "DoubleSpliterator", dataProviderClass = DoubleStreamTestDataProvider.class ) testDoubleSpliterator(String name, Supplier<Spliterator.OfDouble> supplier)61 public void testDoubleSpliterator(String name, Supplier<Spliterator.OfDouble> supplier) { 62 SpliteratorTestHelper.testDoubleSpliterator(supplier); 63 } 64 } 65