Fix gvnfm juju compile problem
[vfc/nfvo/driver/vnfm/gvnfm.git] / juju / juju-vnfmadapter / Juju-vnfmadapterService / service / src / test / java / org / onap / vfc / nfvo / vnfm / gvnfm / 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.onap.vfc.nfvo.vnfm.gvnfm.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 import org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuDriver;
26 import org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuVnfd;
27
28 public class JujuVnfdTest {
29
30     @Test
31     public void testGetDownloadUri() {
32         JujuVnfd jujuvnfd = new JujuVnfd();
33         String result = jujuvnfd.getDownloadUri();
34         assertNull(result);
35     }
36
37     @Test
38     public void testSetDownloadUri() {
39         JujuVnfd jujuvnfd = new JujuVnfd();
40         jujuvnfd.setDownloadUri("testDownloadUri");
41         String result = jujuvnfd.getDownloadUri();
42         assertEquals("testDownloadUri", result);
43     }
44
45     @Test
46     public void testGetLocalPath() {
47         JujuVnfd jujuvnfd = new JujuVnfd();
48         String result = jujuvnfd.getLocalPath();
49         assertNull(result);
50     }
51
52     @Test
53     public void testSetProtocol() {
54         JujuVnfd jujuvnfd = new JujuVnfd();
55         jujuvnfd.setLocalPath("testLocalPath");
56         String result = jujuvnfd.getLocalPath();
57         assertEquals("testLocalPath", result);
58     }
59
60
61     @Test
62     public void testToString() {
63         JujuVnfd jujuvnfd = new JujuVnfd();
64         String result = jujuvnfd.toString();
65         assertEquals(
66                 "JujuVnfd[downloadUri=<null>,localPath=<null>]",
67                 result);
68     }
69
70     @Test
71     public void testToString1() {
72         JujuVnfd jujuvnfd = new JujuVnfd();
73         jujuvnfd.setDownloadUri("testDownloadUri");
74         jujuvnfd.setLocalPath("testLocalPath");
75         String result = jujuvnfd.toString();
76         assertEquals(
77                 "JujuVnfd[downloadUri=testDownloadUri,localPath=testLocalPath]",
78                 result);
79     }
80
81     @Test
82     public void testHashCode() {
83         JujuVnfd jujuvnfd = new JujuVnfd();
84         int result = jujuvnfd.hashCode();
85         assertEquals(31, result);
86     }
87
88     @Test
89     public void testHashCode1() {
90         JujuVnfd jujuvnfd = new JujuVnfd();
91         jujuvnfd.setDownloadUri("testDownloadUri");
92         int result = jujuvnfd.hashCode();
93         assertEquals(-1870623759, result);
94     }
95
96     @Test
97     public void testEquals() {
98         boolean result = new JujuVnfd().equals(new JujuVnfd());
99         assertTrue(result);
100     }
101
102     @Test
103     public void testEquals1() {
104         boolean result = new JujuVnfd().equals("");
105         assertFalse(result);
106     }
107
108     @Test
109     public void testEquals2() {
110         JujuDriver obj = new JujuDriver();
111         boolean result = new JujuVnfd().equals(obj);
112         assertFalse(result);
113     }
114
115     @Test
116     public void testEquals3() {
117         JujuVnfd obj = new JujuVnfd();
118         obj.setDownloadUri("testDownloadUri");
119         boolean result = new JujuVnfd().equals(obj);
120         assertFalse(result);
121     }
122
123     @Test
124     public void testEquals4() {
125         JujuVnfd obj = new JujuVnfd();
126         boolean result = obj.equals(obj);
127         assertTrue(result);
128     }
129
130     @Test
131     public void testEquals5() {
132         boolean result = new JujuVnfd().equals(null);
133         assertFalse(result);
134     }
135
136     @Test
137     public void testEquals6() {
138         JujuVnfd jujuvnfd = new JujuVnfd();
139         JujuVnfd jujudriver2 = new JujuVnfd();
140         jujuvnfd.setDownloadUri("");
141         jujudriver2.setDownloadUri("");
142         boolean result = jujuvnfd.equals(jujudriver2);
143         assertTrue(result);
144     }
145
146     @Test
147     public void testEquals7() {
148         JujuVnfd jujuvnfd = new JujuVnfd();
149         JujuVnfd jujudriver2 = new JujuVnfd();
150         jujuvnfd.setDownloadUri("testDownloadUri");
151         jujudriver2.setDownloadUri("DownloadUri");
152         boolean result = jujuvnfd.equals(jujudriver2);
153         assertFalse(result);
154     }
155
156 }