2 * Copyright 2016 Huawei Technologies Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity;
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;
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;
28 public class JujuVnfdTest {
31 public void testGetDownloadUri() {
32 JujuVnfd jujuvnfd = new JujuVnfd();
33 String result = jujuvnfd.getDownloadUri();
38 public void testSetDownloadUri() {
39 JujuVnfd jujuvnfd = new JujuVnfd();
40 jujuvnfd.setDownloadUri("testDownloadUri");
41 String result = jujuvnfd.getDownloadUri();
42 assertEquals("testDownloadUri", result);
46 public void testGetLocalPath() {
47 JujuVnfd jujuvnfd = new JujuVnfd();
48 String result = jujuvnfd.getLocalPath();
53 public void testSetProtocol() {
54 JujuVnfd jujuvnfd = new JujuVnfd();
55 jujuvnfd.setLocalPath("testLocalPath");
56 String result = jujuvnfd.getLocalPath();
57 assertEquals("testLocalPath", result);
62 public void testToString() {
63 JujuVnfd jujuvnfd = new JujuVnfd();
64 String result = jujuvnfd.toString();
66 "JujuVnfd[downloadUri=<null>,localPath=<null>]",
71 public void testToString1() {
72 JujuVnfd jujuvnfd = new JujuVnfd();
73 jujuvnfd.setDownloadUri("testDownloadUri");
74 jujuvnfd.setLocalPath("testLocalPath");
75 String result = jujuvnfd.toString();
77 "JujuVnfd[downloadUri=testDownloadUri,localPath=testLocalPath]",
82 public void testHashCode() {
83 JujuVnfd jujuvnfd = new JujuVnfd();
84 int result = jujuvnfd.hashCode();
85 assertEquals(31, result);
89 public void testHashCode1() {
90 JujuVnfd jujuvnfd = new JujuVnfd();
91 jujuvnfd.setDownloadUri("testDownloadUri");
92 int result = jujuvnfd.hashCode();
93 assertEquals(-1870623759, result);
97 public void testEquals() {
98 boolean result = new JujuVnfd().equals(new JujuVnfd());
103 public void testEquals1() {
104 boolean result = new JujuVnfd().equals("");
109 public void testEquals2() {
110 JujuDriver obj = new JujuDriver();
111 boolean result = new JujuVnfd().equals(obj);
116 public void testEquals3() {
117 JujuVnfd obj = new JujuVnfd();
118 obj.setDownloadUri("testDownloadUri");
119 boolean result = new JujuVnfd().equals(obj);
124 public void testEquals4() {
125 JujuVnfd obj = new JujuVnfd();
126 boolean result = obj.equals(obj);
131 public void testEquals5() {
132 boolean result = new JujuVnfd().equals(null);
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);
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);