From 54800b25c8bcb27725c559e5fe7329dc46daf1a0 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 19 Feb 2018 10:24:33 -0500 Subject: Rename utils-test testXxx() methods Fixed sonar complaints about the testXxx_Yyy() methods in the XxxTester classes. In most cases, they were renamed to testYyy(). The top-level method, test(), was not renamed so-as not to break existing tests that already depend on it. Renamed testStringConstuctor() to testString(). Change-Id: I00e8993c71fa9d9cb83bea82276d9706dd0e7c45 Issue-ID: POLICY-246 Signed-off-by: Jim Hahn --- .../policy/common/utils/test/ThrowablesTester.java | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'utils-test/src/main/java/org/onap/policy/common/utils/test/ThrowablesTester.java') diff --git a/utils-test/src/main/java/org/onap/policy/common/utils/test/ThrowablesTester.java b/utils-test/src/main/java/org/onap/policy/common/utils/test/ThrowablesTester.java index 8c997d56..4a8da3b4 100644 --- a/utils-test/src/main/java/org/onap/policy/common/utils/test/ThrowablesTester.java +++ b/utils-test/src/main/java/org/onap/policy/common/utils/test/ThrowablesTester.java @@ -66,14 +66,14 @@ public class ThrowablesTester { * @throws AssertionError * if the constructed objects fail to pass various tests */ - public int testThrowable(Class claz) { + public final int testAllThrowable(Class claz) { int ncons = 0; - ncons += testThrowable_Default(claz); - ncons += testThrowable_StringConstuctor(claz); - ncons += testThrowable_Throwable(claz); - ncons += testThrowable_StringThrowable(claz); - ncons += testThrowable_StringThrowableBooleanBoolean(claz); + ncons += testDefault(claz); + ncons += testString(claz); + ncons += testThrowable(claz); + ncons += testStringThrowable(claz); + ncons += testStringThrowableBooleanBoolean(claz); return ncons; } @@ -99,7 +99,7 @@ public class ThrowablesTester { * @throws AssertionError * if the constructed objects fail to pass various tests */ - public int testThrowable_Default(Class claz) { + public final int testDefault(Class claz) { Constructor cons = getConstructor(claz, "default"); if (cons == null) { return 0; @@ -136,7 +136,7 @@ public class ThrowablesTester { * @throws AssertionError * if the constructed objects fail to pass various tests */ - public int testThrowable_StringConstuctor(Class claz) { + public final int testString(Class claz) { Constructor cons = getConstructor(claz, "string", String.class); if (cons == null) { return 0; @@ -173,7 +173,7 @@ public class ThrowablesTester { * @throws AssertionError * if the constructed objects fail to pass various tests */ - public int testThrowable_Throwable(Class claz) { + public final int testThrowable(Class claz) { Constructor cons = getConstructor(claz, "throwable", Throwable.class); if (cons == null) { return 0; @@ -211,7 +211,7 @@ public class ThrowablesTester { * @throws AssertionError * if the constructed objects fail to pass various tests */ - public int testThrowable_StringThrowable(Class claz) { + public final int testStringThrowable(Class claz) { Constructor cons = getConstructor(claz, "string-throwable", String.class, Throwable.class); if (cons == null) { return 0; @@ -251,7 +251,7 @@ public class ThrowablesTester { * @throws AssertionError * if the constructed objects fail to pass various tests */ - public int testThrowable_StringThrowableBooleanBoolean(Class claz) { + public final int testStringThrowableBooleanBoolean(Class claz) { Constructor cons = getConstructor(claz, "string-throwable-flags", String.class, Throwable.class, Boolean.TYPE, Boolean.TYPE); if (cons == null) { @@ -259,13 +259,13 @@ public class ThrowablesTester { } // test each combination of "message" and "cause" - testThrowable_MessageCauseCombos(cons); + testMessageCauseCombos(cons); // test each combination of the boolean flags - testThrowable_SuppressStack(cons); - testThrowable_SuppressNoStack(cons); - testThrowable_NoSuppressStack(cons); - testThrowable_NoSuppressNoStack(cons); + testSuppressStack(cons); + testSuppressNoStack(cons); + testNoSuppressStack(cons); + testNoSuppressNoStack(cons); return 1; } @@ -284,7 +284,7 @@ public class ThrowablesTester { * @throws AssertionError * if the constructed objects fail to pass various tests */ - public void testThrowable_MessageCauseCombos(Constructor cons) { + public final void testMessageCauseCombos(Constructor cons) { T ex; ex = newInstance(cons, null, null, true, true); @@ -322,11 +322,11 @@ public class ThrowablesTester { * @throws AssertionError * if the constructed objects fail to pass various tests */ - public void testThrowable_FlagCombos(Constructor cons) { - testThrowable_SuppressStack(cons); - testThrowable_SuppressNoStack(cons); - testThrowable_NoSuppressStack(cons); - testThrowable_NoSuppressNoStack(cons); + public final void testFlagCombos(Constructor cons) { + testSuppressStack(cons); + testSuppressNoStack(cons); + testNoSuppressStack(cons); + testNoSuppressNoStack(cons); } /** @@ -349,7 +349,7 @@ public class ThrowablesTester { * @throws AssertionError * if the constructed objects fail to pass various tests */ - public void testThrowable_SuppressStack(Constructor cons) { + public final void testSuppressStack(Constructor cons) { T ex = newInstance(cons, "yes,yes", CAUSE, true, true); ex.addSuppressed(SUPPRESSED); @@ -384,7 +384,7 @@ public class ThrowablesTester { * @throws AssertionError * if the constructed objects fail to pass various tests */ - public void testThrowable_SuppressNoStack(Constructor cons) { + public final void testSuppressNoStack(Constructor cons) { T ex = newInstance(cons, "yes,no", CAUSE, true, false); ex.addSuppressed(SUPPRESSED); @@ -419,7 +419,7 @@ public class ThrowablesTester { * @throws AssertionError * if the constructed objects fail to pass various tests */ - public void testThrowable_NoSuppressStack(Constructor cons) { + public final void testNoSuppressStack(Constructor cons) { T ex = newInstance(cons, "no,yes", CAUSE, false, true); ex.addSuppressed(SUPPRESSED); @@ -452,7 +452,7 @@ public class ThrowablesTester { * @throws AssertionError * if the constructed objects fail to pass various tests */ - public void testThrowable_NoSuppressNoStack(Constructor cons) { + public final void testNoSuppressNoStack(Constructor cons) { T ex = newInstance(cons, "no,no", CAUSE, false, false); ex.addSuppressed(SUPPRESSED); -- cgit 1.2.3-korg