summaryrefslogtreecommitdiffstats
path: root/utils-test/src
diff options
context:
space:
mode:
Diffstat (limited to 'utils-test/src')
-rw-r--r--utils-test/src/main/java/org/onap/policy/common/utils/test/ErrorsTester.java4
-rw-r--r--utils-test/src/main/java/org/onap/policy/common/utils/test/ExceptionsTester.java22
-rw-r--r--utils-test/src/main/java/org/onap/policy/common/utils/test/ThrowablesTester.java52
-rw-r--r--utils-test/src/test/java/org/onap/policy/common/utils/test/ConstructionErrorTest.java2
-rw-r--r--utils-test/src/test/java/org/onap/policy/common/utils/test/ErrorsTesterTest.java4
-rw-r--r--utils-test/src/test/java/org/onap/policy/common/utils/test/ThrowablesTesterTest.java20
6 files changed, 52 insertions, 52 deletions
diff --git a/utils-test/src/main/java/org/onap/policy/common/utils/test/ErrorsTester.java b/utils-test/src/main/java/org/onap/policy/common/utils/test/ErrorsTester.java
index 1a69e58c..46814c96 100644
--- a/utils-test/src/main/java/org/onap/policy/common/utils/test/ErrorsTester.java
+++ b/utils-test/src/main/java/org/onap/policy/common/utils/test/ErrorsTester.java
@@ -40,7 +40,7 @@ public class ErrorsTester extends ThrowablesTester {
* @throws AssertionError
* if the constructed objects fail to pass various tests
*/
- public <T extends Error> int testError(Class<T> claz) {
- return testThrowable(claz);
+ public <T extends Error> int testAllError(Class<T> claz) {
+ return testAllThrowable(claz);
}
}
diff --git a/utils-test/src/main/java/org/onap/policy/common/utils/test/ExceptionsTester.java b/utils-test/src/main/java/org/onap/policy/common/utils/test/ExceptionsTester.java
index b4091080..3a43b943 100644
--- a/utils-test/src/main/java/org/onap/policy/common/utils/test/ExceptionsTester.java
+++ b/utils-test/src/main/java/org/onap/policy/common/utils/test/ExceptionsTester.java
@@ -46,7 +46,7 @@ public class ExceptionsTester extends ThrowablesTester {
* if the constructed objects fail to pass various tests
*/
public <T extends Exception> int test(Class<T> claz) {
- int ncons = testException(claz);
+ int ncons = testAllException(claz);
assertTrue(ncons > 0);
@@ -67,13 +67,13 @@ public class ExceptionsTester extends ThrowablesTester {
* @throws AssertionError
* if the constructed objects fail to pass various tests
*/
- public <T extends Exception> int testException(Class<T> claz) {
+ public <T extends Exception> int testAllException(Class<T> claz) {
int ncons = 0;
- ncons += testThrowable(claz);
- ncons += testException_Exception(claz);
- ncons += testException_StringException(claz);
- ncons += testException_StringExceptionBooleanBoolean(claz);
+ ncons += testAllThrowable(claz);
+ ncons += testException(claz);
+ ncons += testStringException(claz);
+ ncons += testStringExceptionBooleanBoolean(claz);
return ncons;
}
@@ -100,7 +100,7 @@ public class ExceptionsTester extends ThrowablesTester {
* @throws AssertionError
* if the constructed objects fail to pass various tests
*/
- public <T extends Exception> int testException_Exception(Class<T> claz) {
+ public <T extends Exception> int testException(Class<T> claz) {
Constructor<T> cons = getConstructor(claz, "exception", Exception.class);
if (cons == null) {
return 0;
@@ -137,7 +137,7 @@ public class ExceptionsTester extends ThrowablesTester {
* @throws ConstructionError
* if the Exception subclass cannot be constructed
*/
- public <T extends Exception> int testException_StringException(Class<T> claz) {
+ public <T extends Exception> int testStringException(Class<T> claz) {
Constructor<T> cons = getConstructor(claz, "string-exception", String.class, Exception.class);
if (cons == null) {
return 0;
@@ -176,7 +176,7 @@ public class ExceptionsTester extends ThrowablesTester {
* @throws ConstructionError
* if the Exception subclass cannot be constructed
*/
- public <T extends Exception> int testException_StringExceptionBooleanBoolean(Class<T> claz) {
+ public <T extends Exception> int testStringExceptionBooleanBoolean(Class<T> claz) {
Constructor<T> cons = getConstructor(claz, "string-exception-flags", String.class, Exception.class,
Boolean.TYPE, Boolean.TYPE);
if (cons == null) {
@@ -184,10 +184,10 @@ public class ExceptionsTester extends ThrowablesTester {
}
// test each combination of "message" and "cause"
- testThrowable_MessageCauseCombos(cons);
+ testMessageCauseCombos(cons);
// test each combination of the boolean flags
- testThrowable_FlagCombos(cons);
+ testFlagCombos(cons);
return 1;
}
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 <T extends Throwable> int testThrowable(Class<T> claz) {
+ public final <T extends Throwable> int testAllThrowable(Class<T> 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 <T extends Throwable> int testThrowable_Default(Class<T> claz) {
+ public final <T extends Throwable> int testDefault(Class<T> claz) {
Constructor<T> 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 <T extends Throwable> int testThrowable_StringConstuctor(Class<T> claz) {
+ public final <T extends Throwable> int testString(Class<T> claz) {
Constructor<T> 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 <T extends Throwable> int testThrowable_Throwable(Class<T> claz) {
+ public final <T extends Throwable> int testThrowable(Class<T> claz) {
Constructor<T> 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 <T extends Throwable> int testThrowable_StringThrowable(Class<T> claz) {
+ public final <T extends Throwable> int testStringThrowable(Class<T> claz) {
Constructor<T> 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 <T extends Throwable> int testThrowable_StringThrowableBooleanBoolean(Class<T> claz) {
+ public final <T extends Throwable> int testStringThrowableBooleanBoolean(Class<T> claz) {
Constructor<T> 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 <T extends Throwable> void testThrowable_MessageCauseCombos(Constructor<T> cons) {
+ public final <T extends Throwable> void testMessageCauseCombos(Constructor<T> 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 <T extends Throwable> void testThrowable_FlagCombos(Constructor<T> cons) {
- testThrowable_SuppressStack(cons);
- testThrowable_SuppressNoStack(cons);
- testThrowable_NoSuppressStack(cons);
- testThrowable_NoSuppressNoStack(cons);
+ public final <T extends Throwable> void testFlagCombos(Constructor<T> 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 <T extends Throwable> void testThrowable_SuppressStack(Constructor<T> cons) {
+ public final <T extends Throwable> void testSuppressStack(Constructor<T> 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 <T extends Throwable> void testThrowable_SuppressNoStack(Constructor<T> cons) {
+ public final <T extends Throwable> void testSuppressNoStack(Constructor<T> 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 <T extends Throwable> void testThrowable_NoSuppressStack(Constructor<T> cons) {
+ public final <T extends Throwable> void testNoSuppressStack(Constructor<T> 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 <T extends Throwable> void testThrowable_NoSuppressNoStack(Constructor<T> cons) {
+ public final <T extends Throwable> void testNoSuppressNoStack(Constructor<T> cons) {
T ex = newInstance(cons, "no,no", CAUSE, false, false);
ex.addSuppressed(SUPPRESSED);
diff --git a/utils-test/src/test/java/org/onap/policy/common/utils/test/ConstructionErrorTest.java b/utils-test/src/test/java/org/onap/policy/common/utils/test/ConstructionErrorTest.java
index e88180b9..27387bfd 100644
--- a/utils-test/src/test/java/org/onap/policy/common/utils/test/ConstructionErrorTest.java
+++ b/utils-test/src/test/java/org/onap/policy/common/utils/test/ConstructionErrorTest.java
@@ -31,7 +31,7 @@ public class ConstructionErrorTest extends ErrorsTester {
@Test
public void test() throws Exception {
- assertEquals(4, testError(ConstructionError.class));
+ assertEquals(4, testAllError(ConstructionError.class));
}
}
diff --git a/utils-test/src/test/java/org/onap/policy/common/utils/test/ErrorsTesterTest.java b/utils-test/src/test/java/org/onap/policy/common/utils/test/ErrorsTesterTest.java
index 2d76f750..60aed22d 100644
--- a/utils-test/src/test/java/org/onap/policy/common/utils/test/ErrorsTesterTest.java
+++ b/utils-test/src/test/java/org/onap/policy/common/utils/test/ErrorsTesterTest.java
@@ -28,8 +28,8 @@ public class ErrorsTesterTest {
@Test
public void test() {
- assertEquals(2, new ErrorsTester().testError(SimpleError.class));
- assertEquals(5, new ErrorsTester().testError(StaticError.class));
+ assertEquals(2, new ErrorsTester().testAllError(SimpleError.class));
+ assertEquals(5, new ErrorsTester().testAllError(StaticError.class));
}
/**
diff --git a/utils-test/src/test/java/org/onap/policy/common/utils/test/ThrowablesTesterTest.java b/utils-test/src/test/java/org/onap/policy/common/utils/test/ThrowablesTesterTest.java
index ea79dba8..cb8c0ef6 100644
--- a/utils-test/src/test/java/org/onap/policy/common/utils/test/ThrowablesTesterTest.java
+++ b/utils-test/src/test/java/org/onap/policy/common/utils/test/ThrowablesTesterTest.java
@@ -28,50 +28,50 @@ public class ThrowablesTesterTest {
@Test
public void test() {
- assertEquals(2, new ThrowablesTester().testThrowable(SimpleThrowable.class));
- assertEquals(5, new ThrowablesTester().testThrowable(StaticThrowable.class));
+ assertEquals(2, new ThrowablesTester().testAllThrowable(SimpleThrowable.class));
+ assertEquals(5, new ThrowablesTester().testAllThrowable(StaticThrowable.class));
}
@Test
public void testNoConstructorsThrowable() {
// this will not throw an error, but it should return 0, as there are
// no matching constructors
- assertEquals(0, new ThrowablesTester().testThrowable(NoConstructorsThrowable.class));
+ assertEquals(0, new ThrowablesTester().testAllThrowable(NoConstructorsThrowable.class));
}
@Test(expected = AssertionError.class)
public void testIgnoreMessageThrowable() {
- new ThrowablesTester().testThrowable(IgnoreMessageThrowable.class);
+ new ThrowablesTester().testAllThrowable(IgnoreMessageThrowable.class);
}
@Test(expected = AssertionError.class)
public void testIgnoreCauseThrowable() {
- new ThrowablesTester().testThrowable(IgnoreCauseThrowable.class);
+ new ThrowablesTester().testAllThrowable(IgnoreCauseThrowable.class);
}
@Test(expected = AssertionError.class)
public void testAlwaysSuppressThrowable() {
- new ThrowablesTester().testThrowable(AlwaysSuppressThrowable.class);
+ new ThrowablesTester().testAllThrowable(AlwaysSuppressThrowable.class);
}
@Test(expected = AssertionError.class)
public void testNeverSuppressThrowable() {
- new ThrowablesTester().testThrowable(NeverSuppressThrowable.class);
+ new ThrowablesTester().testAllThrowable(NeverSuppressThrowable.class);
}
@Test(expected = AssertionError.class)
public void testAlwaysWritableThrowable() {
- new ThrowablesTester().testThrowable(AlwaysWritableThrowable.class);
+ new ThrowablesTester().testAllThrowable(AlwaysWritableThrowable.class);
}
@Test(expected = AssertionError.class)
public void testNeverWritableThrowable() {
- new ThrowablesTester().testThrowable(NeverWritableThrowable.class);
+ new ThrowablesTester().testAllThrowable(NeverWritableThrowable.class);
}
@Test(expected = ConstructionError.class)
public void testThrowInstantiationException() {
- new ThrowablesTester().testThrowable(ThrowInstantiationException.class);
+ new ThrowablesTester().testAllThrowable(ThrowInstantiationException.class);
}
/**