Update gvnfm-driver .gitreview file
[vfc/nfvo/driver/vnfm/gvnfm.git] / juju / juju-vnfmadapter / Juju-vnfmadapterService / service / src / test / java / org / openo / nfvo / jujuvnfmadapter / service / entity / JujuVnfdTest.java
1 /*
2  * Copyright 2016 Huawei Technologies Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.openo.nfvo.jujuvnfmadapter.service.entity;
18
19 import static org.junit.Assert.assertEquals;
20 import static org.junit.Assert.assertFalse;
21 import static org.junit.Assert.assertNull;
22 import static org.junit.Assert.assertTrue;
23
24 import org.junit.Test;
25
26 public class JujuVnfdTest {
27
28     @Test
29     public void testGetDownloadUri() {
30         JujuVnfd jujuvnfd = new JujuVnfd();
31         String result = jujuvnfd.getDownloadUri();
32         assertNull(result);
33     }
34
35     @Test
36     public void testSetDownloadUri() {
37         JujuVnfd jujuvnfd = new JujuVnfd();
38         jujuvnfd.setDownloadUri("testDownloadUri");
39         String result = jujuvnfd.getDownloadUri();
40         assertEquals("testDownloadUri", result);
41     }
42
43     @Test
44     public void testGetLocalPath() {
45         JujuVnfd jujuvnfd = new JujuVnfd();
46         String result = jujuvnfd.getLocalPath();
47         assertNull(result);
48     }
49
50     @Test
51     public void testSetProtocol() {
52         JujuVnfd jujuvnfd = new JujuVnfd();
53         jujuvnfd.setLocalPath("testLocalPath");
54         String result = jujuvnfd.getLocalPath();
55         assertEquals("testLocalPath", result);
56     }
57
58
59     @Test
60     public void testToString() {
61         JujuVnfd jujuvnfd = new JujuVnfd();
62         String result = jujuvnfd.toString();
63         assertEquals(
64                 "JujuVnfd[downloadUri=<null>,localPath=<null>]",
65                 result);
66     }
67
68     @Test
69     public void testToString1() {
70         JujuVnfd jujuvnfd = new JujuVnfd();
71         jujuvnfd.setDownloadUri("testDownloadUri");
72         jujuvnfd.setLocalPath("testLocalPath");
73         String result = jujuvnfd.toString();
74         assertEquals(
75                 "JujuVnfd[downloadUri=testDownloadUri,localPath=testLocalPath]",
76                 result);
77     }
78
79     @Test
80     public void testHashCode() {
81         JujuVnfd jujuvnfd = new JujuVnfd();
82         int result = jujuvnfd.hashCode();
83         assertEquals(31, result);
84     }
85
86     @Test
87     public void testHashCode1() {
88         JujuVnfd jujuvnfd = new JujuVnfd();
89         jujuvnfd.setDownloadUri("testDownloadUri");
90         int result = jujuvnfd.hashCode();
91         assertEquals(-1870623759, result);
92     }
93
94     @Test
95     public void testEquals() {
96         boolean result = new JujuVnfd().equals(new JujuVnfd());
97         assertTrue(result);
98     }
99
100     @Test
101     public void testEquals1() {
102         boolean result = new JujuVnfd().equals("");
103         assertFalse(result);
104     }
105
106     @Test
107     public void testEquals2() {
108         JujuDriver obj = new JujuDriver();
109         boolean result = new JujuVnfd().equals(obj);
110         assertFalse(result);
111     }
112
113     @Test
114     public void testEquals3() {
115         JujuVnfd obj = new JujuVnfd();
116         obj.setDownloadUri("testDownloadUri");
117         boolean result = new JujuVnfd().equals(obj);
118         assertFalse(result);
119     }
120
121     @Test
122     public void testEquals4() {
123         JujuVnfd obj = new JujuVnfd();
124         boolean result = obj.equals(obj);
125         assertTrue(result);
126     }
127
128     @Test
129     public void testEquals5() {
130         boolean result = new JujuVnfd().equals(null);
131         assertFalse(result);
132     }
133
134     @Test
135     public void testEquals6() {
136         JujuVnfd jujuvnfd = new JujuVnfd();
137         JujuVnfd jujudriver2 = new JujuVnfd();
138         jujuvnfd.setDownloadUri("");
139         jujudriver2.setDownloadUri("");
140         boolean result = jujuvnfd.equals(jujudriver2);
141         assertTrue(result);
142     }
143
144     @Test
145     public void testEquals7() {
146         JujuVnfd jujuvnfd = new JujuVnfd();
147         JujuVnfd jujudriver2 = new JujuVnfd();
148         jujuvnfd.setDownloadUri("testDownloadUri");
149         jujudriver2.setDownloadUri("DownloadUri");
150         boolean result = jujuvnfd.equals(jujudriver2);
151         assertFalse(result);
152     }
153
154 }