summaryrefslogtreecommitdiffstats
path: root/esr-mgr/src
diff options
context:
space:
mode:
authorlizi00164331 <li.zi30@zte.com.cn>2017-09-20 17:55:49 +0800
committerlizi00164331 <li.zi30@zte.com.cn>2017-09-20 18:40:13 +0800
commitf61e2edaba4ddee366ee949e20ddfc552860860e (patch)
treedf7af9e36859dee98830fcfd7f9560735359dad2 /esr-mgr/src
parentc401a51179f66ad22b462320d2b680fc6e564fdd (diff)
Add unit test for ems register info.
Change-Id: I9163d814c2d7ab00a9198a55ababc685ef7748e4 Issue-ID: AAI-353 Signed-off-by: lizi00164331 <li.zi30@zte.com.cn>
Diffstat (limited to 'esr-mgr/src')
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/AlarmAddrTest.java55
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/EmsRegisterInfoTest.java81
-rw-r--r--esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/FtpAddrTest.java79
3 files changed, 215 insertions, 0 deletions
diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/AlarmAddrTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/AlarmAddrTest.java
new file mode 100644
index 0000000..ddab31b
--- /dev/null
+++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/AlarmAddrTest.java
@@ -0,0 +1,55 @@
+/**
+ * Copyright 2017 ZTE 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.aai.esr.entity.rest;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class AlarmAddrTest {
+
+ @Test
+ public void getterAndSetter4ip(){
+ final String ip = "127.0.0.1";
+ AlarmAddr alarmAddr = new AlarmAddr();
+ alarmAddr.setIp(ip);
+ assertEquals(alarmAddr.getIp(), ip);
+ }
+
+ @Test
+ public void getterAndSetter4port(){
+ final String port = "8080";
+ AlarmAddr alarmAddr = new AlarmAddr();
+ alarmAddr.setPort(port);
+ assertEquals(alarmAddr.getPort(), port);
+ }
+
+ @Test
+ public void getterAndSetter4user(){
+ final String user = "root";
+ AlarmAddr alarmAddr = new AlarmAddr();
+ alarmAddr.setUser(user);
+ assertEquals(alarmAddr.getUser(), user);
+ }
+
+ @Test
+ public void getterAndSetter4password(){
+ final String password = "dfasfa";
+ AlarmAddr alarmAddr = new AlarmAddr();
+ alarmAddr.setPassword(password);
+ assertEquals(alarmAddr.getPassword(), password);
+ }
+}
diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/EmsRegisterInfoTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/EmsRegisterInfoTest.java
new file mode 100644
index 0000000..091604b
--- /dev/null
+++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/EmsRegisterInfoTest.java
@@ -0,0 +1,81 @@
+/**
+ * Copyright 2017 ZTE 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.aai.esr.entity.rest;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class EmsRegisterInfoTest {
+ @Test
+ public void getterAndSetter4emsId(){
+ final String emsId = "dafadf";
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ emsRegisterInfo.setEmsId(emsId);
+ assertEquals(emsRegisterInfo.getEmsId(), emsId);
+ }
+
+ @Test
+ public void getterAndSetter4name() {
+ final String name = "dafadf";
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ emsRegisterInfo.setName(name);
+ assertEquals(emsRegisterInfo.getName(), name);
+ }
+
+ @Test
+ public void getterAndSetter4vendor(){
+ final String vendor = "dafadf";
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ emsRegisterInfo.setVendor(vendor);
+ assertEquals(emsRegisterInfo.getVendor(), vendor);
+ }
+
+ @Test
+ public void getterAndSetter4version(){
+ final String version = "dafadf";
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ emsRegisterInfo.setVersion(version);
+ assertEquals(emsRegisterInfo.getVersion(), version);
+ }
+
+ @Test
+ public void getterAndSetter4resouceAddr(){
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ final FtpAddr resourceAddr = new FtpAddr();
+ resourceAddr.setFtptype("sftp");
+ emsRegisterInfo.setResourceAddr(resourceAddr);
+ assertEquals(emsRegisterInfo.getResourceAddr(), resourceAddr);
+ }
+
+ @Test
+ public void getterAndSetter4performanceAddr(){
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ final FtpAddr performanceAddr = new FtpAddr();
+ performanceAddr.setFtptype("sftp");
+ emsRegisterInfo.setPerformanceAddr(performanceAddr);
+ assertEquals(emsRegisterInfo.getPerformanceAddr(), performanceAddr);
+ }
+
+ @Test
+ public void getterAndSetter4alarmAddr(){
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ final AlarmAddr alarmAddr = new AlarmAddr();
+ alarmAddr.setIp("127.0.0.1");
+ emsRegisterInfo.setAlarmAddr(alarmAddr);
+ assertEquals(emsRegisterInfo.getAlarmAddr(), alarmAddr);
+ }
+}
diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/FtpAddrTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/FtpAddrTest.java
new file mode 100644
index 0000000..13883bb
--- /dev/null
+++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/rest/FtpAddrTest.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright 2017 ZTE 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.aai.esr.entity.rest;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class FtpAddrTest {
+
+ @Test
+ public void getterAndSetter4ip(){
+ final String ip = "127.0.0.1";
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setIp(ip);
+ assertEquals(ftpAddr.getIp(), ip);
+ }
+
+ @Test
+ public void getterAndSetter4port(){
+ final String port = "8080";
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setPort(port);
+ assertEquals(ftpAddr.getPort(), port);
+ }
+
+ @Test
+ public void getterAndSetter4user(){
+ final String user = "root";
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setUser(user);
+ assertEquals(ftpAddr.getUser(), user);
+ }
+
+ @Test
+ public void getterAndSetter4password(){
+ final String password = "dfasfa";
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setPassword(password);
+ assertEquals(ftpAddr.getPassword(), password);
+ }
+
+ @Test
+ public void getterAndSetter4ftptype(){
+ final String ftptype = "sftp";
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setFtptype(ftptype);
+ assertEquals(ftpAddr.getFtptype(), ftptype);
+ }
+
+ @Test
+ public void getterAndSetter4remotepath(){
+ final String remotepath = "/home/opt/";
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setRemotepath(remotepath);
+ assertEquals(ftpAddr.getRemotepath(), remotepath);
+ }
+
+ @Test
+ public void getterAndSetter4passive(){
+ final Boolean passive = true;
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setPassive(passive);
+ assertEquals(ftpAddr.getPassive(), passive);
+ }
+}