summaryrefslogtreecommitdiffstats
path: root/ResmanagementService/service/src/main
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-02-26 11:15:42 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-02-26 11:15:42 +0530
commit48f249950e178b30653f020c3ea0f845cf84c0c5 (patch)
tree864a7b311af9863123d926a57fe7587167bdfdbe /ResmanagementService/service/src/main
parentb3f8c28fa4c50d0acd19ef98638feb0e9bd7457f (diff)
Improve coverage of res mgr hw
Issue-ID: VFC-764 Change-Id: I26052d87054fb447fa5c0da0d22dd90e1b69cbf5 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'ResmanagementService/service/src/main')
-rw-r--r--ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/adapter/impl/ResmgrAdapterMgrService.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/adapter/impl/ResmgrAdapterMgrService.java b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/adapter/impl/ResmgrAdapterMgrService.java
index 12e4061..606ce50 100644
--- a/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/adapter/impl/ResmgrAdapterMgrService.java
+++ b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/adapter/impl/ResmgrAdapterMgrService.java
@@ -82,14 +82,19 @@ public class ResmgrAdapterMgrService implements IResmgrAdapterMgrService {
* @throws IOException
*/
public static String readVimAdapterInfoFromJson() throws IOException {
- String fileContent = "";
-
String fileName = SystemEnvVariablesFactory.getInstance().getAppRoot() + System.getProperty("file.separator")
+ "etc" + System.getProperty("file.separator") + "adapterInfo" + System.getProperty("file.separator")
+ RESMGRADAPTERINFO;
- try (InputStream ins = new FileInputStream(fileName)) {
- try(BufferedInputStream bins = new BufferedInputStream(ins)) {
+ return readJson(fileName);
+ }
+
+ public static String readJson(String fileName) throws IOException {
+ String fileContent = "";
+
+ try (InputStream ins = new FileInputStream(fileName)){
+ try(BufferedInputStream bins = new BufferedInputStream(ins)){
+
byte[] contentByte = new byte[ins.available()];
int num = bins.read(contentByte);
@@ -104,6 +109,7 @@ public class ResmgrAdapterMgrService implements IResmgrAdapterMgrService {
return fileContent;
}
+
private static class RegisterResmgrThread implements Runnable {
private IResmgrAdapter2MSBManager adapter2MSBMgr = new ResmgrAdapter2MSBManager();