summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorRam Krishna Verma <ram_krishna.verma@bell.ca>2020-06-15 13:43:40 +0000
committerGerrit Code Review <gerrit@onap.org>2020-06-15 13:43:40 +0000
commit73470fb02d3d8a2fb37e80d9fb23a75955da32b5 (patch)
tree6460addf563cefb9264f7dd4fd3a847238b862cd /testsuites
parent808600494c5cd0f7b83460dac45d12b3ca14fd57 (diff)
parent718a1611a1e580ed7874088e1a0e013416334989 (diff)
Merge "Improve robustness of unit testing"
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGenerator.java3
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java5
2 files changed, 4 insertions, 4 deletions
diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGenerator.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGenerator.java
index 36d6add43..3f6cad8e7 100644
--- a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGenerator.java
+++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGenerator.java
@@ -23,6 +23,7 @@ package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator;
import java.io.IOException;
import java.net.URI;
+import java.nio.file.InvalidPathException;
import java.util.Arrays;
import org.apache.commons.cli.ParseException;
@@ -104,7 +105,7 @@ public class EventGenerator {
if (parameters.getOutFile() != null) {
try {
TextFileUtils.putStringAsTextFile(getEventGenerationStats(), parameters.getOutFile());
- } catch (IOException ioe) {
+ } catch (IOException | InvalidPathException ioe) {
LOGGER.warn("could not output statistics to file \"" + parameters.getOutFile() + "\"", ioe);
}
}
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java
index 3d37b3f4c..dcbafba07 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java
@@ -140,7 +140,7 @@ public class EventGeneratorTest {
@Test
public void testEventGeneratorOutfileBad() {
EventGeneratorParameters pars = new EventGeneratorParameters();
- pars.setOutFile("/I/Dont/Exist");
+ pars.setOutFile("/I/Dont/Exist*");
EventGenerator generator = new EventGenerator(pars);
assertNotNull(generator);
@@ -151,7 +151,6 @@ public class EventGeneratorTest {
final String outString = outContent.toString();
System.setOut(stdout);
-
- assertTrue(outString.contains("could not output statistics to file \"/I/Dont/Exist\""));
+ assertTrue(outString.contains("could not output statistics to file \"/I/Dont/Exist*\""));
}
}