From 275bc06f3c62595502b40b424fd115d4a66b25b7 Mon Sep 17 00:00:00 2001 From: Jonathan Bluett-Duncan Date: Sun, 20 Aug 2017 13:17:29 +0100 Subject: [PATCH] Add missing private constructors to utilities classes Issue: #1027 --- .../src/main/java/org/junit/jupiter/api/AssertAll.java | 6 ++++++ .../main/java/org/junit/jupiter/api/AssertArrayEquals.java | 6 ++++++ .../src/main/java/org/junit/jupiter/api/AssertEquals.java | 6 ++++++ .../src/main/java/org/junit/jupiter/api/AssertFalse.java | 6 ++++++ .../java/org/junit/jupiter/api/AssertIterableEquals.java | 6 ++++++ .../main/java/org/junit/jupiter/api/AssertLinesMatch.java | 6 ++++++ .../main/java/org/junit/jupiter/api/AssertNotEquals.java | 6 ++++++ .../src/main/java/org/junit/jupiter/api/AssertNotNull.java | 6 ++++++ .../src/main/java/org/junit/jupiter/api/AssertNotSame.java | 6 ++++++ .../src/main/java/org/junit/jupiter/api/AssertNull.java | 6 ++++++ .../src/main/java/org/junit/jupiter/api/AssertSame.java | 6 ++++++ .../src/main/java/org/junit/jupiter/api/AssertThrows.java | 6 ++++++ .../src/main/java/org/junit/jupiter/api/AssertTimeout.java | 6 ++++++ .../src/main/java/org/junit/jupiter/api/AssertTrue.java | 6 ++++++ .../src/main/java/org/junit/jupiter/api/Assumptions.java | 2 ++ .../rules/member/TestRuleAnnotatedMemberFactory.java | 6 ++++++ .../params/support/AnnotationConsumerInitializer.java | 6 ++++++ .../org/junit/platform/launcher/core/LauncherFactory.java | 6 ++++++ 18 files changed, 104 insertions(+) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertAll.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertAll.java index a36cf8d7af30..5dea50639a1a 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertAll.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertAll.java @@ -28,6 +28,12 @@ */ class AssertAll { + ///CLOVER:OFF + private AssertAll() { + /* no-op */ + } + ///CLOVER:ON + static void assertAll(Executable... executables) { assertAll(null, executables); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertArrayEquals.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertArrayEquals.java index d049a55969e7..bef484e9ef80 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertArrayEquals.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertArrayEquals.java @@ -30,6 +30,12 @@ */ class AssertArrayEquals { + ///CLOVER:OFF + private AssertArrayEquals() { + /* no-op */ + } + ///CLOVER:ON + static void assertArrayEquals(boolean[] expected, boolean[] actual) { assertArrayEquals(expected, actual, () -> null); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertEquals.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertEquals.java index 1c560e786813..23b42a8e9886 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertEquals.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertEquals.java @@ -27,6 +27,12 @@ */ class AssertEquals { + ///CLOVER:OFF + private AssertEquals() { + /* no-op */ + } + ///CLOVER:ON + static void assertEquals(byte expected, byte actual) { assertEquals(expected, actual, () -> null); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertFalse.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertFalse.java index 5975c8b3ce6b..918e7415388a 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertFalse.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertFalse.java @@ -23,6 +23,12 @@ */ class AssertFalse { + ///CLOVER:OFF + private AssertFalse() { + /* no-op */ + } + ///CLOVER:ON + static void assertFalse(boolean condition) { assertFalse(() -> condition, () -> null); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java index 398affc45d08..1b114bad324d 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java @@ -31,6 +31,12 @@ */ class AssertIterableEquals { + ///CLOVER:OFF + private AssertIterableEquals() { + /* no-op */ + } + ///CLOVER:ON + static void assertIterableEquals(Iterable expected, Iterable actual) { assertIterableEquals(expected, actual, () -> null); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java index 72a1b15abf49..08314ed5e05e 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java @@ -28,6 +28,12 @@ */ class AssertLinesMatch { + ///CLOVER:OFF + private AssertLinesMatch() { + /* no-op */ + } + ///CLOVER:ON + private final static int MAX_SNIPPET_LENGTH = 21; static void assertLinesMatch(List expectedLines, List actualLines) { diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotEquals.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotEquals.java index 67c77c2bc6cc..f82937808450 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotEquals.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotEquals.java @@ -25,6 +25,12 @@ */ class AssertNotEquals { + ///CLOVER:OFF + private AssertNotEquals() { + /* no-op */ + } + ///CLOVER:ON + static void assertNotEquals(Object unexpected, Object actual) { assertNotEquals(unexpected, actual, () -> null); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotNull.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotNull.java index f76b74b35005..1892299d78b2 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotNull.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotNull.java @@ -23,6 +23,12 @@ */ class AssertNotNull { + ///CLOVER:OFF + private AssertNotNull() { + /* no-op */ + } + ///CLOVER:ON + static void assertNotNull(Object actual) { assertNotNull(actual, () -> null); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotSame.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotSame.java index 70d7dcc9e9da..0a76df2a760a 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotSame.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotSame.java @@ -24,6 +24,12 @@ */ class AssertNotSame { + ///CLOVER:OFF + private AssertNotSame() { + /* no-op */ + } + ///CLOVER:ON + static void assertNotSame(Object unexpected, Object actual) { assertNotSame(unexpected, actual, () -> null); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java index fcba2157ccce..83b9c0c06eba 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java @@ -24,6 +24,12 @@ */ class AssertNull { + ///CLOVER:OFF + private AssertNull() { + /* no-op */ + } + ///CLOVER:ON + static void assertNull(Object actual) { assertNull(actual, () -> null); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertSame.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertSame.java index 3160363b4f56..07b1678706b9 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertSame.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertSame.java @@ -24,6 +24,12 @@ */ class AssertSame { + ///CLOVER:OFF + private AssertSame() { + /* no-op */ + } + ///CLOVER:ON + static void assertSame(Object expected, Object actual) { assertSame(expected, actual, () -> null); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertThrows.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertThrows.java index 9a730512d9d0..22df0159a7f0 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertThrows.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertThrows.java @@ -28,6 +28,12 @@ */ class AssertThrows { + ///CLOVER:OFF + private AssertThrows() { + /* no-op */ + } + ///CLOVER:ON + static T assertThrows(Class expectedType, Executable executable) { return assertThrows(expectedType, executable, () -> null); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTimeout.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTimeout.java index 48032d15dbf7..7bdc24665c53 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTimeout.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTimeout.java @@ -36,6 +36,12 @@ */ class AssertTimeout { + ///CLOVER:OFF + private AssertTimeout() { + /* no-op */ + } + ///CLOVER:ON + static void assertTimeout(Duration timeout, Executable executable) { assertTimeout(timeout, executable, () -> null); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTrue.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTrue.java index e6c7254260bb..ddbc149b55ce 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTrue.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTrue.java @@ -23,6 +23,12 @@ */ class AssertTrue { + ///CLOVER:OFF + private AssertTrue() { + /* no-op */ + } + ///CLOVER:ON + static void assertTrue(boolean condition) { assertTrue(() -> condition, () -> null); } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java index 7b39aaa7f42a..ee871adf7dba 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java @@ -42,9 +42,11 @@ @API(Maintained) public final class Assumptions { + ///CLOVER:OFF private Assumptions() { /* no-op */ } + ///CLOVER:ON // --- assumeTrue ---------------------------------------------------- diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMemberFactory.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMemberFactory.java index ca1a4b389a58..49b5ba6fe022 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMemberFactory.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMemberFactory.java @@ -25,6 +25,12 @@ @API(Internal) public final class TestRuleAnnotatedMemberFactory { + ///CLOVER:OFF + private TestRuleAnnotatedMemberFactory() { + /* no-op */ + } + ///CLOVER:ON + public static TestRuleAnnotatedMember from(Object testInstance, Member member) { if (member instanceof Method) { return new TestRuleAnnotatedMethod(testInstance, (Method) member); diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumerInitializer.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumerInitializer.java index 68c8b71ed4b1..5327fb2dc8ae 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumerInitializer.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumerInitializer.java @@ -32,6 +32,12 @@ @API(Internal) public final class AnnotationConsumerInitializer { + ///CLOVER:OFF + private AnnotationConsumerInitializer() { + /* no-op */ + } + ///CLOVER:ON + // @formatter:off private static final Predicate isAnnotationConsumerAcceptMethod = method -> method.getName().equals("accept") diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java index 900fe8f08f24..45c2a042cc85 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java @@ -40,6 +40,12 @@ @API(Experimental) public class LauncherFactory { + ///CLOVER:OFF + private LauncherFactory() { + /* no-op */ + } + ///CLOVER:ON + /** * Factory method for creating a new {@link Launcher} using dynamically * detected test engines.