changeset 6389:b3fc2ac88d4c

More garbage-collection of dead tests
author briangoetz
date Mon, 12 Nov 2012 17:07:34 -0500
parents e8517ea52d33
children bd225e0a0200
files test-ng/tests/org/openjdk/tests/java/util/MapStreamTest.java
diffstat 1 files changed, 0 insertions(+), 240 deletions(-) [+]
line wrap: on
line diff
--- a/test-ng/tests/org/openjdk/tests/java/util/MapStreamTest.java	Mon Nov 12 13:25:21 2012 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 2012, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package org.openjdk.tests.java.util;
-
-import org.testng.annotations.Test;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
-
-/**
- *
- * @author mike
- */
-@Test(groups = { "unit", "lambda" })
-public class MapStreamTest {
-/*
-    static final Integer[] KEYS = {0,1,2,3};
-    static final String[] VALUES = {"zero", "one", "two", "three"};
-
-    final Map<Integer, String> map = new HashMap<>();
-    final MapStream<Integer, String> test = Collections.unmodifiableMap(map);
-
-    MapStreamTest () {
-    Iterator<String> values = Arrays.asList(VALUES).iterator();
-        for(Integer key : KEYS) {
-            map.put(key, values.next());
-        }
-
-        Mapping<Integer,String> found = null;
-        for(Mapping<Integer,String> each : test.asIterable()) {
-            if(0 == each.getKey()) {
-                found = each;
-                break;
-            }
-        }
-    }
-
-
-    public void testIsEmpty() {
-        assertFalse(test.isEmpty());
-        assertTrue(((MapStream<?,?>) Collections.emptyMap()).isEmpty());
-    }
-
-    public void testGetFirst() {
-        assertNotEquals(null, test.getFirst());
-        assertEquals(null, ((MapStream<?,?>) Collections.emptyMap()).getFirst());
-    }
-
-    public void testGetAny() {
-        assertNotEquals(null, test.getAny());
-        assertEquals(null, ((MapStream<?,?>) Collections.emptyMap()).getAny());
-    }
-
-    public void testGetOnlyGood() {
-        assertNotEquals(null, ((MapStream<String,String>) Collections.singletonMap("foo","bar")).getOnly());
-    }
-
-    @Test(expectedExceptions=IllegalStateException.class)
-    public void testGetOnlyBad() {
-        Mapping<Integer,String> notOnly = test.getOnly();
-    }
-
-    public void testInputs() {
-        Iterable<Integer> keys = test.inputs();
-        Collection<Integer> keysInt = new ArrayList<>();
-        keys.into(keysInt);
-
-        assertTrue(Arrays.asList(KEYS).containsAll(keysInt) &&
-                keysInt.containsAll(Arrays.asList(KEYS)));
-    }
-
-    public void testValues() {
-        Iterable<String> values = test.values();
-
-        Collection<String> valuesInto = new ArrayList<>();
-        values.into(valuesInto);
-
-        assertTrue(Arrays.asList(VALUES).containsAll(valuesInto) &&
-                valuesInto.containsAll(Arrays.asList(VALUES)));
-    }
-
-    public void testAsIterable() {
-        Iterable<? extends Mapping<Integer,String>> iterable = test.asIterable();
-
-        Set<Mapping<Integer,String>> into = new HashSet<>();
-        for(Mapping<Integer,String> element : iterable) {
-            into.add(element);
-        }
-
-        assertEquals(into, map.entrySet());
-    }
-
-    public void testAsMultiStream() {
-        MapStream<Integer, Iterable<String>> multi = test.asMultiStream();
-
-        List<Mapping<Integer, Iterable<String>>> into = new ArrayList<>();
-        for(Mapping<Integer,Iterable<String>> element : multi.asIterable()) {
-            into.add(element);
-        }
-
-        for(Mapping<Integer,Iterable<String>> pair : into) {
-            Integer key = pair.getKey();
-            Iterable<String> value = pair.getValue();
-
-            assertTrue(Arrays.asList(KEYS).contains(key));
-
-            List<String> forKey = new ArrayList<>();
-            value.into(forKey);
-
-            assertTrue(1 == forKey.size());
-            assertTrue(Arrays.asList(VALUES).contains(forKey.getFirst()));
-        }
-    }
-
-    public void testAllMatch() {
-        assertTrue(test.allMatch( (l,r) -> l >= 0), "should all be positive");
-        assertTrue(test.allMatch( (l,r) -> r.length() > 0), "should all be non-empty");
-    };
-
-    public void testNoneMatch() {
-        assertTrue(test.noneMatch( (l,r) -> l < 0), "should be no negatives");
-        assertTrue(test.noneMatch( (l,r) -> r.length() == 0), "should be no empty strings");
-    };
-
-    public void testAnyMatch() {
-        assertTrue(test.anyMatch( (l,r) -> l == 2), "there should be a '2'");
-        assertTrue(test.anyMatch( (l,r) -> "two".equals(r)),"there should be a 'two'");
-    };
-
-    public void testForEach() {
-        int heinous[] = new int[1];
-
-        test.forEach((l,r) -> {heinous[0]++;});
-        assertEquals(map.size(), heinous[0], "element count does not equal source size");
-    }
-
-    public void testFilter() {
-        Map<Integer, String> into = new HashMap<>();
-
-        test.filter((l,r) -> (l % 2) == 0).into(into);
-        assertTrue(into.size() == 2);
-        into.clear();
-        test.filter((l,r) -> "two".equals(r)).into(into);
-        assertTrue(into.size() == 1);
-    }
-
-    public void testFilterKeys() {
-        Map<Integer, String> into = new HashMap<>();
-
-        test.filterKeys(l -> l % 2 == 0).into(into);
-        assertTrue(into.size() == 2);
-    }
-
-    public void testFilterValues() {
-        Map<Integer, String> into = new HashMap<>();
-
-        test.filterValues(r -> "two".equals(r)).into(into);
-        assertTrue(into.size() == 1);
-    }
-
-    public void testMap() {
-        for(Mapping<Integer,String> each : test.map((l,r) -> l.toString()).asIterable()) {
-            assertEquals((int) each.getKey(), Integer.parseInt(each.getValue()), "values not equal");
-        }
-    }
-
-    public void testMapValues() {
-
-    }
-
-    public void testMapValuesMulti() {
-
-    }
-
-    public void testGroupBy() {
-        Map<String, Iterable<Integer>> into = new HashMap<>();
-        test.inputs().groupBy( e -> (0 == e % 2) ? "even" : "odd").into(into);
-
-        assertEquals(2, into.size(), "Should be two groups");
-        for(Map.Entry<String,Iterable<Integer>> eachGroup : into.entrySet()) {
-            Iterable<Integer> aGroupValues = eachGroup.getValue();
-            assertEquals(2, aGroupValues.count(), "Should be two values per group");
-        };
-    }
-
-    public void testGroupByMulti() {
-        Map<String, Iterable<Mapping<Integer,String>>> into = new HashMap<>();
-        Mapper<Mapping<Integer,String>, Iterable<String>> grouper = (Mapping<Integer,String> e) ->
-            Arrays.asList(
-                (0 == e.getKey() % 2) ? "even" : "odd",
-                e.getValue().substring(0, 1)
-                );
-
-        test.asIterable().groupByMulti(grouper).into(into);
-
-        assertEquals(5, into.size(), "Should be five groups");
-    }
-
-    public void testSorted() {
-        // standard order
-        int min = Integer.MIN_VALUE;
-        for(Integer each : test.sorted((one, two) -> one - two).inputs()) {
-            assertTrue(min <= each, "Not in ascending order");
-            min = each;
-        }
-
-        // reverse order
-        int max = Integer.MAX_VALUE;
-        for(Integer each : test.sorted((one, two) -> two - one).inputs()) {
-            assertTrue(max >= each, "Not in descending order");
-            max = each;
-        }
-    }
-*/
-}