5b00cbb785611e2a88cba8c5d4f01a38f23b4eee
[ccsdk/features.git] /
1 /*******************************************************************************
2  * ============LICENSE_START=======================================================
3  * ONAP : ccsdk feature sdnr wt
4  *  ================================================================================
5  * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property.
6  * All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  ******************************************************************************/
21 package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
22
23 import static org.junit.Assert.*;
24 import org.junit.Test;
25 import org.onap.ccsdk.features.sdnr.wt.devicemanager.config.impl.GeoConfig;
26
27 public class TestGeoConfig {
28
29     @Test
30     public void test() {
31         GeoConfig config;
32         try {
33             System.out.println("testing clusternode geo config1");
34             System.out.println("===========================");
35             config = GeoConfig.parse(getClusterGeoConfigContent());
36             System.out.println("succeeded: ");
37             System.out.println(config.toString());
38             System.out.println("primary roles:");
39             System.out.println(config.getPrimaryRoles().toString());
40             System.out.println("secondary roles:");
41             System.out.println(config.getSecondaryRoles().toString());
42
43         } catch (Exception e) {
44             fail("failed: " + e.getMessage());
45         }
46     }
47
48
49
50     private static String getClusterGeoConfigContent() {
51         return "\n" + "lumina-geo-cluster {\n" + "    primary_roles = [\n"
52                 + "   \"member-1\",\"member-2\",\"member-3\"\n" + "    ]\n" + "    secondary_roles = [\n"
53                 + "   \"member-4\",\"member-5\",\"member-6\"\n" + "    ]\n" + "    ip_roles_table = [\n" + "\n"
54                 + "   {\n" + "role=\"member-1\"\n" + "ip=\"zltcmtn23arbc01.2f0377.mtn23a.tci.att.com\"\n" + "},\n"
55                 + "{\n" + "role=\"member-2\"\n" + "ip=\"zltcmtn23arbc02.2f0377.mtn23a.tci.att.com\"\n" + "},\n" + "{\n"
56                 + "role=\"member-3\"\n" + "ip=\"zltcmtn23arbc03.2f0377.mtn23a.tci.att.com\"\n" + "},\n" + "{\n"
57                 + "role=\"member-4\"\n" + "ip=\"zltcmtn23brbc01.f84e7a.mtn23b.tci.att.com\"\n" + "},\n" + "{\n"
58                 + "role=\"member-5\"\n" + "ip=\"zltcmtn23brbc02.f84e7a.mtn23b.tci.att.com\"\n" + "},\n" + "{\n"
59                 + "role=\"member-6\"\n" + "ip=\"zltcmtn23brbc03.f84e7a.mtn23b.tci.att.com\"\n" + "}\n" + "    \n"
60                 + "   ]\n" + "}\n" + "\n" + "\n" + "\n" + "\n" + "";
61     }
62
63 }