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.service;
22 import java.util.List;
23 import org.junit.Before;
24 import org.junit.Test;
25 import org.onap.dmaap.dbcapi.model.ApiError;
26 import org.onap.dmaap.dbcapi.model.DcaeLocation;
27 import org.onap.dmaap.dbcapi.model.MR_Cluster;
28 import org.onap.dmaap.dbcapi.testframework.ReflectionHarness;
30 public class MR_ClusterServiceTest {
32 ReflectionHarness rh = new ReflectionHarness();
37 public void setUp() throws Exception {
38 System.setProperty("ConfigFile", "src/test/resources/dmaapbc.properties");
39 ns = new MR_ClusterService();
44 rh.reflect( "org.onap.dmaap.dbcapi.service.MR_ClusterService", "get", null );
49 String v = "Validate";
50 rh.reflect( "org.onap.dmaap.dbcapi.service.MR_ClusterService", "set", v );
55 String f = "mrsn01.onap.org";
56 String locname = "central-demo";
58 DcaeLocationService dls = new DcaeLocationService();
59 DcaeLocation loc = new DcaeLocation( "CLLI1234", "some-onap", locname, "aZone", "10.10.10.0/24" );
60 dls.addDcaeLocation( loc );
62 ApiError err = new ApiError();
63 String[] h = { "zplvm009.onap.org", "zplvm007.onap.org", "zplvm008.onap.org" };
64 MR_Cluster node = new MR_Cluster( locname, f, "http", "3904");
65 MR_Cluster n2 = ns.addMr_Cluster( node, err );
68 n2 = ns.getMr_Cluster( f, err );
71 List<MR_Cluster> l = ns.getAllMr_Clusters();
73 n2 = ns.updateMr_Cluster( n2, err );
75 n2 = ns.removeMr_Cluster( f, err );