diff --git a/dependency-check-maven/src/it/617-hierarchical-cross-deps/postbuild.groovy b/dependency-check-maven/src/it/617-hierarchical-cross-deps/postbuild.groovy index 09ea6f264..007821d3e 100644 --- a/dependency-check-maven/src/it/617-hierarchical-cross-deps/postbuild.groovy +++ b/dependency-check-maven/src/it/617-hierarchical-cross-deps/postbuild.groovy @@ -16,13 +16,4 @@ * Copyright (c) 2014 Jeremy Long. All Rights Reserved. */ -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang.StringUtils; - -// Save NVD-CVE for next IT (if not already done) -File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db"); -File datasSave = new File("target/nvd-cve-backup", "dc.h2.db"); -if (datasDwl.exists() && !datasSave.exists()){ - System.out.println("Save NVD-CVE into backup"); - FileUtils.copyFile(datasDwl, datasSave); -} +return true; \ No newline at end of file diff --git a/dependency-check-maven/src/it/617-hierarchical-cross-deps/prebuild.groovy b/dependency-check-maven/src/it/617-hierarchical-cross-deps/prebuild.groovy index c1e9eda11..9eff4bb5c 100644 --- a/dependency-check-maven/src/it/617-hierarchical-cross-deps/prebuild.groovy +++ b/dependency-check-maven/src/it/617-hierarchical-cross-deps/prebuild.groovy @@ -15,14 +15,3 @@ * * Copyright (c) 2014 Jeremy Long. All Rights Reserved. */ - -import org.apache.commons.io.FileUtils; - -// Load NVD-CVE if not exist and had been saved in a previous IT -File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db"); -File datasSave = new File("target/nvd-cve-backup", "dc.h2.db"); - -if (!datasDwl.exists() && datasSave.exists()){ - System.out.println("Load NVD-CVE from backup"); - FileUtils.copyFile(datasSave, datasDwl); -} diff --git a/dependency-check-maven/src/it/618-aggregator-purge/postbuild.groovy b/dependency-check-maven/src/it/618-aggregator-purge/postbuild.groovy index 77ed8d9d6..bf3b3246e 100644 --- a/dependency-check-maven/src/it/618-aggregator-purge/postbuild.groovy +++ b/dependency-check-maven/src/it/618-aggregator-purge/postbuild.groovy @@ -27,3 +27,4 @@ if (!StringUtils.contains(log, "Database file purged; local copy of the NVD has System.out.println("The database was not purged."); return false; } +return true; \ No newline at end of file diff --git a/dependency-check-maven/src/it/618-aggregator-update-only/postbuild.groovy b/dependency-check-maven/src/it/618-aggregator-update-only/postbuild.groovy index 389ddb710..a3aa62c8e 100644 --- a/dependency-check-maven/src/it/618-aggregator-update-only/postbuild.groovy +++ b/dependency-check-maven/src/it/618-aggregator-update-only/postbuild.groovy @@ -20,19 +20,11 @@ import java.nio.charset.Charset; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; -// Save NVD-CVE for next IT (if not already done) -File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db"); -File datasSave = new File("target/nvd-cve-backup", "dc.h2.db"); -if (datasDwl.exists() && !datasSave.exists()){ - System.out.println("Save NVD-CVE into backup"); - FileUtils.copyFile(datasDwl, datasSave); -} - // Analyse number of "Checking for updates" String log = FileUtils.readFileToString(new File(basedir, "build.log"), Charset.defaultCharset().name()); int count = StringUtils.countMatches(log, "Checking for updates"); if (count > 1){ System.out.println(String.format("The update should be unique, it is %s", count)); return false; - //throw new Exception(String.format("The update should be unique, it is %s", count)); } +return true; diff --git a/dependency-check-maven/src/it/618-aggregator-update-only/prebuild.groovy b/dependency-check-maven/src/it/618-aggregator-update-only/prebuild.groovy index c1e9eda11..3071d8668 100644 --- a/dependency-check-maven/src/it/618-aggregator-update-only/prebuild.groovy +++ b/dependency-check-maven/src/it/618-aggregator-update-only/prebuild.groovy @@ -16,13 +16,3 @@ * Copyright (c) 2014 Jeremy Long. All Rights Reserved. */ -import org.apache.commons.io.FileUtils; - -// Load NVD-CVE if not exist and had been saved in a previous IT -File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db"); -File datasSave = new File("target/nvd-cve-backup", "dc.h2.db"); - -if (!datasDwl.exists() && datasSave.exists()){ - System.out.println("Load NVD-CVE from backup"); - FileUtils.copyFile(datasSave, datasDwl); -} diff --git a/dependency-check-maven/src/it/629-jackson-dataformat/postbuild.groovy b/dependency-check-maven/src/it/629-jackson-dataformat/postbuild.groovy index 17401a332..acb7cb3a5 100644 --- a/dependency-check-maven/src/it/629-jackson-dataformat/postbuild.groovy +++ b/dependency-check-maven/src/it/629-jackson-dataformat/postbuild.groovy @@ -19,16 +19,6 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import java.nio.charset.Charset; - -// Save NVD-CVE for next IT (if not already done) -File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db"); -File datasSave = new File("target/nvd-cve-backup", "dc.h2.db"); -if (datasDwl.exists() && !datasSave.exists()){ - System.out.println("Save NVD-CVE into backup"); - FileUtils.copyFile(datasDwl, datasSave); -} - - // Check to see if jackson-dataformat-xml-2.4.5.jar was identified. @@ -36,7 +26,7 @@ if (datasDwl.exists() && !datasSave.exists()){ String log = FileUtils.readFileToString(new File(basedir, "target/dependency-check-report.xml"), Charset.defaultCharset().name()); int count = StringUtils.countMatches(log, "jackson-dataformat-xml-2.4.5.jar"); if (count == 0){ - System.out.println(String.format("The update should be unique, it is %s", count)); + System.out.println(String.format("jackson-dataformat-xml was identified %s times, expected 1", count)); return false; - //throw new Exception(String.format("The update should be unique, it is %s", count)); } +return true; diff --git a/dependency-check-maven/src/it/629-jackson-dataformat/prebuild.groovy b/dependency-check-maven/src/it/629-jackson-dataformat/prebuild.groovy index c1e9eda11..9eff4bb5c 100644 --- a/dependency-check-maven/src/it/629-jackson-dataformat/prebuild.groovy +++ b/dependency-check-maven/src/it/629-jackson-dataformat/prebuild.groovy @@ -15,14 +15,3 @@ * * Copyright (c) 2014 Jeremy Long. All Rights Reserved. */ - -import org.apache.commons.io.FileUtils; - -// Load NVD-CVE if not exist and had been saved in a previous IT -File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db"); -File datasSave = new File("target/nvd-cve-backup", "dc.h2.db"); - -if (!datasDwl.exists() && datasSave.exists()){ - System.out.println("Load NVD-CVE from backup"); - FileUtils.copyFile(datasSave, datasDwl); -} diff --git a/dependency-check-maven/src/it/690-threadsafety/postbuild.groovy b/dependency-check-maven/src/it/690-threadsafety/postbuild.groovy index 09ea6f264..8c1b639fa 100644 --- a/dependency-check-maven/src/it/690-threadsafety/postbuild.groovy +++ b/dependency-check-maven/src/it/690-threadsafety/postbuild.groovy @@ -16,13 +16,14 @@ * Copyright (c) 2014 Jeremy Long. All Rights Reserved. */ +import java.nio.charset.Charset; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; -// Save NVD-CVE for next IT (if not already done) -File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db"); -File datasSave = new File("target/nvd-cve-backup", "dc.h2.db"); -if (datasDwl.exists() && !datasSave.exists()){ - System.out.println("Save NVD-CVE into backup"); - FileUtils.copyFile(datasDwl, datasSave); +String log = FileUtils.readFileToString(new File(basedir, "build.log"), Charset.defaultCharset().name()); +int count = StringUtils.countMatches(log, "Download Started for NVD CVE - 2002"); +if (count > 1){ + System.out.println(String.format("NVD CVE was downloaded %s times, should be 0 or 1 times", count)); + return false; } +return true; \ No newline at end of file diff --git a/dependency-check-maven/src/it/690-threadsafety/prebuild.groovy b/dependency-check-maven/src/it/690-threadsafety/prebuild.groovy index c1e9eda11..9eff4bb5c 100644 --- a/dependency-check-maven/src/it/690-threadsafety/prebuild.groovy +++ b/dependency-check-maven/src/it/690-threadsafety/prebuild.groovy @@ -15,14 +15,3 @@ * * Copyright (c) 2014 Jeremy Long. All Rights Reserved. */ - -import org.apache.commons.io.FileUtils; - -// Load NVD-CVE if not exist and had been saved in a previous IT -File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db"); -File datasSave = new File("target/nvd-cve-backup", "dc.h2.db"); - -if (!datasDwl.exists() && datasSave.exists()){ - System.out.println("Load NVD-CVE from backup"); - FileUtils.copyFile(datasSave, datasDwl); -}