4166101c4a97c10b674bfbf3bc92832e25c03095
[ccsdk/features.git] /
1 /*
2  * Copyright (c) 2019 Red Hat, Inc. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
9
10 import org.junit.Test;
11 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.database.HtMapper;
12 import org.onap.ccsdk.features.sdnr.wt.devicemanager.performancemanager.impl.database.types.EsHistoricalPerformance15Minutes;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
14 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.LayerProtocolName;
15 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
16 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
17 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.LpBuilder;
18 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.air._interface.historical.performances.g.HistoricalPerformanceDataListBuilder;
19
20 public class TestMapper {
21
22     @Test
23     public void test() {
24
25         int t = 0;
26         System.out.println(t++);
27
28         HtMapper<EsHistoricalPerformance15Minutes> mapper = new HtMapper<>(EsHistoricalPerformance15Minutes.class);
29         System.out.println(t++);
30
31
32         Lp layerProtocol = new LpBuilder().setUuid(new UniversalId("TestId")).setLayerProtocolName(new LayerProtocolName("LayprotcolTest")).build();
33         System.out.println(t++);
34         EsHistoricalPerformance15Minutes pmData = new EsHistoricalPerformance15Minutes("Testnode", layerProtocol);
35         System.out.println(t++);
36
37         //AirInterfaceHistoricalPerformancesBuilder builder1 = new AirInterfaceHistoricalPerformancesBuilder();
38         //System.out.println(t++);
39
40
41         HistoricalPerformanceDataListBuilder builder2 = new HistoricalPerformanceDataListBuilder();
42         System.out.println(t++);
43         builder2.setPeriodEndTime(new DateAndTime("2019-06-06T12:12:12.1Z"));
44         System.out.println(t++);
45
46         String json = mapper.objectToJson(pmData);
47
48         System.out.println("Result: "+pmData);
49         System.out.println("Result: "+json);
50
51         //fail("Not yet implemented");
52     }
53
54 }