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.vnfmadapter.service.entity;
19 import static org.junit.Assert.*;
21 import org.junit.Before;
22 import org.junit.Test;
24 public class VnfmTest {
32 vnfm.setVnfdId("1234");
33 vnfm.setVnfPackageId("abcd");
37 public void hashCodeTest(){
38 Vnfm tempVnfm = new Vnfm();
39 tempVnfm.setId("123");
41 tempVnfm.setVnfdId("1234");
42 tempVnfm.setVnfPackageId("abcd");
43 assertTrue(vnfm.hashCode() == tempVnfm.hashCode());
47 public void equalsTest1(){
48 Vnfm tempVnfm = new Vnfm();
49 tempVnfm.setId("123");
51 tempVnfm.setVnfdId("1234");
52 tempVnfm.setVnfPackageId("abcd");
53 assertTrue(vnfm.equals(tempVnfm));
57 public void equalsTest2(){
58 assertTrue(vnfm.equals(vnfm));
62 public void equalsTest3(){
64 assertTrue(!vnfm.equals(null));
67 public void equalsTest4(){
69 assertTrue(!vnfm.equals(new Object()));
72 public void equalsTest5(){
74 assertTrue(!vnfm.equals(new Object()));