Coverage Summary for Class: BiMapClearTester (com.google.common.collect.testing.google)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| BiMapClearTester | 0% (0/1) | 0% (0/7) | 0% (0/31) |
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.features.MapFeature.SUPPORTS_REMOVE; 20 21 import com.google.common.annotations.GwtCompatible; 22 import com.google.common.collect.BiMap; 23 import com.google.common.collect.testing.features.MapFeature; 24 import org.junit.Ignore; 25 26 /** 27 * Tester for {@code BiMap.clear}. 28 * 29 * @author Louis Wasserman 30 */ 31 @GwtCompatible 32 @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. 33 public class BiMapClearTester<K, V> extends AbstractBiMapTester<K, V> { 34 @MapFeature.Require(SUPPORTS_REMOVE) 35 public void testClearClearsInverse() { 36 BiMap<V, K> inv = getMap().inverse(); 37 getMap().clear(); 38 assertTrue(getMap().isEmpty()); 39 assertTrue(inv.isEmpty()); 40 } 41 42 @MapFeature.Require(SUPPORTS_REMOVE) 43 public void testKeySetClearClearsInverse() { 44 BiMap<V, K> inv = getMap().inverse(); 45 getMap().keySet().clear(); 46 assertTrue(getMap().isEmpty()); 47 assertTrue(inv.isEmpty()); 48 } 49 50 @MapFeature.Require(SUPPORTS_REMOVE) 51 public void testValuesClearClearsInverse() { 52 BiMap<V, K> inv = getMap().inverse(); 53 getMap().values().clear(); 54 assertTrue(getMap().isEmpty()); 55 assertTrue(inv.isEmpty()); 56 } 57 58 @MapFeature.Require(SUPPORTS_REMOVE) 59 public void testClearInverseClears() { 60 BiMap<V, K> inv = getMap().inverse(); 61 inv.clear(); 62 assertTrue(getMap().isEmpty()); 63 assertTrue(inv.isEmpty()); 64 } 65 66 @MapFeature.Require(SUPPORTS_REMOVE) 67 public void testClearInverseKeySetClears() { 68 BiMap<V, K> inv = getMap().inverse(); 69 inv.keySet().clear(); 70 assertTrue(getMap().isEmpty()); 71 assertTrue(inv.isEmpty()); 72 } 73 74 @MapFeature.Require(SUPPORTS_REMOVE) 75 public void testClearInverseValuesClears() { 76 BiMap<V, K> inv = getMap().inverse(); 77 inv.values().clear(); 78 assertTrue(getMap().isEmpty()); 79 assertTrue(inv.isEmpty()); 80 } 81 }