From bff565387a2f4c0c50566a87c77699480217459d Mon Sep 17 00:00:00 2001 From: Vijay Date: Thu, 14 Sep 2017 00:23:11 +0000 Subject: update to fix junit and coverage Issue-Id:DCAEGEN2-82 Change-Id: Ib43e0e5caaf7be9c07df68faf68f0af7ceb3a595 Signed-off-by: Vijay --- docker-build.sh | 4 +- pom.xml | 319 ++------------------- .../org/onap/dcae/vestest/InputJsonValidation.java | 6 +- .../onap/dcae/vestest/VESCollectorJunitTest.java | 19 +- 4 files changed, 49 insertions(+), 299 deletions(-) diff --git a/docker-build.sh b/docker-build.sh index 9f0b3926..6cb73bf7 100644 --- a/docker-build.sh +++ b/docker-build.sh @@ -91,7 +91,7 @@ cp -p ${APP_DIR}/Dockerfile ${STAGE}/Dockerfile # # build the docker image. tag and then push to the remote repo # -IMAGE='onap/dcaegen2-ves-collector' +IMAGE='onap/dcaegen2.ves.collector' VERSION="${VERSION//[^0-9.]/}" VERSION2=$(echo "$VERSION" | cut -f1-2 -d'.') @@ -136,6 +136,8 @@ STAGING|staging) ;; esac +#docker login "$REPO" -u "$IMAGE" -p "" + OLDTAG="${LFQI}" PUSHTAGS="${REPO}/${IMAGE}:${VERSION}${EXT}${TIMESTAMP} ${REPO}/${IMAGE}:latest ${REPO}/${IMAGE}:${VERSION2}${EXT}-latest" for NEWTAG in ${PUSHTAGS} diff --git a/pom.xml b/pom.xml index 5160bf85..fbbd3de0 100644 --- a/pom.xml +++ b/pom.xml @@ -2,11 +2,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - - org.onap.oparent - oparent - 1.0.0-SNAPSHOT - + + org.onap.oparent + oparent + 1.0.0-SNAPSHOT + org.onap.dcaegen2.collectors.ves VESCollector 1.1.4-SNAPSHOT @@ -17,13 +17,6 @@ 1.7 1.7 ${project.basedir} - 2.19.1 - 2.19.1 - 2.19.1 - 3.5 - 0.7.7.201606060606 - 3.0.2 - 2.16 3.3 2.4 2.8 @@ -35,23 +28,13 @@ - - false - true - true - - - ${project.build.directory}/coverage-reports/jacoco-it.exec - - ${project.build.directory}/coverage-reports/jacoco-ut.exec - false - - https://nexus.onap.org - content/repositories/snapshots/ - content/repositories/releases/ - content/sites/site/org/onap/dcaegen2/collectors/ves/${project.artifactId}/${project.version} + + https://nexus.onap.org + content/repositories/snapshots/ + content/repositories/releases/ + content/sites/site/org/onap/dcaegen2/collectors/ves/${project.artifactId}/${project.version} @@ -97,11 +80,8 @@ 1.0.10 - + org.slf4j @@ -189,68 +169,6 @@ - - - org.codehaus.mojo - findbugs-maven-plugin - ${findbugs.plugin.version} - - Max - Low - true - - ${findbugs.failOnError} - - ${project.reporting.outputDirectory}/findbugs - ${project.reporting.outputDirectory}/findbugs - - - - - analyze-compile - compile - - check - - - - - - - - maven-assembly-plugin @@ -301,155 +219,6 @@ - - - org.jacoco - jacoco-maven-plugin - ${jacoco.plugin.version} - - - - - pre-unit-test - - prepare-agent - - - ${jacoco.ut.execution.data.file} - surefireArgLine - - - - - post-unit-test - test - - report - - - ${jacoco.ut.execution.data.file} - ${project.reporting.outputDirectory}/jacoco-ut - - - - - pre-integration-test - pre-integration-test - - prepare-agent - - - ${jacoco.it.execution.data.file} - failsafeArgLine - - - - - post-integration-test - post-integration-test - - report - - - ${jacoco.it.execution.data.file} - ${project.reporting.outputDirectory}/jacoco-it - - - - - - - org.apache.maven.plugins - maven-pmd-plugin - ${pmd.plugin.version} - - ${project.build.sourceEncoding} - ${compiler.target.version} - false - - ${pmd.violation.buildfail} - ${project.reporting.outputDirectory}/pmd - - - - pmd-check - - check - - - true - ${main.basedir}/pmd-exclude.properties - - - - cpd-check - - - - - true - - - - - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${failsafe.plugin.version} - - - integration-tests - - integration-test - verify - - - ${skip.integration.tests} - - - ${failsafeArgLine} - - - - - - - - com.blackducksoftware.integration - hub-maven-plugin - 1.4.0 - false - - ${project.name} - ${project.basedir} - - - - create-bdio-file - package - - createHubOutput - - - - org.codehaus.mojo exec-maven-plugin @@ -485,24 +254,7 @@ maven-jar-plugin - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - - org.jacoco - jacoco-maven-plugin - - - - com.blackducksoftware.integration - hub-maven-plugin - - + org.apache.maven.plugins maven-source-plugin @@ -513,19 +265,10 @@ maven-javadoc-plugin - - org.apache.maven.plugins - maven-pmd-plugin - - maven-assembly-plugin - - org.codehaus.mojo @@ -545,6 +288,19 @@ + + install script + install + + exec + + + + __ + install + + + @@ -588,27 +344,6 @@ - - - + diff --git a/src/test/java/org/onap/dcae/vestest/InputJsonValidation.java b/src/test/java/org/onap/dcae/vestest/InputJsonValidation.java index 0913608a..336cb92f 100644 --- a/src/test/java/org/onap/dcae/vestest/InputJsonValidation.java +++ b/src/test/java/org/onap/dcae/vestest/InputJsonValidation.java @@ -63,7 +63,7 @@ public class InputJsonValidation { String schema=null; try { - schema = new JsonParser().parse(new FileReader(VESCollectorJunitTest.schemaFile)).toString(); + schema = new JsonParser().parse(new FileReader("etc/CommonEventFormat_27.2.json")).toString(); //System.out.println("Schema value: " + schema.toString()); } catch (JsonIOException e) { // TODO Auto-generated catch block @@ -108,7 +108,8 @@ public class InputJsonValidation { String schema=null; try { - schema = new JsonParser().parse(new FileReader(VESCollectorJunitTest.schemaFile)).toString(); + System.out.println("XX debug" + VESCollectorJunitTest.schemaFile); + schema = new JsonParser().parse(new FileReader("etc/CommonEventFormat_27.2.json")).toString(); } catch (JsonIOException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -167,3 +168,4 @@ public class InputJsonValidation { } } + diff --git a/src/test/java/org/onap/dcae/vestest/VESCollectorJunitTest.java b/src/test/java/org/onap/dcae/vestest/VESCollectorJunitTest.java index 0e737175..eb1ebfde 100644 --- a/src/test/java/org/onap/dcae/vestest/VESCollectorJunitTest.java +++ b/src/test/java/org/onap/dcae/vestest/VESCollectorJunitTest.java @@ -32,10 +32,11 @@ import java.io.IOException; import java.io.InputStream; import java.util.Properties; +import org.json.JSONObject; import org.junit.Test; public class VESCollectorJunitTest { - public static String schemaFile=null; + public static String schemaFile="etc/CommonEventFormat_27.2.json"; public static String output; @@ -53,8 +54,12 @@ public class VESCollectorJunitTest { input = new FileInputStream("etc/collector.properties"); try { prop.load(input); - schemaFile=prop.getProperty("collector.schema.file"); + //schemaFile=prop.getProperty("collector.schema.file"); + JSONObject schemaFileJson = new JSONObject(prop.getProperty("collector.schema.file")); + System.out.println("JSON Schemafile" + schemaFileJson); + //schemaFile = schemaFileJson.getString("v4"); + System.out.println( "Schema file location: "+ schemaFile); } catch (IOException e) { // TODO Auto-generated catch block @@ -65,7 +70,7 @@ public class VESCollectorJunitTest { e.printStackTrace(); } - assertEquals(message,output); + assertEquals("true",output); } @@ -78,8 +83,13 @@ public class VESCollectorJunitTest { input = new FileInputStream("etc/collector.properties"); try { prop.load(input); - schemaFile=prop.getProperty("collector.schema.file"); + + //schemaFile=prop.getProperty("collector.schema.file"); + JSONObject schemaFileJson = new JSONObject(prop.getProperty("collector.schema.file")); + System.out.println("JSON Schemafile" + schemaFileJson); + //schemaFile = schemaFileJson.getString("v4"); + System.out.println( "Schema file location: "+ schemaFile); } catch (IOException e) { // TODO Auto-generated catch block @@ -107,3 +117,4 @@ public class VESCollectorJunitTest { } + -- cgit 1.2.3-korg