From 6ed6d53a97b448ee85590948bbbdf83b447c865b Mon Sep 17 00:00:00 2001 From: Guangrong Fu Date: Wed, 24 Jan 2018 08:31:09 +0800 Subject: Testing the Impacts of Dependency Version Change-Id: I3990946b0345fdf0f791844f01f2bb0af3c64ed2 Issue-ID: HOLMES-116 Signed-off-by: Guangrong Fu --- .../onap/holmes/engine/dcae/DcaeConfigurationPolling.java | 2 +- .../org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java | 2 ++ .../org/onap/holmes/engine/resources/SwaggerResource.java | 11 ++++++++++- pom.xml | 14 ++++++++++++-- test.txt | 0 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 test.txt diff --git a/engine-d/src/main/java/org/onap/holmes/engine/dcae/DcaeConfigurationPolling.java b/engine-d/src/main/java/org/onap/holmes/engine/dcae/DcaeConfigurationPolling.java index 1b774d8..40a3940 100644 --- a/engine-d/src/main/java/org/onap/holmes/engine/dcae/DcaeConfigurationPolling.java +++ b/engine-d/src/main/java/org/onap/holmes/engine/dcae/DcaeConfigurationPolling.java @@ -31,7 +31,7 @@ public class DcaeConfigurationPolling implements Runnable { private String hostname; - public static long POLLING_PERIOD = 30 * 1000L; + public static final long POLLING_PERIOD = 30 * 1000L; private String prevConfigMd5 = Md5Util.md5(null); diff --git a/engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java b/engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java index 009de8e..862895b 100644 --- a/engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java +++ b/engine-d/src/main/java/org/onap/holmes/engine/dmaap/DMaaPAlarmPolling.java @@ -49,6 +49,7 @@ public class DMaaPAlarmPolling implements Runnable { Thread.sleep(60000); } catch (InterruptedException e1) { log.info("Thread is still active.", e); + Thread.currentThread().interrupt(); } } catch (Exception e) { log.error("An error occurred while processing alarm. Sleep for 60 seconds to restart.", e); @@ -56,6 +57,7 @@ public class DMaaPAlarmPolling implements Runnable { Thread.sleep(60000); } catch (InterruptedException e1) { log.info("Thread is still active.", e); + Thread.currentThread().interrupt(); } } } diff --git a/engine-d/src/main/java/org/onap/holmes/engine/resources/SwaggerResource.java b/engine-d/src/main/java/org/onap/holmes/engine/resources/SwaggerResource.java index 6bc68c5..a20b578 100644 --- a/engine-d/src/main/java/org/onap/holmes/engine/resources/SwaggerResource.java +++ b/engine-d/src/main/java/org/onap/holmes/engine/resources/SwaggerResource.java @@ -44,11 +44,12 @@ public class SwaggerResource { public String getSwaggerJson() { URL url = SwaggerResource.class.getResource("/swagger.json"); String ret = "{}"; + BufferedReader br = null; try { System.out.println(URLDecoder.decode(url.getPath(), "UTF-8")); File file = new File(URLDecoder.decode(url.getPath(), "UTF-8")); - BufferedReader br = new BufferedReader(new FileReader(file)); + br = new BufferedReader(new FileReader(file)); StringBuffer buffer = new StringBuffer(); String line = " "; while ((line = br.readLine()) != null) { @@ -59,6 +60,14 @@ public class SwaggerResource { log.warn("Failed to read the API description file."); } catch (IOException e) { log.warn("An error occurred while reading swagger.json."); + } finally { + if (br != null) { + try { + br.close(); + } catch (IOException e) { + log.warn("Failed to close the file reader. This may cause memory leak."); + } + } } return ret; } diff --git a/pom.xml b/pom.xml index 87abaf8..03085cb 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ 3.2.1 42.1.1 - 0.8.0 + 0.9.3 1.5.3 1.16.8 2.22.2 @@ -90,7 +90,17 @@ org.onap.holmes.common holmes-actions - ${project.version} + 1.0.0 + + + io.dropwizard + dropwizard-db + + + io.dropwizard + dropwizard-core + + org.onap.holmes.dsa diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..e69de29 -- cgit 1.2.3-korg