Coverage Summary for Class: MultimapRemoveAllTester (com.google.common.collect.testing.google)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| MultimapRemoveAllTester | 0% (0/1) | 0% (0/7) | 0% (0/24) |
1 /* 2 * Copyright (C) 2012 The Guava Authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.common.collect.testing.google; 18 19 import static com.google.common.collect.testing.Helpers.assertContentsAnyOrder; 20 import static com.google.common.collect.testing.Helpers.assertEmpty; 21 import static com.google.common.collect.testing.features.CollectionSize.SEVERAL; 22 import static com.google.common.collect.testing.features.CollectionSize.ZERO; 23 import static com.google.common.collect.testing.features.MapFeature.ALLOWS_ANY_NULL_QUERIES; 24 import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_KEYS; 25 import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_REMOVE; 26 import static com.google.common.collect.testing.google.GoogleHelpers.assertEmpty; 27 28 import com.google.common.annotations.GwtCompatible; 29 import com.google.common.collect.Multimap; 30 import com.google.common.collect.testing.Helpers; 31 import com.google.common.collect.testing.features.CollectionSize; 32 import com.google.common.collect.testing.features.MapFeature; 33 import java.util.Collection; 34 import org.junit.Ignore; 35 36 /** 37 * Tests for {@link Multimap#removeAll(Object)}. 38 * 39 * @author Louis Wasserman 40 */ 41 @GwtCompatible 42 @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. 43 public class MultimapRemoveAllTester<K, V> extends AbstractMultimapTester<K, V, Multimap<K, V>> { 44 @MapFeature.Require(SUPPORTS_REMOVE) 45 public void testRemoveAllAbsentKey() { 46 assertEmpty(multimap().removeAll(k3())); 47 expectUnchanged(); 48 } 49 50 @CollectionSize.Require(absent = ZERO) 51 @MapFeature.Require(SUPPORTS_REMOVE) 52 public void testRemoveAllPresentKey() { 53 assertContentsAnyOrder(multimap().removeAll(k0()), v0()); 54 expectMissing(e0()); 55 } 56 57 @CollectionSize.Require(absent = ZERO) 58 @MapFeature.Require(SUPPORTS_REMOVE) 59 public void testRemoveAllPropagatesToGet() { 60 Collection<V> getResult = multimap().get(k0()); 61 62 multimap().removeAll(k0()); 63 64 assertEmpty(getResult); 65 expectMissing(e0()); 66 } 67 68 @CollectionSize.Require(SEVERAL) 69 @MapFeature.Require(SUPPORTS_REMOVE) 70 public void testRemoveAllMultipleValues() { 71 resetContainer( 72 Helpers.mapEntry(k0(), v0()), Helpers.mapEntry(k0(), v1()), Helpers.mapEntry(k0(), v2())); 73 74 assertContentsAnyOrder(multimap().removeAll(k0()), v0(), v1(), v2()); 75 assertEmpty(multimap()); 76 } 77 78 @CollectionSize.Require(absent = ZERO) 79 @MapFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_KEYS}) 80 public void testRemoveAllNullKeyPresent() { 81 initMultimapWithNullKey(); 82 83 assertContentsAnyOrder(multimap().removeAll(null), getValueForNullKey()); 84 85 expectMissing(Helpers.mapEntry((K) null, getValueForNullKey())); 86 } 87 88 @MapFeature.Require({SUPPORTS_REMOVE, ALLOWS_ANY_NULL_QUERIES}) 89 public void testRemoveAllNullKeyAbsent() { 90 assertEmpty(multimap().removeAll(null)); 91 expectUnchanged(); 92 } 93 }