diff options
-rw-r--r-- | common-logging/pom.xml | 11 | ||||
-rw-r--r-- | integrity-audit/pom.xml | 39 | ||||
-rw-r--r-- | integrity-monitor/pom.xml | 45 | ||||
-rw-r--r-- | pom.xml | 53 | ||||
-rw-r--r-- | site-manager/pom.xml | 3 | ||||
-rw-r--r-- | utils-test/pom.xml | 2 | ||||
-rw-r--r-- | utils-test/src/main/java/org/onap/policy/common/utils/test/ErrorsTester.java | 4 | ||||
-rw-r--r-- | utils-test/src/main/java/org/onap/policy/common/utils/test/ExceptionsTester.java | 22 | ||||
-rw-r--r-- | utils-test/src/main/java/org/onap/policy/common/utils/test/ThrowablesTester.java | 52 | ||||
-rw-r--r-- | utils-test/src/test/java/org/onap/policy/common/utils/test/ConstructionErrorTest.java | 2 | ||||
-rw-r--r-- | utils-test/src/test/java/org/onap/policy/common/utils/test/ErrorsTesterTest.java | 4 | ||||
-rw-r--r-- | utils-test/src/test/java/org/onap/policy/common/utils/test/ThrowablesTesterTest.java | 20 | ||||
-rw-r--r-- | utils/pom.xml | 1 |
13 files changed, 147 insertions, 111 deletions
diff --git a/common-logging/pom.xml b/common-logging/pom.xml index 400434c1..26da3041 100644 --- a/common-logging/pom.xml +++ b/common-logging/pom.xml @@ -33,6 +33,11 @@ <packaging>jar</packaging> <dependencies> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>provided</scope> + </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> @@ -49,12 +54,6 @@ <artifactId>eelf-core</artifactId> <version>0.0.1</version> </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.17</version> - <scope>provided</scope> - </dependency> </dependencies> <build> diff --git a/integrity-audit/pom.xml b/integrity-audit/pom.xml index 413ee1dd..286842fe 100644 --- a/integrity-audit/pom.xml +++ b/integrity-audit/pom.xml @@ -37,53 +37,48 @@ <dependencies> <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.17</version> - </dependency> - <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.11</version> <scope>test</scope> </dependency> <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils</artifactId> - <version>${project.version}</version> - <scope>test</scope> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> </dependency> <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils-test</artifactId> - <version>${project.version}</version> - <scope>test</scope> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>javax.persistence</artifactId> - <version>2.1.0</version> </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>eclipselink</artifactId> - <version>2.6.0</version> </dependency> <dependency> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - <version>[1.4.186,)</version> + <groupId>org.onap.policy.common</groupId> + <artifactId>utils</artifactId> + <version>${project.version}</version> + <scope>test</scope> </dependency> <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - <version>3.4</version> + <groupId>org.onap.policy.common</groupId> + <artifactId>utils-test</artifactId> + <version>${project.version}</version> + <scope>test</scope> </dependency> <dependency> <groupId>org.onap.policy.common</groupId> <artifactId>ONAP-Logging</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.4</version> + </dependency> </dependencies> <build> diff --git a/integrity-monitor/pom.xml b/integrity-monitor/pom.xml index 4e69ccea..a5295b17 100644 --- a/integrity-monitor/pom.xml +++ b/integrity-monitor/pom.xml @@ -37,53 +37,48 @@ <dependencies> <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.17</version> - </dependency> - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.11</version> <scope>test</scope> </dependency> <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils-test</artifactId> - <version>${project.version}</version> - <scope>test</scope> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> </dependency> <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.1.3</version> - <scope>test</scope> - </dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>javax.persistence</artifactId> - <version>2.1.0</version> </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>eclipselink</artifactId> - <version>2.6.0</version> </dependency> <dependency> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - <version>[1.4.186,)</version> + <groupId>org.onap.policy.common</groupId> + <artifactId>utils</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.policy.common</groupId> + <artifactId>utils-test</artifactId> + <version>${project.version}</version> + <scope>test</scope> </dependency> <dependency> <groupId>org.onap.policy.common</groupId> <artifactId>ONAP-Logging</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1.3</version> + <scope>test</scope> + </dependency> </dependencies> <build> @@ -58,9 +58,24 @@ <sonar.jacoco.itReportPath>${project.basedir}/../target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath> <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis> - <!-- Project common dependency versions --> + <!-- + Shared between policy/* project repositories - same version + --> + <junit.version>4.12</junit.version> <logback.version>1.2.3</logback.version> + <log4j.version>1.2.17</log4j.version> + <javax.persistence.version>2.1.0</javax.persistence.version> + + <!-- + Shared between policy/* project repositories - different version + --> + <eclipselink.version>2.6.0</eclipselink.version> + <mariadb.jdbc.version>1.2.3</mariadb.jdbc.version> + + <!-- Project common dependency versions --> <javax.persistence.api.version>1.0.2</javax.persistence.api.version> + <h2.version>1.4.186</h2.version> + </properties> @@ -104,6 +119,42 @@ </repository> <!-- LF repositories END --> </repositories> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <version>${logback.version}</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junit.version}</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>${log4j.version}</version> + </dependency> + <dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + <version>${h2.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.eclipse.persistence</groupId> + <artifactId>javax.persistence</artifactId> + <version>${javax.persistence.version}</version> + </dependency> + <dependency> + <groupId>org.eclipse.persistence</groupId> + <artifactId>eclipselink</artifactId> + <version>${eclipselink.version}</version> + </dependency> + </dependencies> + </dependencyManagement> <build> <pluginManagement> diff --git a/site-manager/pom.xml b/site-manager/pom.xml index 8726825e..a30be04d 100644 --- a/site-manager/pom.xml +++ b/site-manager/pom.xml @@ -108,7 +108,6 @@ <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>javax.persistence</artifactId> - <version>2.1.0</version> </dependency> <dependency> <groupId>org.onap.policy.common</groupId> @@ -118,7 +117,7 @@ <dependency> <groupId>org.mariadb.jdbc</groupId> <artifactId>mariadb-java-client</artifactId> - <version>1.2.3</version> + <version>${mariadb.jdbc.version}</version> </dependency> <dependency> <groupId>commons-cli</groupId> diff --git a/utils-test/pom.xml b/utils-test/pom.xml index 7df85eb1..8e1a570a 100644 --- a/utils-test/pom.xml +++ b/utils-test/pom.xml @@ -36,13 +36,11 @@ <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.11</version> <scope>provided</scope> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> - <version>${logback.version}</version> </dependency> </dependencies> 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); } /** diff --git a/utils/pom.xml b/utils/pom.xml index a9aff9e4..27eeceb7 100644 --- a/utils/pom.xml +++ b/utils/pom.xml @@ -40,7 +40,6 @@ <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.11</version> <scope>test</scope> </dependency> <dependency> |