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

Class Class, % Method, % Line, %
MultimapValuesTester 0% (0/1) 0% (0/4) 0% (0/18)


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.Helpers.assertEqualIgnoringOrder; 18 import static com.google.common.collect.testing.Helpers.assertEqualInOrder; 19 import static com.google.common.collect.testing.features.CollectionFeature.KNOWN_ORDER; 20 import static com.google.common.collect.testing.features.CollectionFeature.SUPPORTS_ITERATOR_REMOVE; 21 import static com.google.common.collect.testing.features.CollectionSize.ONE; 22  23 import com.google.common.annotations.GwtCompatible; 24 import com.google.common.collect.Lists; 25 import com.google.common.collect.Multimap; 26 import com.google.common.collect.testing.features.CollectionFeature; 27 import com.google.common.collect.testing.features.CollectionSize; 28 import java.util.Iterator; 29 import java.util.List; 30 import java.util.Map.Entry; 31 import org.junit.Ignore; 32  33 /** 34  * Tester for {@code Multimap.values}. 35  * 36  * @author Louis Wasserman 37  */ 38 @GwtCompatible 39 @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. 40 public class MultimapValuesTester<K, V> extends AbstractMultimapTester<K, V, Multimap<K, V>> { 41  public void testValues() { 42  List<V> expected = Lists.newArrayList(); 43  for (Entry<K, V> entry : getSampleElements()) { 44  expected.add(entry.getValue()); 45  } 46  assertEqualIgnoringOrder(expected, multimap().values()); 47  } 48  49  @CollectionFeature.Require(KNOWN_ORDER) 50  public void testValuesInOrder() { 51  List<V> expected = Lists.newArrayList(); 52  for (Entry<K, V> entry : getOrderedElements()) { 53  expected.add(entry.getValue()); 54  } 55  assertEqualInOrder(expected, multimap().values()); 56  } 57  58  @CollectionFeature.Require(SUPPORTS_ITERATOR_REMOVE) 59  @CollectionSize.Require(ONE) 60  public void testValuesIteratorRemove() { 61  Iterator<V> valuesItr = multimap().values().iterator(); 62  valuesItr.next(); 63  valuesItr.remove(); 64  assertTrue(multimap().isEmpty()); 65  } 66 }