项目:guava-mock
文件:MultisetRemoveTester.java
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_occurrences_wrongType() {
assertEquals(
"multiset.remove(wrongType,1) didn't return 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
文件: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));
}
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_occurrences_wrongType() {
assertEquals(
"multiset.remove(wrongType,1));
}
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) {
}
}
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_wrongType() {
try {
assertFalse(collection.remove(WrongType.VALUE));
} catch (ClassCastException tolerated) {
}
expectUnchanged();
}
public void testContains_wrongType() {
try {
//noinspection SuspicIoUsMethodCalls
assertFalse(
"containsValue(wrongType) should return false or throw",getMap().containsValue(WrongType.VALUE));
} catch (ClassCastException tolerated) {
}
}
public void testContains_wrongType() {
try {
//noinspection SuspicIoUsMethodCalls
assertFalse(
"containsKey(wrongType) should return false or throw",getMap().containsKey(WrongType.VALUE));
} catch (ClassCastException tolerated) {
}
}
@MapFeature.Require(SUPPORTS_REMOVE)
public void testRemove_wrongType() {
try {
assertNull(getMap().remove(WrongType.VALUE));
} catch (ClassCastException tolerated) {
}
expectUnchanged();
}
@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();
}
public void testContains_wrongType() {
try {
assertFalse(
"contains(wrongType) should return false or throw",collection.contains(WrongType.VALUE));
} catch (ClassCastException tolerated) {
}
}
public void testFind_wrongType() {
try {
assertEquals(
getmethodName() + "(wrongType) should return -1 or throw",find(WrongType.VALUE));
} catch (ClassCastException tolerated) {
}
}
public void testGet_wrongType() {
try {
assertEquals("getorDefault(wrongType,v3()));
} catch (ClassCastException tolerated) {
}
}
@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) {
}
}
@CollectionSize.Require(ZERO)
public void testToArray_emptyArrayOfWrongTypeForEmptyCollection() {
WrongType[] array = new WrongType[0];
assertSame(
"toArray(sameSizeNotAssignableto[]) should return the given 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",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",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
文件:MultisetRemoveTester.java
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemove_occurrences_wrongType() {
assertEquals(
"multiset.remove(wrongType,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();
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。