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.openo.nfvo.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;
26 public class JujuVnfdTest {
29 public void testGetDownloadUri() {
30 JujuVnfd jujuvnfd = new JujuVnfd();
31 String result = jujuvnfd.getDownloadUri();
36 public void testSetDownloadUri() {
37 JujuVnfd jujuvnfd = new JujuVnfd();
38 jujuvnfd.setDownloadUri("testDownloadUri");
39 String result = jujuvnfd.getDownloadUri();
40 assertEquals("testDownloadUri", result);
44 public void testGetLocalPath() {
45 JujuVnfd jujuvnfd = new JujuVnfd();
46 String result = jujuvnfd.getLocalPath();
51 public void testSetProtocol() {
52 JujuVnfd jujuvnfd = new JujuVnfd();
53 jujuvnfd.setLocalPath("testLocalPath");
54 String result = jujuvnfd.getLocalPath();
55 assertEquals("testLocalPath", result);
60 public void testToString() {
61 JujuVnfd jujuvnfd = new JujuVnfd();
62 String result = jujuvnfd.toString();
64 "JujuVnfd[downloadUri=<null>,localPath=<null>]",
69 public void testToString1() {
70 JujuVnfd jujuvnfd = new JujuVnfd();
71 jujuvnfd.setDownloadUri("testDownloadUri");
72 jujuvnfd.setLocalPath("testLocalPath");
73 String result = jujuvnfd.toString();
75 "JujuVnfd[downloadUri=testDownloadUri,localPath=testLocalPath]",
80 public void testHashCode() {
81 JujuVnfd jujuvnfd = new JujuVnfd();
82 int result = jujuvnfd.hashCode();
83 assertEquals(31, result);
87 public void testHashCode1() {
88 JujuVnfd jujuvnfd = new JujuVnfd();
89 jujuvnfd.setDownloadUri("testDownloadUri");
90 int result = jujuvnfd.hashCode();
91 assertEquals(-1870623759, result);
95 public void testEquals() {
96 boolean result = new JujuVnfd().equals(new JujuVnfd());
101 public void testEquals1() {
102 boolean result = new JujuVnfd().equals("");
107 public void testEquals2() {
108 JujuDriver obj = new JujuDriver();
109 boolean result = new JujuVnfd().equals(obj);
114 public void testEquals3() {
115 JujuVnfd obj = new JujuVnfd();
116 obj.setDownloadUri("testDownloadUri");
117 boolean result = new JujuVnfd().equals(obj);
122 public void testEquals4() {
123 JujuVnfd obj = new JujuVnfd();
124 boolean result = obj.equals(obj);
129 public void testEquals5() {
130 boolean result = new JujuVnfd().equals(null);
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);
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);