aboutsummaryrefslogtreecommitdiffstats
path: root/appc-adapters
diff options
context:
space:
mode:
authorZihmin Hoover <zh4590@att.com>2018-04-10 15:19:16 -0400
committerPatrick Brady <pb071s@att.com>2018-04-11 20:41:54 +0000
commit8ec10f3df82d388328ca4cdf4f6e6e85e7037fe6 (patch)
treeb6b83709cfbebd8d2bb113f5fe4f27e5420741ac /appc-adapters
parent08a893ca7b43ca8b9a2e3bd3a09ace301d540a9f (diff)
Add junit coverage to Constants class
Introduce junit-tests for Constants class Change-Id: Ic33aa704f0ca19d81f32a013cd0a98d52433172c Issue-ID: APPC-844 Signed-off-by: Zihmin Hoover <zh4590@att.com>
Diffstat (limited to 'appc-adapters')
-rw-r--r--appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/test/java/org/onap/appc/adapter/ssh/ConstantsTest.java61
1 files changed, 61 insertions, 0 deletions
diff --git a/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/test/java/org/onap/appc/adapter/ssh/ConstantsTest.java b/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/test/java/org/onap/appc/adapter/ssh/ConstantsTest.java
new file mode 100644
index 000000000..ccdd94505
--- /dev/null
+++ b/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/test/java/org/onap/appc/adapter/ssh/ConstantsTest.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * =============================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.appc.adapter.ssh;
+
+import static org.junit.Assert.assertEquals;
+import java.lang.reflect.Constructor;
+import org.junit.Test;
+
+public class ConstantsTest {
+
+ @Test
+ public void test() {
+ String payLoad = Constants.PAYLOAD;
+ assertEquals(payLoad, "payload");
+
+ assertEquals(Constants.NETCONF_SCHEMA, "sdnctl");
+ assertEquals(Constants.SDNCTL_SCHEMA, "sdnctl" );
+ assertEquals(Constants.DEVICE_AUTHENTICATION_TABLE_NAME, "DEVICE_AUTHENTICATION" );
+ assertEquals(Constants.CONFIGFILES_TABLE_NAME, "CONFIGFILES" );
+ assertEquals(Constants.DEVICE_INTERFACE_LOG_TABLE_NAME, "DEVICE_INTERFACE_LOG" );
+ assertEquals(Constants.FILE_CONTENT_TABLE_FIELD_NAME, "FILE_CONTENT" );
+ assertEquals(Constants.FILE_NAME_TABLE_FIELD_NAME, "FILE_NAME" );
+
+ assertEquals(Constants.VM_NAMES[0], "fe1");
+ assertEquals(Constants.VM_NAMES[1], "fe2");
+ assertEquals(Constants.VM_NAMES[2], "be1");
+ assertEquals(Constants.VM_NAMES[3], "be2");
+ assertEquals(Constants.VM_NAMES[4], "be3");
+ assertEquals(Constants.VM_NAMES[5], "be4");
+ assertEquals(Constants.VM_NAMES[6], "be5");
+ assertEquals(Constants.VM_NAMES[7], "smp1");
+ assertEquals(Constants.VM_NAMES[8], "smp2");
+
+ assertEquals(Constants.DG_ERROR_FIELD_NAME, "org.openecom.appc.dg.error");
+
+ }
+ @Test
+ public void testValidatesThatClassConstantsIsNotInstantiable() throws Exception {
+ Constructor<Constants> c = Constants.class.getDeclaredConstructor();
+ c.setAccessible(true);
+ c.newInstance();
+ }
+}