summaryrefslogtreecommitdiffstats
path: root/nokia/vnfmdriver/vfcadaptorservice
diff options
context:
space:
mode:
authorFu Jinhua <fu.jinhua@zte.com.cn>2017-10-19 06:37:46 +0000
committerGerrit Code Review <gerrit@onap.org>2017-10-19 06:37:46 +0000
commit11543d661527fca4bab167ee50ff1886465dadb4 (patch)
treed03b8aa56274729142d2fd75e74b331419b1636e /nokia/vnfmdriver/vfcadaptorservice
parent18041d14a4925a597a390f1f7b2b43b73726b93a (diff)
parent8739e1df33bdfb0155b77252ebcc94e2f087b725 (diff)
Merge "Update http query part"
Diffstat (limited to 'nokia/vnfmdriver/vfcadaptorservice')
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientProcessorImpl.java4
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpRequestProcessor.java1
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/init/EnvVariablesInitialization.java12
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientProcessorImplTest.java32
4 files changed, 42 insertions, 7 deletions
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientProcessorImpl.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientProcessorImpl.java
index 319b0e32..ca8e7e2e 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientProcessorImpl.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientProcessorImpl.java
@@ -49,4 +49,8 @@ public class HttpClientProcessorImpl implements HttpClientProcessorInf{
}
return processor.process(url);
}
+
+ public void setHttpClientBuilder(HttpClientBuilder httpClientBuilder) {
+ this.httpClientBuilder = httpClientBuilder;
+ }
}
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpRequestProcessor.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpRequestProcessor.java
index bd3e3635..225a228a 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpRequestProcessor.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpRequestProcessor.java
@@ -48,7 +48,6 @@ public class HttpRequestProcessor {
HttpResponse response = httpClient.execute(httpRequest);
HttpResult httpResult = buildHttpResult(response);
- httpClient.close();
return httpResult;
}
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/init/EnvVariablesInitialization.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/init/EnvVariablesInitialization.java
index eddc51a5..1fb7138a 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/init/EnvVariablesInitialization.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/init/EnvVariablesInitialization.java
@@ -58,15 +58,15 @@ public class EnvVariablesInitialization implements ApplicationRunner {
}
try {
- handLcmMsbServiceInfo();
+ handleLcmMsbServiceInfo();
} catch (Exception e) {
- logger.error("handLcmMsbServiceInfo error", e);
+ logger.error("handleLcmMsbServiceInfo error", e);
}
try {
- handCatalogMsbServiceInfo();
+ handleCatalogMsbServiceInfo();
} catch (Exception e) {
- logger.error("handCatalogMsbServiceInfo error", e);
+ logger.error("handleCatalogMsbServiceInfo error", e);
}
}
@@ -86,13 +86,13 @@ public class EnvVariablesInitialization implements ApplicationRunner {
return CommonConstants.SCHEMA_HTTP + "://" + adaptorEnv.getMsbIp() + ":" + adaptorEnv.getMsbPort();
}
- private void handLcmMsbServiceInfo() throws ClientProtocolException, IOException {
+ private void handleLcmMsbServiceInfo() throws ClientProtocolException, IOException {
String urlInMsb = msbMgmr.getServiceUrlInMsbBySeriveNameAndVersion(adaptorEnv.getLcmServiceNameInMsb(), adaptorEnv.getLcmVersionInMsb());
adaptorEnv.setLcmUrlInMsb(urlInMsb);
adaptorEnv.setLcmApiUriFront(generateApiUriFront(urlInMsb));
}
- private void handCatalogMsbServiceInfo() throws ClientProtocolException, IOException {
+ private void handleCatalogMsbServiceInfo() throws ClientProtocolException, IOException {
String urlInMsb = msbMgmr.getServiceUrlInMsbBySeriveNameAndVersion(adaptorEnv.getCatalogServiceNameInMsb(), adaptorEnv.getCatalogVersionInMsb());
adaptorEnv.setCatalogUrlInMsb(urlInMsb);
adaptorEnv.setCatalogApiUriFront(generateApiUriFront(urlInMsb));
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientProcessorImplTest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientProcessorImplTest.java
new file mode 100644
index 00000000..f070eda4
--- /dev/null
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientProcessorImplTest.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2016-2017, Nokia Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.vfc.nfvo.driver.vnfm.svnfm.http.client;
+
+import java.io.IOException;
+
+import org.apache.http.client.ClientProtocolException;
+import org.junit.Test;
+
+public class HttpClientProcessorImplTest {
+
+ @Test
+ public void testMultiClient() throws ClientProtocolException, IOException
+ {
+ HttpClientProcessorImpl processor = new HttpClientProcessorImpl();
+ processor.setHttpClientBuilder(HttpClientUtils.createHttpClientBuilder());
+ }
+}