/** * Used to delay string formatting until actually required, as it otherwise shows up in the test * execution profile when running an extremely large numbers of tests. */ private String reportContext(List<E> expected) { return Platform.format( "expected collection %s; actual collection %s", expected, this.collection); } }
private void expectReturnsFalseOrThrows(Target target) { String message = Platform.format("retainAll(%s) should return false or throw", target); try { assertFalse(message, collection.retainAll(target.toRetain)); } catch (UnsupportedOperationException tolerated) { } } }
private void expectThrows(Target target) { try { collection.retainAll(target.toRetain); String message = Platform.format("retainAll(%s) should throw", target); fail(message); } catch (UnsupportedOperationException expected) { } }
private void expectReturnsFalse(Target target) { String message = Platform.format("retainAll(%s) should return false", target); assertFalse(message, collection.retainAll(target.toRetain)); }
private void expectReturnsTrue(Target target) { String message = Platform.format("retainAll(%s) should return true", target); assertTrue(message, collection.retainAll(target.toRetain)); }
private void runRemoveTest(int index) { assertEquals( Platform.format("remove(%d) should return the element at index %d", index, index), getList().get(index), getList().remove(index)); List<E> expected = Helpers.copyToList(createSamplesArray()); expected.remove(index); expectContents(expected); } }
/** * Used to delay string formatting until actually required, as it otherwise shows up in the test * execution profile when running an extremely large numbers of tests. */ private String reportContext(List<E> expected) { return Platform.format( "expected collection %s; actual collection %s", expected, this.collection); } }
/** * Used to delay string formatting until actually required, as it * otherwise shows up in the test execution profile when running an * extremely large numbers of tests. */ private String reportContext(List<E> expected) { return Platform.format("expected collection %s; actual collection %s", expected, this.collection); } }
private void expectThrows(Target target) { try { collection.retainAll(target.toRetain); String message = Platform.format("retainAll(%s) should throw", target); fail(message); } catch (UnsupportedOperationException expected) { } }
private void expectReturnsTrue(Target target) { String message = Platform.format("retainAll(%s) should return true", target); assertTrue(message, collection.retainAll(target.toRetain)); }
private void expectReturnsFalse(Target target) { String message = Platform.format("retainAll(%s) should return false", target); assertFalse(message, collection.retainAll(target.toRetain)); }
private void expectReturnsFalseOrThrows(Target target) { String message = Platform.format("retainAll(%s) should return false or throw", target); try { assertFalse(message, collection.retainAll(target.toRetain)); } catch (UnsupportedOperationException tolerated) { } } }
private void expectThrows(Target target) { try { collection.retainAll(target.toRetain); String message = Platform.format("retainAll(%s) should throw", target); fail(message); } catch (UnsupportedOperationException expected) { } }
private void expectReturnsFalseOrThrows(Target target) { String message = Platform.format("retainAll(%s) should return false or throw", target); try { assertFalse(message, collection.retainAll(target.toRetain)); } catch (UnsupportedOperationException tolerated) { } } }
private void expectReturnsTrue(Target target) { String message = Platform.format("retainAll(%s) should return true", target); assertTrue(message, collection.retainAll(target.toRetain)); }
private void expectReturnsFalse(Target target) { String message = Platform.format("retainAll(%s) should return false", target); assertFalse(message, collection.retainAll(target.toRetain)); }
private void runRemoveTest(int index) { assertEquals( Platform.format("remove(%d) should return the element at index %d", index, index), getList().get(index), getList().remove(index)); List<E> expected = Helpers.copyToList(createSamplesArray()); expected.remove(index); expectContents(expected); } }
private void runRemoveTest(int index) { assertEquals(Platform.format( "remove(%d) should return the element at index %d", index, index), getList().get(index), getList().remove(index)); List<E> expected = Helpers.copyToList(createSamplesArray()); expected.remove(index); expectContents(expected); } }