summaryrefslogtreecommitdiffstats
path: root/utils-test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-02-09 12:20:56 -0500
committerJim Hahn <jrh3@att.com>2018-02-10 17:04:33 -0500
commit86664073b5a778c56e831d64b3a1883818af0ffe (patch)
tree9842efab59b2737c48c0aa1b0763f802fc708a9b /utils-test
parente9fd35a303a5f5f41726c3216c8acd7598a3a494 (diff)
Add AutoClose wrappers for JPA classes
Added EntityMgrCloser and EntityMgrTrans classes that will automatically close/rollback the wrapped JPA classes. As a result, these classes can be used in try-with-resource statements to ensure that the JPA EntityTransaction is rolled back and the EntityManager is closed. Add "build" section into pom to make it consistent with other poms in common. Changed scope to "provided" in utils pom for javax.persistence to prevent clashes with other projects that depend on the utils project. Changed scope to "test" in utils pom and to "provided" in utils-test pom for junit. Fixed license date in EntityTransCloser. Fixed license titles in utils & utils-test source files. Moved files from package xxx.test.jpa to package xxx.jpa, because they are not test-specific classes. Include exception when logging message in ThrowablesTester, hopefully eliminating sonar complaint. Change-Id: I531f20d93a679d4bb432c1d75c1feac0e334bc44 Issue-ID: POLICY-582 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'utils-test')
-rw-r--r--utils-test/pom.xml1
-rw-r--r--utils-test/src/main/java/org/onap/policy/common/utils/test/ConstructionError.java2
-rw-r--r--utils-test/src/main/java/org/onap/policy/common/utils/test/ErrorsTester.java2
-rw-r--r--utils-test/src/main/java/org/onap/policy/common/utils/test/ExceptionsTester.java2
-rw-r--r--utils-test/src/main/java/org/onap/policy/common/utils/test/ThrowablesTester.java4
-rw-r--r--utils-test/src/main/java/org/onap/policy/common/utils/test/log/logback/ExtractAppender.java2
-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.java2
-rw-r--r--utils-test/src/test/java/org/onap/policy/common/utils/test/ExceptionsTesterTest.java2
-rw-r--r--utils-test/src/test/java/org/onap/policy/common/utils/test/ThrowablesTesterTest.java2
-rw-r--r--utils-test/src/test/java/org/onap/policy/common/utils/test/log/logback/ExtractAppenderTest.java2
-rw-r--r--utils-test/src/test/resources/logback-test.xml2
12 files changed, 13 insertions, 12 deletions
diff --git a/utils-test/pom.xml b/utils-test/pom.xml
index 31a27367..7df85eb1 100644
--- a/utils-test/pom.xml
+++ b/utils-test/pom.xml
@@ -37,6 +37,7 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
diff --git a/utils-test/src/main/java/org/onap/policy/common/utils/test/ConstructionError.java b/utils-test/src/main/java/org/onap/policy/common/utils/test/ConstructionError.java
index 336dc602..2cab0f90 100644
--- a/utils-test/src/main/java/org/onap/policy/common/utils/test/ConstructionError.java
+++ b/utils-test/src/main/java/org/onap/policy/common/utils/test/ConstructionError.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Integrity Audit
+ * Common Utils-Test
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
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 12b48442..1a69e58c 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
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Integrity Monitor
+ * Common Utils-Test
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
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 156fca89..b4091080 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
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Integrity Monitor
+ * Common Utils-Test
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
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 bd8db4fc..8c997d56 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
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Integrity Monitor
+ * Common Utils-Test
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
@@ -485,7 +485,7 @@ public class ThrowablesTester {
} catch (NoSuchMethodException | SecurityException e) {
// this constructor is not defined so nothing to test
- logger.debug("skipped test due to no " + testType + " constructor for: " + claz);
+ logger.debug("skipped test, no constructor for: " + claz + " due to: " + e);
return null;
}
}
diff --git a/utils-test/src/main/java/org/onap/policy/common/utils/test/log/logback/ExtractAppender.java b/utils-test/src/main/java/org/onap/policy/common/utils/test/log/logback/ExtractAppender.java
index f012464c..13031cfd 100644
--- a/utils-test/src/main/java/org/onap/policy/common/utils/test/log/logback/ExtractAppender.java
+++ b/utils-test/src/main/java/org/onap/policy/common/utils/test/log/logback/ExtractAppender.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Integrity Audit
+ * Common Utils-Test
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
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 4a6cd90e..e88180b9 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
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Integrity Audit
+ * Common Utils-Test
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
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 ae684d52..2d76f750 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
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Integrity Monitor
+ * Common Utils-Test
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
diff --git a/utils-test/src/test/java/org/onap/policy/common/utils/test/ExceptionsTesterTest.java b/utils-test/src/test/java/org/onap/policy/common/utils/test/ExceptionsTesterTest.java
index 3848acd0..b9975227 100644
--- a/utils-test/src/test/java/org/onap/policy/common/utils/test/ExceptionsTesterTest.java
+++ b/utils-test/src/test/java/org/onap/policy/common/utils/test/ExceptionsTesterTest.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Integrity Monitor
+ * Common Utils-Test
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
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 cb96e98f..ea79dba8 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
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Integrity Monitor
+ * Common Utils-Test
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
diff --git a/utils-test/src/test/java/org/onap/policy/common/utils/test/log/logback/ExtractAppenderTest.java b/utils-test/src/test/java/org/onap/policy/common/utils/test/log/logback/ExtractAppenderTest.java
index a9a69252..6ef36822 100644
--- a/utils-test/src/test/java/org/onap/policy/common/utils/test/log/logback/ExtractAppenderTest.java
+++ b/utils-test/src/test/java/org/onap/policy/common/utils/test/log/logback/ExtractAppenderTest.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Integrity Audit
+ * Common Utils-Test
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
diff --git a/utils-test/src/test/resources/logback-test.xml b/utils-test/src/test/resources/logback-test.xml
index 20869a43..c99cd4a6 100644
--- a/utils-test/src/test/resources/logback-test.xml
+++ b/utils-test/src/test/resources/logback-test.xml
@@ -1,6 +1,6 @@
<!--
============LICENSE_START=======================================================
- integrity-monitor
+ ONAP Policy Engine - Common Modules
================================================================================
Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
================================================================================
t; <artifactId>maven-source-plugin</artifactId> <version>3.0.1</version> <executions> <execution> <id>attach-sources</id> <phase>deploy</phase> <goals> <goal>jar-no-fork</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.2</version> </plugin> <plugin> <groupId>com.mycila</groupId> <artifactId>license-maven-plugin</artifactId> <version>3.0</version> <configuration> <header>LICENSE.TXT</header> <includes> <include>src/main/java/**</include> <include>src/test/java/**</include> <include>pom.xml</include> </includes> <skipExistingHeaders>true</skipExistingHeaders> <skip>false</skip> </configuration> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <version>3.6</version> <configuration> <reportPlugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.4</version> <configuration> <dependencyDetailsEnabled>false</dependencyDetailsEnabled> <dependencyLocationsEnabled>false</dependencyLocationsEnabled> </configuration> <reports> <report>dependencies</report> </reports> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.8</version> <configuration> <additionalparam>-Xdoclint:none</additionalparam> </configuration> </plugin> </reportPlugins> </configuration> <dependencies> <dependency> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-webdav-jackrabbit</artifactId> <version>2.10</version> </dependency> </dependencies> </plugin> <plugin> <groupId>com.mycila</groupId> <artifactId>license-maven-plugin</artifactId> </plugin> </plugins> </build> <distributionManagement> <repository> <id>${onap.nexus.release.id}</id> <name>ECOMP Release Repository</name> <url>${onap.nexus.url}${onap.nexus.release.path}</url> </repository> <snapshotRepository> <id>${onap.nexus.snapshot.id}</id> <name>ECOMP Snapshot Repository</name> <url>${onap.nexus.url}${onap.nexus.snapshot.path}</url> </snapshotRepository> <site> <id>ecomp-site</id> <url>dav:${onap.nexus.url}${sitePath}</url> </site> </distributionManagement> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.10.4</version> <configuration> <failOnError>false</failOnError> <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet> <docletArtifact> <groupId>org.umlgraph</groupId> <artifactId>umlgraph</artifactId> <version>5.6</version> </docletArtifact> <additionalparam>-views -Xdoclint:none</additionalparam> <excludePackageNames>org.onap.aai.domain.yang.*:org.onap.aai.util.*</excludePackageNames> <useStandardDocletOptions>true</useStandardDocletOptions> </configuration> </plugin> </plugins> </reporting> <!-- Start of ONAP Specific Repositories --> <repositories> <repository> <id>AJSC</id> <name>AJSC repository</name> <url>https://mvnrepository.com/artifact/com.att.ajsc</url> </repository> <repository> <id>restlet</id> <name>maven reslet</name> <url>https://maven.restlet.com/</url> </repository> <repository> <id>central</id> <name>Maven 2 repository 2</name> <url>http://repo2.maven.org/maven2/</url> </repository> <repository> <id>ecomp-releases</id> <name>ECOMP Release Repository</name> <url>${onap.nexus.url}/content/repositories/releases/</url> </repository> <repository> <id>ecomp-snapshots</id> <name>ECOMP Snapshot Repository</name> <url>${onap.nexus.url}/content/repositories/snapshots/</url> </repository> </repositories> <!-- End of ONAP Specific Repositories --> </project>