729efd8d35282891e00fc7e32ee45d459a636aaa
[appc.git] /
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP : APPC\r
4  * ================================================================================\r
5  * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.\r
6  * =============================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  *\r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  *\r
19  * ============LICENSE_END=========================================================\r
20  */\r
21 \r
22 package org.onap.appc.flow.controller.data;\r
23 \r
24 import static org.junit.Assert.assertTrue;\r
25 import static org.junit.Assert.assertFalse;\r
26 import static org.junit.Assert.assertEquals;\r
27 import static org.junit.Assert.assertNotNull;\r
28 \r
29 import org.junit.Before;\r
30 import org.junit.Test;\r
31 \r
32 public class ParametersTest {\r
33     private Parameters param;\r
34     private Parameters param1;\r
35     private Parameters param2;\r
36 \r
37     @Before\r
38     public void SetUp() {\r
39         param = new Parameters();\r
40         param1 = new Parameters();\r
41         param2 = new Parameters();\r
42     }\r
43 \r
44     @Test\r
45     public void testSetParamValue() {\r
46         param.setParamValue("1");\r
47         assertNotNull(param.getParamValue());\r
48         assertEquals(param.getParamValue(),"1");\r
49     }\r
50 \r
51     @Test\r
52     public void testSetParamName() {\r
53         param.setParamName("abc");\r
54         assertNotNull(param.getParamName());\r
55         assertEquals(param.getParamName(),"abc");\r
56     }\r
57 \r
58     @Test\r
59     public void testHashCode_Print() {\r
60         param.setParamName("2");\r
61         param.setParamValue("def");\r
62         System.out.println("param hashcode is " + param.hashCode());\r
63     }\r
64 \r
65     @Test\r
66     public void testToString() {\r
67         param.setParamName("3");\r
68         param.setParamValue("ghi");\r
69         String ret = param.toString();\r
70         assertFalse("toString is not empty", ret.isEmpty());\r
71     }\r
72 \r
73     @Test\r
74     public void testEqualsObject() {\r
75         assertTrue(param1.equals(param2) && param2.equals(param1));\r
76         assertTrue(param1.equals(param1));\r
77         assertFalse(param1.equals(null));\r
78     }\r
79 }\r