837784aecf5fc2241c2cafcc1c5c3621edfcdc74
[ccsdk/features.git] /
1 /*******************************************************************************
2  * ============LICENSE_START======================================================= ONAP : ccsdk
3  * feature sdnr wt ================================================================================
4  * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
5  * ================================================================================ Licensed under
6  * the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
7  * with the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software distributed under the License
12  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13  * or implied. See the License for the specific language governing permissions and limitations under
14  * the License. ============LICENSE_END=========================================================
15  ******************************************************************************/
16 package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
17
18 import org.junit.Test;
19 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.database.HtMapper;
20 import org.onap.ccsdk.features.sdnr.wt.devicemanager.performancemanager.impl.database.types.EsHistoricalPerformance15Minutes;
21 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
22 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.LayerProtocolName;
23 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
24 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
25 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.LpBuilder;
26 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.air._interface.historical.performances.g.HistoricalPerformanceDataListBuilder;
27
28 public class TestMapper {
29
30     @Test
31     public void test1() {
32
33         int t = 0;
34         System.out.println(t++);
35
36         HtMapper<EsHistoricalPerformance15Minutes> mapper = new HtMapper<>(EsHistoricalPerformance15Minutes.class);
37         System.out.println(t++);
38
39
40         Lp layerProtocol = new LpBuilder().setUuid(new UniversalId("TestId"))
41                 .setLayerProtocolName(new LayerProtocolName("LayprotcolTest")).build();
42         System.out.println(t++);
43         EsHistoricalPerformance15Minutes pmData = new EsHistoricalPerformance15Minutes("Testnode", layerProtocol);
44         System.out.println(t++);
45
46         // AirInterfaceHistoricalPerformancesBuilder builder1 = new
47         // AirInterfaceHistoricalPerformancesBuilder();
48         // System.out.println(t++);
49
50
51         HistoricalPerformanceDataListBuilder builder2 = new HistoricalPerformanceDataListBuilder();
52         System.out.println(t++);
53         builder2.setPeriodEndTime(new DateAndTime("2019-06-06T12:12:12.1Z"));
54         System.out.println(t++);
55
56         String json = mapper.objectToJson(pmData);
57
58         System.out.println("Result: " + pmData);
59         System.out.println("Result: " + json);
60
61         // fail("Not yet implemented");
62     }
63 }