2 * ============LICENSE_START=======================================================
3 * ONAP : ccsdk features
4 * ================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property.
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
22 package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
24 import static org.junit.Assert.fail;
25 import java.io.IOException;
26 import org.junit.Test;
27 import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.YangToolsMapper2;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.pmdata._15m.list.output.Data;
30 public class TestDataMappings {
33 private static final String PMDATA15M_SERVERDB_JSON = "{\n"
34 + "\"node-name\": \"sim2\",\n"
35 + "\"uuid-interface\": \"LP-MWPS-TTP-01\",\n"
36 + "\"layer-protocol-name\": \"MWPS\",\n"
37 + "\"radio-signal-id\": \"Test11\",\n"
38 + "\"time-stamp\": \"2017-07-04T14:00:00.0Z\",\n"
39 + "\"granularity-period\": \"Period15Min\",\n"
40 + "\"scanner-id\": \"PM_RADIO_15M_9\",\n"
41 + "\"performance-data\": {\n"
43 + "\"rx-level-avg\": -41,\n"
44 + "\"time2-states\": -1,\n"
45 + "\"time4-states-s\": 0,\n"
46 + "\"time4-states\": 0,\n"
47 + "\"time8-states\": 0,\n"
48 + "\"time16-states-s\": -1,\n"
49 + "\"time16-states\": 0,\n"
50 + "\"time32-states\": 0,\n"
51 + "\"time64-states\": 0,\n"
52 + "\"time128-states\": 0,\n"
53 + "\"time256-states\": 900,\n"
54 + "\"time512-states\": -1,\n"
55 + "\"time512-states-l\": -1,\n"
56 + "\"time1024-states\": -1,\n"
57 + "\"time1024-states-l\": -1,\n"
58 + "\"time2048-states\": -1,\n"
59 + "\"time2048-states-l\": -1,\n"
60 + "\"time4096-states\": -1,\n"
61 + "\"time4096-states-l\": -1,\n"
62 + "\"time8192-states\": -1,\n"
63 + "\"time8192-states-l\": -1,\n"
64 + "\"snir-min\": -99,\n"
65 + "\"snir-max\": -99,\n"
66 + "\"snir-avg\": -99,\n"
67 + "\"xpd-min\": -99,\n"
68 + "\"xpd-max\": -99,\n"
69 + "\"xpd-avg\": -99,\n"
70 + "\"rf-temp-min\": -99,\n"
71 + "\"rf-temp-max\": -99,\n"
72 + "\"rf-temp-avg\": -99,\n"
73 + "\"defect-blocks-sum\": -1,\n"
74 + "\"time-period\": 900,\n"
75 + "\"tx-level-min\": 25,\n"
76 + "\"tx-level-max\": 25,\n"
77 + "\"tx-level-avg\": 25,\n"
78 + "\"rx-level-min\": -41,\n"
79 + "\"rx-level-max\": -41,\n"
80 + "\"unavailability\": 0,\n"
84 + "\"suspect-interval-flag\": false\n"
88 public void testPmData15m() throws ClassNotFoundException {
90 YangToolsMapper2<Data> mapper = new YangToolsMapper2<Data>(Data.class, null);
92 Data data = mapper.readValue(PMDATA15M_SERVERDB_JSON.getBytes(), Data.class);
93 System.out.println(data);
94 } catch (IOException e) {
96 fail("Can not parse data");