Use JUnit Assumptions
This commit is contained in:
parent
450ed7118e
commit
dea79e62f1
|
@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||||
import static org.junit.jupiter.api.Assumptions.assumeFalse;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -701,9 +700,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void testAddMappingThroughGet() {
|
public void testAddMappingThroughGet() {
|
||||||
if (!isAddSupported()) {
|
assumeTrue(isAddSupported());
|
||||||
return;
|
|
||||||
}
|
|
||||||
resetEmpty();
|
resetEmpty();
|
||||||
final MultiValuedMap<K, V> map = getMap();
|
final MultiValuedMap<K, V> map = getMap();
|
||||||
final Collection<V> col1 = map.get((K) "k0");
|
final Collection<V> col1 = map.get((K) "k0");
|
||||||
|
@ -971,9 +968,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void testMapEquals() {
|
public void testMapEquals() {
|
||||||
if (!isAddSupported()) {
|
assumeTrue(isAddSupported());
|
||||||
return;
|
|
||||||
}
|
|
||||||
final MultiValuedMap<K, V> one = makeObject();
|
final MultiValuedMap<K, V> one = makeObject();
|
||||||
final Integer value = Integer.valueOf(1);
|
final Integer value = Integer.valueOf(1);
|
||||||
one.put((K) "One", (V) value);
|
one.put((K) "One", (V) value);
|
||||||
|
@ -1080,9 +1075,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void testPutAll_KeyIterable() {
|
public void testPutAll_KeyIterable() {
|
||||||
if (!isAddSupported()) {
|
assumeTrue(isAddSupported());
|
||||||
return;
|
|
||||||
}
|
|
||||||
final MultiValuedMap<K, V> map = makeObject();
|
final MultiValuedMap<K, V> map = makeObject();
|
||||||
Collection<V> coll = (Collection<V>) Arrays.asList("X", "Y", "Z");
|
Collection<V> coll = (Collection<V>) Arrays.asList("X", "Y", "Z");
|
||||||
|
|
||||||
|
@ -1118,9 +1111,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void testPutAll_Map1() {
|
public void testPutAll_Map1() {
|
||||||
if (!isAddSupported()) {
|
assumeTrue(isAddSupported());
|
||||||
return;
|
|
||||||
}
|
|
||||||
final MultiValuedMap<K, V> original = makeObject();
|
final MultiValuedMap<K, V> original = makeObject();
|
||||||
original.put((K) "key", (V) "object1");
|
original.put((K) "key", (V) "object1");
|
||||||
original.put((K) "key", (V) "object2");
|
original.put((K) "key", (V) "object2");
|
||||||
|
@ -1147,9 +1138,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void testPutAll_Map2() {
|
public void testPutAll_Map2() {
|
||||||
if (!isAddSupported()) {
|
assumeTrue(isAddSupported());
|
||||||
return;
|
|
||||||
}
|
|
||||||
final Map<K, V> original = new HashMap<>();
|
final Map<K, V> original = new HashMap<>();
|
||||||
original.put((K) "keyX", (V) "object1");
|
original.put((K) "keyX", (V) "object1");
|
||||||
original.put((K) "keyY", (V) "object2");
|
original.put((K) "keyY", (V) "object2");
|
||||||
|
@ -1177,9 +1166,8 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void testRemove_KeyItem() {
|
public void testRemove_KeyItem() {
|
||||||
if (!isRemoveSupported() || !isAddSupported()) {
|
assumeTrue(isAddSupported());
|
||||||
return;
|
assumeTrue(isRemoveSupported());
|
||||||
}
|
|
||||||
final MultiValuedMap<K, V> map = makeObject();
|
final MultiValuedMap<K, V> map = makeObject();
|
||||||
map.put((K) "A", (V) "AA");
|
map.put((K) "A", (V) "AA");
|
||||||
map.put((K) "A", (V) "AB");
|
map.put((K) "A", (V) "AB");
|
||||||
|
@ -1325,9 +1313,8 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void testSizeWithPutRemove() {
|
public void testSizeWithPutRemove() {
|
||||||
if (!isRemoveSupported() || !isAddSupported()) {
|
assumeTrue(isAddSupported());
|
||||||
return;
|
assumeTrue(isRemoveSupported());
|
||||||
}
|
|
||||||
final MultiValuedMap<K, V> map = makeObject();
|
final MultiValuedMap<K, V> map = makeObject();
|
||||||
assertEquals(0, map.size());
|
assertEquals(0, map.size());
|
||||||
map.put((K) "A", (V) "AA");
|
map.put((K) "A", (V) "AA");
|
||||||
|
@ -1346,9 +1333,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testToString(){
|
public void testToString(){
|
||||||
if (!isAddSupported()) {
|
assumeTrue(isAddSupported());
|
||||||
return;
|
|
||||||
}
|
|
||||||
final MultiValuedMap<K, V> map = makeObject();
|
final MultiValuedMap<K, V> map = makeObject();
|
||||||
map.put((K) "A", (V) "X");
|
map.put((K) "A", (V) "X");
|
||||||
map.put((K) "A", (V) "Y");
|
map.put((K) "A", (V) "Y");
|
||||||
|
|
Loading…
Reference in New Issue