Java 类com.google.common.collect.testing.WrongType 实例源码

项目:guava-mock    文件:MultisetRemoveTester.java   
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_occurrences_wrongType() {
  assertEquals(
      "multiset.remove(wrongType, 1) didn't return 0",
      0,
      getMultiset().remove(WrongType.VALUE, 1));
}
项目:guava-mock    文件:CollectionContainsAllTester.java   
public void testContainsAll_wrongType() {
  Collection<WrongType> wrong = MinimalCollection.of(WrongType.VALUE);
  try {
    assertFalse(
        "containsAll(wrongType) should return false or throw", collection.containsAll(wrong));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava-mock    文件:CollectionRemoveTester.java   
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_wrongType() {
  try {
    assertFalse(collection.remove(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
  expectUnchanged();
}
项目:guava-mock    文件:MapContainsValueTester.java   
public void testContains_wrongType() {
  try {
    //noinspection SuspiciousMethodCalls
    assertFalse(
        "containsValue(wrongType) should return false or throw",
        getMap().containsValue(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava-mock    文件:MapContainsKeyTester.java   
public void testContains_wrongType() {
  try {
    //noinspection SuspiciousMethodCalls
    assertFalse(
        "containsKey(wrongType) should return false or throw",
        getMap().containsKey(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava-mock    文件:MapRemoveTester.java   
@MapFeature.Require(SUPPORTS_REMOVE)
public void testRemove_wrongType() {
  try {
    assertNull(getMap().remove(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
  expectUnchanged();
}
项目:guava-mock    文件:CollectionRemoveAllTester.java   
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveAll_containsWrongType() {
  try {
    assertFalse(
        "removeAll(containsWrongType) should return false or throw",
        collection.removeAll(MinimalCollection.of(WrongType.VALUE)));
  } catch (ClassCastException tolerated) {
  }
  expectUnchanged();
}
项目:guava-mock    文件:CollectionContainsTester.java   
public void testContains_wrongType() {
  try {
    assertFalse(
        "contains(wrongType) should return false or throw", collection.contains(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava-mock    文件:AbstractListIndexOfTester.java   
public void testFind_wrongType() {
  try {
    assertEquals(
        getMethodName() + "(wrongType) should return -1 or throw", -1, find(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava-mock    文件:MapGetOrDefaultTester.java   
public void testGet_wrongType() {
  try {
    assertEquals("getOrDefault(wrongType, default) should return default or throw",
        v3(), getMap().getOrDefault(WrongType.VALUE, v3()));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava-mock    文件:CollectionToArrayTester.java   
@CollectionSize.Require(absent = ZERO)
public void testToArray_emptyArrayOfWrongTypeForNonEmptyCollection() {
  try {
    WrongType[] array = new WrongType[0];
    collection.toArray(array);
    fail("toArray(notAssignableTo[]) should throw");
  } catch (ArrayStoreException expected) {
  }
}
项目:guava-mock    文件:CollectionToArrayTester.java   
@CollectionSize.Require(ZERO)
public void testToArray_emptyArrayOfWrongTypeForEmptyCollection() {
  WrongType[] array = new WrongType[0];
  assertSame(
      "toArray(sameSizeNotAssignableTo[]) should return the given array",
      array,
      collection.toArray(array));
}
项目:googles-monorepo-demo    文件:MultisetRemoveTester.java   
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_occurrences_wrongType() {
  assertEquals(
      "multiset.remove(wrongType, 1) didn't return 0",
      0,
      getMultiset().remove(WrongType.VALUE, 1));
}
项目:googles-monorepo-demo    文件:CollectionContainsAllTester.java   
public void testContainsAll_wrongType() {
  Collection<WrongType> wrong = MinimalCollection.of(WrongType.VALUE);
  try {
    assertFalse(
        "containsAll(wrongType) should return false or throw", collection.containsAll(wrong));
  } catch (ClassCastException tolerated) {
  }
}
项目:googles-monorepo-demo    文件:CollectionRemoveTester.java   
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_wrongType() {
  try {
    assertFalse(collection.remove(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
  expectUnchanged();
}
项目:googles-monorepo-demo    文件:MapContainsValueTester.java   
public void testContains_wrongType() {
  try {
    //noinspection SuspiciousMethodCalls
    assertFalse(
        "containsValue(wrongType) should return false or throw",
        getMap().containsValue(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:googles-monorepo-demo    文件:MapContainsKeyTester.java   
public void testContains_wrongType() {
  try {
    //noinspection SuspiciousMethodCalls
    assertFalse(
        "containsKey(wrongType) should return false or throw",
        getMap().containsKey(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:googles-monorepo-demo    文件:MapRemoveTester.java   
@MapFeature.Require(SUPPORTS_REMOVE)
public void testRemove_wrongType() {
  try {
    assertNull(getMap().remove(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
  expectUnchanged();
}
项目:googles-monorepo-demo    文件:CollectionRemoveAllTester.java   
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveAll_containsWrongType() {
  try {
    assertFalse(
        "removeAll(containsWrongType) should return false or throw",
        collection.removeAll(MinimalCollection.of(WrongType.VALUE)));
  } catch (ClassCastException tolerated) {
  }
  expectUnchanged();
}
项目:googles-monorepo-demo    文件:CollectionContainsTester.java   
public void testContains_wrongType() {
  try {
    assertFalse(
        "contains(wrongType) should return false or throw", collection.contains(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:googles-monorepo-demo    文件:AbstractListIndexOfTester.java   
public void testFind_wrongType() {
  try {
    assertEquals(
        getMethodName() + "(wrongType) should return -1 or throw", -1, find(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:googles-monorepo-demo    文件:MapGetOrDefaultTester.java   
public void testGet_wrongType() {
  try {
    assertEquals("getOrDefault(wrongType, default) should return default or throw",
        v3(), getMap().getOrDefault(WrongType.VALUE, v3()));
  } catch (ClassCastException tolerated) {
  }
}
项目:googles-monorepo-demo    文件:CollectionToArrayTester.java   
@CollectionSize.Require(absent = ZERO)
public void testToArray_emptyArrayOfWrongTypeForNonEmptyCollection() {
  try {
    WrongType[] array = new WrongType[0];
    collection.toArray(array);
    fail("toArray(notAssignableTo[]) should throw");
  } catch (ArrayStoreException expected) {
  }
}
项目:googles-monorepo-demo    文件:CollectionToArrayTester.java   
@CollectionSize.Require(ZERO)
public void testToArray_emptyArrayOfWrongTypeForEmptyCollection() {
  WrongType[] array = new WrongType[0];
  assertSame(
      "toArray(sameSizeNotAssignableTo[]) should return the given array",
      array,
      collection.toArray(array));
}
项目:guava-libraries    文件:CollectionContainsAllTester.java   
public void testContainsAll_wrongType() {
  Collection<WrongType> wrong = MinimalCollection.of(WrongType.VALUE);
  try {
    assertFalse("containsAll(wrongType) should return false or throw",
        collection.containsAll(wrong));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava-libraries    文件:CollectionRemoveTester.java   
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_wrongType() {
  try {
    assertFalse(collection.remove(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
  expectUnchanged();
}
项目:guava-libraries    文件:MapContainsValueTester.java   
public void testContains_wrongType() {
  try {
    //noinspection SuspiciousMethodCalls
    assertFalse("containsValue(wrongType) should return false or throw",
        getMap().containsValue(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava-libraries    文件:MapContainsKeyTester.java   
public void testContains_wrongType() {
  try {
    //noinspection SuspiciousMethodCalls
    assertFalse("containsKey(wrongType) should return false or throw",
        getMap().containsKey(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava-libraries    文件:MapRemoveTester.java   
@MapFeature.Require(SUPPORTS_REMOVE)
public void testRemove_wrongType() {
  try {
    assertNull(getMap().remove(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
  expectUnchanged();
}
项目:guava-libraries    文件:CollectionRemoveAllTester.java   
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveAll_containsWrongType() {
  try {
    assertFalse("removeAll(containsWrongType) should return false or throw",
        collection.removeAll(MinimalCollection.of(WrongType.VALUE)));
  } catch (ClassCastException tolerated) {
  }
  expectUnchanged();
}
项目:guava-libraries    文件:CollectionContainsTester.java   
public void testContains_wrongType() {
  try {
    assertFalse("contains(wrongType) should return false or throw",
        collection.contains(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava-libraries    文件:AbstractListIndexOfTester.java   
public void testFind_wrongType() {
  try {
    assertEquals(getMethodName() + "(wrongType) should return -1 or throw",
        -1, find(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava-libraries    文件:CollectionToArrayTester.java   
@CollectionSize.Require(absent = ZERO)
public void testToArray_emptyArrayOfWrongTypeForNonEmptyCollection() {
  try {
    WrongType[] array = new WrongType[0];
    collection.toArray(array);
    fail("toArray(notAssignableTo[]) should throw");
  } catch (ArrayStoreException expected) {
  }
}
项目:guava-libraries    文件:CollectionToArrayTester.java   
@CollectionSize.Require(ZERO)
public void testToArray_emptyArrayOfWrongTypeForEmptyCollection() {
  WrongType[] array = new WrongType[0];
  assertSame(
      "toArray(sameSizeNotAssignableTo[]) should return the given array",
      array, collection.toArray(array));
}
项目:guava-libraries    文件:MapGetTester.java   
public void testGet_wrongType() {
  try {
    assertNull("get(wrongType) should return null or throw",
        getMap().get(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava-libraries    文件:CollectionToArrayTester.java   
@CollectionSize.Require(absent = ZERO)
public void testToArray_emptyArrayOfWrongTypeForNonEmptyCollection() {
  try {
    WrongType[] array = new WrongType[0];
    collection.toArray(array);
    fail("toArray(notAssignableTo[]) should throw");
  } catch (ArrayStoreException expected) {
  }
}
项目:guava-libraries    文件:CollectionToArrayTester.java   
@CollectionSize.Require(ZERO)
public void testToArray_emptyArrayOfWrongTypeForEmptyCollection() {
  WrongType[] array = new WrongType[0];
  assertSame(
      "toArray(sameSizeNotAssignableTo[]) should return the given array",
      array, collection.toArray(array));
}
项目:guava    文件:MultisetRemoveTester.java   
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_occurrences_wrongType() {
  assertEquals(
      "multiset.remove(wrongType, 1) didn't return 0",
      0,
      getMultiset().remove(WrongType.VALUE, 1));
}
项目:guava    文件:CollectionContainsAllTester.java   
public void testContainsAll_wrongType() {
  Collection<WrongType> wrong = MinimalCollection.of(WrongType.VALUE);
  try {
    assertFalse(
        "containsAll(wrongType) should return false or throw", collection.containsAll(wrong));
  } catch (ClassCastException tolerated) {
  }
}
项目:guava    文件:CollectionRemoveTester.java   
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_wrongType() {
  try {
    assertFalse(collection.remove(WrongType.VALUE));
  } catch (ClassCastException tolerated) {
  }
  expectUnchanged();
}