2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.onap.dmaap.dbcapi.model;
22 import static org.junit.Assert.*;
24 import java.lang.reflect.Constructor;
25 import java.lang.reflect.InvocationTargetException;
26 import java.lang.reflect.Method;
28 import org.junit.After;
29 import org.junit.Before;
30 import org.junit.Test;
31 public class DcaeLocationTest {
32 String c, dl, dln, osz, s, edge;
35 public void setUp() throws Exception {
45 public void tearDown() throws Exception {
50 public void testDcaeLocationDefaultConstructor() {
52 DcaeLocation t = new DcaeLocation();
54 assertTrue( t.getClli() == null );
55 assertTrue( t.getDcaeLayer() == null );
56 assertTrue( t.getDcaeLocationName() == null );
57 assertTrue( t.getOpenStackAvailabilityZone() == null );
58 assertTrue( t.getSubnet() == null );
63 public void testDcaeLocationClassConstructor() {
65 DcaeLocation t = new DcaeLocation( c, dl, dln, osz, s );
67 assertTrue( c.equals( t.getClli() ));
68 assertTrue( dl.equals( t.getDcaeLayer() ));
69 assertTrue( dln.equals( t.getDcaeLocationName() ));
70 assertTrue( osz.equals( t.getOpenStackAvailabilityZone() ));
71 assertTrue( s.equals( t.getSubnet() ));
75 public void testDmaapClassSetters() {
77 DcaeLocation t = new DcaeLocation();
80 assertTrue( c.equals( t.getClli() ));
82 assertTrue( dl.equals( t.getDcaeLayer() ));
83 assertTrue( t.isCentral() );
84 t.setDcaeLayer( edge );
85 assertTrue( edge.equals( t.getDcaeLayer() ));
86 assertTrue( t.isLocal() );
87 t.setDcaeLocationName( dln );
88 assertTrue( dln.equals( t.getDcaeLocationName() ));
89 t.setOpenStackAvailabilityZone( osz );
90 assertTrue( osz.equals( t.getOpenStackAvailabilityZone() ));
92 assertTrue( s.equals( t.getSubnet() ));