summaryrefslogtreecommitdiffstats
path: root/cmso-sonar/src
diff options
context:
space:
mode:
authorJerry Flood <jflood@att.com>2019-04-19 07:09:34 -0400
committerJerry Flood <jflood@att.com>2019-04-19 10:07:39 -0400
commit9407eccc5c8347c7c92d2f25590d8867213107aa (patch)
treecf97b388f99b64bac36e60ac95147fd933380116 /cmso-sonar/src
parentee1816bf02d5f76548b78c46c39537ec8c1d23b0 (diff)
Rename classes to avoid duplicates
Copy jacoco exec files for upload to sonar Handle ending midnight in time window Issue-ID: OPTFRA-474 Change-Id: Id5df25e404a08e039537e4eb987838835ee12f11 Signed-off-by: Jerry Flood <jflood@att.com>
Diffstat (limited to 'cmso-sonar/src')
-rw-r--r--cmso-sonar/src/test/java/org/onap/optf/cmso/it/IT_FullIntegrationTest.java22
-rw-r--r--cmso-sonar/src/test/resources/integration.properties6
2 files changed, 26 insertions, 2 deletions
diff --git a/cmso-sonar/src/test/java/org/onap/optf/cmso/it/IT_FullIntegrationTest.java b/cmso-sonar/src/test/java/org/onap/optf/cmso/it/IT_FullIntegrationTest.java
index d90d85d..063a9b4 100644
--- a/cmso-sonar/src/test/java/org/onap/optf/cmso/it/IT_FullIntegrationTest.java
+++ b/cmso-sonar/src/test/java/org/onap/optf/cmso/it/IT_FullIntegrationTest.java
@@ -48,6 +48,7 @@ public class IT_FullIntegrationTest {
System.out.println("stderr=" + stderr);
copyJacocoFiles();
copyClassFiles();
+ copyForSonar();
} catch (Exception e) {
e.printStackTrace();
} finally {
@@ -57,6 +58,27 @@ public class IT_FullIntegrationTest {
}
}
+ private void copyForSonar() throws IOException {
+ String[] jacocoFiles = env.getProperty("copy.jacoco.for.sonar").split(",");
+ for (String jacocoFile : jacocoFiles) {
+ String[] parts = jacocoFile.split("\\|");
+ if (parts.length == 2) {
+ File source = new File(parts[0]);
+ File dest = new File(parts[1]);
+ if (source.exists() && source.isFile() && dest.getParentFile().isDirectory()) {
+ Path srcFile = Paths.get(source.getAbsolutePath());
+ Path dstFile = Paths.get(dest.getAbsolutePath());
+ Files.copy(srcFile, dstFile, StandardCopyOption.REPLACE_EXISTING);
+ } else {
+ System.out.println("Skipping " + jacocoFile);
+ }
+ } else {
+ System.out.println("Skipping " + jacocoFile);
+ }
+
+ }
+ }
+
private void copyClassFiles() throws IOException {
File dest = new File(env.getProperty("jacoco.exec.classes"));
dest.mkdirs();
diff --git a/cmso-sonar/src/test/resources/integration.properties b/cmso-sonar/src/test/resources/integration.properties
index 7d2f84c..48957a0 100644
--- a/cmso-sonar/src/test/resources/integration.properties
+++ b/cmso-sonar/src/test/resources/integration.properties
@@ -1,5 +1,7 @@
base.path=./
jacoco.exec.dest=target/code-coverage
jacoco.exec.classes=target/classes
-source.classes.folders=service|../cmso-service/target/classes,optimizer
-jacoco.exec.source.files=docker/integration/cmso-service/logs/service.jacoco.exec,docker/integration/cmso-service/logs/optimizer.jacoco.exec \ No newline at end of file
+source.classes.folders=service|../cmso-service/target/classes,optimizer|../cmso-optimizer/target/classes
+jacoco.exec.source.files=docker/integration/cmso-service/logs/service.jacoco.exec,docker/integration/cmso-optimizer/logs/optimizer.jacoco.exec
+
+copy.jacoco.for.sonar=docker/integration/cmso-service/logs/service.jacoco.exec|../cmso-service/target/jacoco-it.exec,docker/integration/cmso-optimizer/logs/optimizer.jacoco.exec|../cmso-optimizer/target/jacoco-it.exec \ No newline at end of file