diff options
author | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2022-02-01 15:02:52 +0530 |
---|---|---|
committer | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2022-02-01 15:03:06 +0530 |
commit | ba8b9a7ff4bef265f1f9a802932a0796c60b9cca (patch) | |
tree | 2d89094d91c55ce54a23d7065e966b40b4099aa2 /sdnr/wt/devicemanager-onap/onf12/provider/src/test | |
parent | 9912e1626d93afeb4f7148dd5d826ae1caa1ef8a (diff) |
Update ONF12 devicemanager
Performance data handling refactorization
Issue-ID: CCSDK-3575
Change-Id: Iae95b3250c2f1d7ee9353b3833bcd4270ea63d12
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-onap/onf12/provider/src/test')
4 files changed, 62 insertions, 3 deletions
diff --git a/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java b/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java index 9135c38cb..4049a549d 100644 --- a/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java +++ b/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java @@ -29,6 +29,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.Wrapper import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolName; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.binding.api.DataBroker; @@ -285,7 +286,7 @@ public class TestWrapperMicrowaveModelRev170324 { } @Test - public void testgetLtpHistoricalPerformanceData() { + public void testgetLtpHistoricalPerformanceData() throws InconsistentPMDataException { InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID = InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(uid)) .child(AirInterfaceConfiguration.class).build(); diff --git a/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java b/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java index bc4434f26..078890fd2 100644 --- a/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java +++ b/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java @@ -29,6 +29,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.Wrapper import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolName; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; @@ -281,7 +282,7 @@ public class TestWrapperMicrowaveModelRev180907 { } @Test - public void testgetLtpHistoricalPerformanceData() { + public void testgetLtpHistoricalPerformanceData() throws InconsistentPMDataException { InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID = InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(uid)) .child(AirInterfaceConfiguration.class).build(); diff --git a/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java b/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java index 3dfbdd2e0..51e9dae72 100644 --- a/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java +++ b/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java @@ -29,6 +29,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.Wrapper import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolName; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.binding.api.DataBroker; @@ -286,7 +287,7 @@ public class TestWrapperMicrowaveModelRev181010 { } @Test - public void testgetLtpHistoricalPerformanceData() { + public void testgetLtpHistoricalPerformanceData() throws InconsistentPMDataException { InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID = InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(uid)) .child(AirInterfaceConfiguration.class).build(); diff --git a/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperNoPmData.java b/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperNoPmData.java new file mode 100644 index 000000000..1cda8716d --- /dev/null +++ b/sdnr/wt/devicemanager-onap/onf12/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperNoPmData.java @@ -0,0 +1,56 @@ +/* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt + * ================================================================================================= + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.pm.PerformanceDataAirInterface170324Builder; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException; +import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId; +import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp; +import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.LpBuilder; +import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performances.g.HistoricalPerformanceDataList; +import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performances.g.HistoricalPerformanceDataListBuilder; +import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performance.type.g.PerformanceData; +import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performance.type.g.PerformanceDataBuilder; +import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceConfiguration; +import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceConfigurationBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; + +public class TestWrapperNoPmData { + + @Test + public void test() { + NodeId nodeId = new NodeId("TestNode"); + Lp lp = new LpBuilder().setUuid(new UniversalId("NodeUUID")).build(); + //Build empty, without PerformanceData + HistoricalPerformanceDataList pmRecord = + new HistoricalPerformanceDataListBuilder().setHistoryDataId("1").build(); + AirInterfaceConfiguration airConfiguration = new AirInterfaceConfigurationBuilder().build(); + + @SuppressWarnings("unused") + Exception exception = assertThrows(InconsistentPMDataException.class, () -> { + PerformanceDataAirInterface170324Builder pmdata = + new PerformanceDataAirInterface170324Builder(nodeId, lp, pmRecord, airConfiguration); + }); + String expectedMessage = "Ignore record without PerformanceData. Node/Lp: NodeUUID/default"; + String actualMessage = exception.getMessage(); + assertEquals(actualMessage,expectedMessage); + } +} |