Coverage Summary for Class: MultimapContainsValueTester (com.google.common.collect.testing.google)

Class Class, % Method, % Line, %
MultimapContainsValueTester 0% (0/1) 0% (0/6) 0% (0/15)


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.CollectionSize.ZERO; 20 import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_VALUES; 21 import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_VALUE_QUERIES; 22  23 import com.google.common.annotations.GwtCompatible; 24 import com.google.common.collect.Multimap; 25 import com.google.common.collect.testing.features.CollectionSize; 26 import com.google.common.collect.testing.features.MapFeature; 27 import org.junit.Ignore; 28  29 /** 30  * Tester for {@link Multimap#containsValue}. 31  * 32  * @author Louis Wasserman 33  */ 34 @GwtCompatible 35 @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. 36 public class MultimapContainsValueTester<K, V> 37  extends AbstractMultimapTester<K, V, Multimap<K, V>> { 38  @CollectionSize.Require(absent = ZERO) 39  public void testContainsValueYes() { 40  assertTrue(multimap().containsValue(v0())); 41  } 42  43  public void testContainsValueNo() { 44  assertFalse(multimap().containsValue(v3())); 45  } 46  47  @MapFeature.Require(ALLOWS_NULL_VALUES) 48  @CollectionSize.Require(absent = ZERO) 49  public void testContainsNullValueYes() { 50  initMultimapWithNullValue(); 51  assertTrue(multimap().containsValue(null)); 52  } 53  54  @MapFeature.Require(ALLOWS_NULL_VALUE_QUERIES) 55  public void testContainsNullValueNo() { 56  assertFalse(multimap().containsValue(null)); 57  } 58  59  @MapFeature.Require(absent = ALLOWS_NULL_VALUE_QUERIES) 60  public void testContainsNullValueFails() { 61  try { 62  multimap().containsValue(null); 63  fail("Expected NullPointerException"); 64  } catch (NullPointerException expected) { 65  // success 66  } 67  } 68 }