summaryrefslogtreecommitdiffstats
path: root/nova-model
diff options
context:
space:
mode:
authorSeshu-Kumar-M <seshu.kumar.m@huawei.com>2018-03-12 16:57:18 +0530
committerSeshu-Kumar-M <seshu.kumar.m@huawei.com>2018-03-12 17:04:57 +0530
commit46173b499aae8546afe19c010e887aad5bb981dd (patch)
tree7ad3fa91ffbcb44cc35c7165851231775a0bce55 /nova-model
parent0a6ac21843364dd67f5e01d23a1f03911f8cf605 (diff)
Class to improve for SO/libs coverage
Issue-ID: SO-360 Change-Id: Iaa5ec998c1d6b471e9af83f82a124e0f0cfba8ad Signed-off-by: Seshu-Kumar-M <seshu.kumar.m@huawei.com>
Diffstat (limited to 'nova-model')
-rw-r--r--nova-model/src/test/java/com/woorea/openstack/nova/model/ServerActionTest.java74
1 files changed, 74 insertions, 0 deletions
diff --git a/nova-model/src/test/java/com/woorea/openstack/nova/model/ServerActionTest.java b/nova-model/src/test/java/com/woorea/openstack/nova/model/ServerActionTest.java
new file mode 100644
index 0000000..d60ee9b
--- /dev/null
+++ b/nova-model/src/test/java/com/woorea/openstack/nova/model/ServerActionTest.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * 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 com.woorea.openstack.nova.model;
+
+import com.woorea.openstack.nova.model.ServerAction.ChangePassword;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+
+public class ServerActionTest {
+ private ChangePassword testObj = new ServerAction.ChangePassword();
+
+ @Test
+ public void testSetAdminPass(){
+
+ try {
+
+ testObj.setAdminPass("sai");
+ assertEquals( testObj.getAdminPass(), "sai");
+
+ } catch (Exception e) {
+
+ fail("Exception in test obj");
+ }
+
+ }
+
+ @Test
+ public void testChangePasswdConstructor(){
+
+ try {
+ ServerAction.ChangePassword test = new ServerAction.ChangePassword("sai");
+ assertEquals( test.getAdminPass(), "sai");
+
+ } catch (Exception e) {
+
+ fail("Exception in test obj");
+ }
+
+ }
+
+ private ServerAction.Reboot testObj1 = new ServerAction.Reboot();
+
+ @Test
+ public void testSetType(){
+ testObj1.setType("sai");
+ assertEquals("sai", testObj1.getType());
+ }
+
+ private ServerAction.Rebuild testRebuild = new ServerAction.Rebuild();
+
+ @Test
+ public void testRebuild()
+ {
+ testRebuild.setAccessIPv4("1.1.1.1");
+ assertEquals(testRebuild.getAccessIPv4(),"1.1.1.1");
+ }
+}