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

Class Class, % Method, % Line, %
MultimapToStringTester 0% (0/1) 0% (0/6) 0% (0/13)


1 /* 2  * Copyright (C) 2013 The Guava Authors 3  * 4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5  * in compliance with the License. You may obtain a copy of the License at 6  * 7  * http://www.apache.org/licenses/LICENSE-2.0 8  * 9  * Unless required by applicable law or agreed to in writing, software distributed under the License 10  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11  * or implied. See the License for the specific language governing permissions and limitations under 12  * the License. 13  */ 14  15 package com.google.common.collect.testing.google; 16  17 import static com.google.common.collect.testing.features.CollectionFeature.NON_STANDARD_TOSTRING; 18 import static com.google.common.collect.testing.features.CollectionSize.ONE; 19 import static com.google.common.collect.testing.features.CollectionSize.ZERO; 20 import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_KEYS; 21 import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_VALUES; 22  23 import com.google.common.annotations.GwtCompatible; 24 import com.google.common.collect.Multimap; 25 import com.google.common.collect.testing.features.CollectionFeature; 26 import com.google.common.collect.testing.features.CollectionSize; 27 import com.google.common.collect.testing.features.MapFeature; 28 import org.junit.Ignore; 29  30 /** 31  * Tester for {@code Multimap.toString()}. 32  * 33  * @author Louis Wasserman 34  */ 35 @GwtCompatible 36 @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. 37 public class MultimapToStringTester<K, V> extends AbstractMultimapTester<K, V, Multimap<K, V>> { 38  @CollectionSize.Require(ZERO) 39  @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) 40  public void testToStringEmpty() { 41  assertEquals("{}", multimap().toString()); 42  } 43  44  @CollectionSize.Require(ONE) 45  @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) 46  public void testToStringSingleton() { 47  assertEquals("{" + k0() + "=[" + v0() + "]}", multimap().toString()); 48  } 49  50  @CollectionSize.Require(absent = ZERO) 51  @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) 52  @MapFeature.Require(ALLOWS_NULL_KEYS) 53  public void testToStringWithNullKey() { 54  initMultimapWithNullKey(); 55  testToStringMatchesAsMap(); 56  } 57  58  @CollectionSize.Require(absent = ZERO) 59  @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) 60  @MapFeature.Require(ALLOWS_NULL_VALUES) 61  public void testToStringWithNullValue() { 62  initMultimapWithNullValue(); 63  testToStringMatchesAsMap(); 64  } 65  66  @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) 67  public void testToStringMatchesAsMap() { 68  assertEquals(multimap().asMap().toString(), multimap().toString()); 69  } 70 }