summaryrefslogtreecommitdiffstats
path: root/saltstack-adapter/saltstack-adapter-provider/src/test
diff options
context:
space:
mode:
authorGanesh Chandrasekaran <ganesh.c@samsung.com>2018-07-23 14:27:22 +0900
committerGanesh Chandrasekaran <ganesh.c@samsung.com>2018-07-23 14:27:37 +0900
commit021cae43d3b22dcbd41e7b34ca4215c167714ab4 (patch)
tree7ef08cca0a2a169fc7456c7416e3557969cd8582 /saltstack-adapter/saltstack-adapter-provider/src/test
parente70da25135855b88571b19c108089b74181996a6 (diff)
Use ByteStream instead of FileStream
Issue-ID: CCSDK-393 Change-Id: Id004f0bce1768e00f3e326efc204532acdb22546 Signed-off-by: Ganesh Chandrasekaran <ganesh.c@samsung.com>
Diffstat (limited to 'saltstack-adapter/saltstack-adapter-provider/src/test')
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestConnectionBuilder.java3
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterImpl.java20
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java2
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestJsonParser.java6
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/resources/org/onap/ccsdk/default.properties13
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/resources/test-invalid.json4
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/test/resources/test.json4
7 files changed, 19 insertions, 33 deletions
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestConnectionBuilder.java b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestConnectionBuilder.java
index 266147aad..8cd7af25e 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestConnectionBuilder.java
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestConnectionBuilder.java
@@ -29,14 +29,11 @@ import org.junit.Before;
import org.junit.Test;
import org.onap.ccsdk.sli.adaptors.saltstack.impl.ConnectionBuilder;
import org.onap.ccsdk.sli.adaptors.saltstack.model.SaltstackResult;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
public class TestConnectionBuilder {
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterImpl.java b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterImpl.java
index a0d36046c..50530ecd8 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterImpl.java
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterImpl.java
@@ -801,7 +801,7 @@ public class TestSaltstackAdapterImpl {
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals("200", status);
assertEquals(TestId, "test1");
- } catch (Exception e){
+ } catch (Exception e) {
//if local ssh is not enabled
System.out.print(e.getMessage());
}
@@ -829,7 +829,7 @@ public class TestSaltstackAdapterImpl {
assertEquals(TestId, "test1");
TestId = svcContext.getAttribute("test1.minion1");
assertEquals(TestId, "true");
- } catch (Exception e){
+ } catch (Exception e) {
//if saltstack ssh IP is not enabled
System.out.print(e.getMessage());
}
@@ -855,7 +855,7 @@ public class TestSaltstackAdapterImpl {
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals("200", status);
assertEquals(TestId, "test1");
- } catch (Exception e){
+ } catch (Exception e) {
//if saltstack ssh IP is not enabled
System.out.print(e.getMessage());
}
@@ -881,7 +881,7 @@ public class TestSaltstackAdapterImpl {
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals("200", status);
assertEquals(TestId, "test1");
- } catch (Exception e){
+ } catch (Exception e) {
//if saltstack ssh IP is not enabled
System.out.print(e.getMessage());
}
@@ -908,7 +908,7 @@ public class TestSaltstackAdapterImpl {
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals("200", status);
assertEquals(TestId, "test1");
- } catch (Exception e){
+ } catch (Exception e) {
//if saltstack ssh IP is not enabled
System.out.print(e.getMessage());
}
@@ -936,7 +936,7 @@ public class TestSaltstackAdapterImpl {
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals("200", status);
assertEquals(TestId, "test1");
- } catch (Exception e){
+ } catch (Exception e) {
//if saltstack ssh IP is not enabled
System.out.print(e.getMessage());
}
@@ -964,7 +964,7 @@ public class TestSaltstackAdapterImpl {
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals("200", status);
assertEquals(TestId, "test1");
- } catch (Exception e){
+ } catch (Exception e) {
//if saltstack ssh IP is not enabled
System.out.print(e.getMessage());
}
@@ -992,7 +992,7 @@ public class TestSaltstackAdapterImpl {
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals("200", status);
assertEquals(TestId, "test1");
- } catch (Exception e){
+ } catch (Exception e) {
//if saltstack ssh IP is not enabled
System.out.print(e.getMessage());
}
@@ -1018,7 +1018,7 @@ public class TestSaltstackAdapterImpl {
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals("200", status);
assertEquals(TestId, "test1");
- } catch (Exception e){
+ } catch (Exception e) {
//if saltstack ssh IP is not enabled
System.out.print(e.getMessage());
}
@@ -1046,7 +1046,7 @@ public class TestSaltstackAdapterImpl {
TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
assertEquals("200", status);
assertEquals(TestId, "test1");
- } catch (Exception e){
+ } catch (Exception e) {
//if saltstack ssh IP is not enabled
System.out.print(e.getMessage());
}
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java
index 29d08801b..57590baec 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/impl/TestSaltstackAdapterPropertiesProviderImpl.java
@@ -29,7 +29,6 @@ import org.junit.Before;
import org.junit.Test;
import org.onap.ccsdk.sli.adaptors.saltstack.SaltstackAdapterPropertiesProvider;
import org.onap.ccsdk.sli.adaptors.saltstack.impl.SaltstackAdapterImpl;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import java.util.Properties;
@@ -258,7 +257,6 @@ public class TestSaltstackAdapterPropertiesProviderImpl {
}
-
@Test
public void reqExecCommand_setPropertiesElsePortNull() throws SvcLogicException,
IllegalStateException, IllegalArgumentException {
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestJsonParser.java b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestJsonParser.java
index d082285f5..71798fbc8 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestJsonParser.java
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/java/org/onap/ccsdk/adapter/model/TestJsonParser.java
@@ -8,9 +8,9 @@
* 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.
@@ -23,8 +23,8 @@ package org.onap.ccsdk.adapter.model;
import org.codehaus.jettison.json.JSONException;
import org.junit.Test;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.adaptors.saltstack.model.JsonParser;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/resources/org/onap/ccsdk/default.properties b/saltstack-adapter/saltstack-adapter-provider/src/test/resources/org/onap/ccsdk/default.properties
index 3e7e2bcc4..e5650e853 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/resources/org/onap/ccsdk/default.properties
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/resources/org/onap/ccsdk/default.properties
@@ -21,7 +21,6 @@
#
# ============LICENSE_END=========================================================
###
-
#
# Default properties for the APP-C Provider Adapter
#
@@ -31,9 +30,7 @@
# to supply configuration options
org.onap.appc.bootstrap.file=appc.properties
org.onap.appc.bootstrap.path=/opt/onap/appc/data/properties,${user.home},.
-
appc.application.name=APPC
-
#
# Define the message resource bundle name to be loaded
org.onap.appc.resources=org/onap/appc/i18n/MessageResources
@@ -53,15 +50,13 @@ org.onap.appc.security.logger=org.onap.appc.security
# means that the upper bound on the pool is unbounded.
org.onap.appc.provider.min.pool=1
org.onap.appc.provider.max.pool=0
-
#
# The following properties are used to configure the retry logic for connection to the
# IaaS provider(s). The retry delay property is the amount of time, in seconds, the
# application waits between retry attempts. The retry limit is the number of retries
# that are allowed before the request is failed.
-org.onap.appc.provider.retry.delay = 30
-org.onap.appc.provider.retry.limit = 10
-
+org.onap.appc.provider.retry.delay=30
+org.onap.appc.provider.retry.limit=10
#
# The trusted hosts list for SSL access when a certificate is not provided.
#
@@ -85,21 +80,17 @@ org.onap.appc.openstack.poll.interval=20
# the values for a different provider. Any number of providers can be defined in this
# way.
#
-
# Don't change these 2 right now since they are hard coded in the DG
#provider1.type=appc
#provider1.name=appc
-
#These you can change
#provider1.identity=appc
#provider1.tenant1.name=appc
#provider1.tenant1.userid=appc
#provider1.tenant1.password=appc
-
# After a change to the provider make sure to recheck these values with an api call to provider1.identity/tokens
test.expected-regions=1
test.expected-endpoints=1
-
#Your OpenStack IP
#test.ip=192.168.1.2
# Your OpenStack Platform's Keystone Port (default is 5000)
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/resources/test-invalid.json b/saltstack-adapter/saltstack-adapter-provider/src/test/resources/test-invalid.json
index 53158cada..d16bfccdf 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/resources/test-invalid.json
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/resources/test-invalid.json
@@ -6,8 +6,8 @@
"equipment-id": "Server1",
"server-model": "Unknown",
"server-id": "Server1",
-"test-node" : {
-"test-inner-node" : "Test-Value"
+"test-node": {
+"test-inner-node": "Test-Value"
}
}
],
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/test/resources/test.json b/saltstack-adapter/saltstack-adapter-provider/src/test/resources/test.json
index cd76486aa..81131d6f4 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/test/resources/test.json
+++ b/saltstack-adapter/saltstack-adapter-provider/src/test/resources/test.json
@@ -7,8 +7,8 @@
"equipment-id": "Server1",
"server-model": "Unknown",
"server-id": "Server1",
- "test-node" : {
- "test-inner-node" : "Test-Value"
+ "test-node": {
+ "test-inner-node": "Test-Value"
}
}
],