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

Class Class, % Method, % Line, %
MultisetEqualsTester 0% (0/1) 0% (0/5) 0% (0/20)


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.ALLOWS_NULL_VALUES; 18 import static com.google.common.collect.testing.features.CollectionSize.ZERO; 19  20 import com.google.common.annotations.GwtCompatible; 21 import com.google.common.collect.testing.features.CollectionFeature; 22 import com.google.common.collect.testing.features.CollectionSize; 23 import com.google.common.testing.EqualsTester; 24 import org.junit.Ignore; 25  26 /** 27  * Tests for {@code Multiset.equals} and {@code Multiset.hashCode}. 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 MultisetEqualsTester<E> extends AbstractMultisetTester<E> { 34  public void testEqualsSameContents() { 35  new EqualsTester() 36  .addEqualityGroup( 37  getMultiset(), getSubjectGenerator().create(getSampleElements().toArray())) 38  .testEquals(); 39  } 40  41  @CollectionSize.Require(absent = ZERO) 42  public void testNotEqualsEmpty() { 43  new EqualsTester() 44  .addEqualityGroup(getMultiset()) 45  .addEqualityGroup(getSubjectGenerator().create()) 46  .testEquals(); 47  } 48  49  public void testHashCodeMatchesEntrySet() { 50  assertEquals(getMultiset().entrySet().hashCode(), getMultiset().hashCode()); 51  } 52  53  @CollectionSize.Require(absent = ZERO) 54  @CollectionFeature.Require(ALLOWS_NULL_VALUES) 55  public void testEqualsMultisetWithNullValue() { 56  new EqualsTester() 57  .addEqualityGroup(getMultiset()) 58  .addEqualityGroup( 59  getSubjectGenerator().create(createArrayWithNullElement()), 60  getSubjectGenerator().create(createArrayWithNullElement())) 61  .testEquals(); 62  } 63 }