diff options
author | Michael Dürre <michael.duerre@highstreet-technologies.com> | 2022-07-20 09:32:50 +0200 |
---|---|---|
committer | Michael Dürre <michael.duerre@highstreet-technologies.com> | 2022-07-21 12:38:52 +0200 |
commit | 25423c50e504676f15c7a57c03aad40bfc35c7e6 (patch) | |
tree | 811649e2ec44e0332e601c6563e00e914d355b9a /sdnr/wt/devicemanager-onap/openroadm/provider | |
parent | cea47224b7b6afdd7b3d3ead8d08baf46eadc575 (diff) |
migrate sdnr features to sulfur
fix sdnr code for sulfur
Issue-ID: CCSDK-3692
Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com>
Change-Id: I0a62ade424bb978222e7ce6450215fb327f957b7
Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-onap/openroadm/provider')
4 files changed, 42 insertions, 28 deletions
diff --git a/sdnr/wt/devicemanager-onap/openroadm/provider/pom.xml b/sdnr/wt/devicemanager-onap/openroadm/provider/pom.xml index 5098575cb..0505bb06c 100644 --- a/sdnr/wt/devicemanager-onap/openroadm/provider/pom.xml +++ b/sdnr/wt/devicemanager-onap/openroadm/provider/pom.xml @@ -20,13 +20,14 @@ ~ ============LICENSE_END======================================================= ~ --> + <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.4.0</version> + <version>2.4.1-SNAPSHOT</version> <relativePath/> </parent> @@ -50,26 +51,11 @@ </properties> <dependencies> - <!-- begin for testing --> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>2.28.2</version> - <scope>test</scope> - </dependency> - <dependency> - <artifactId>byte-buddy</artifactId> - <groupId>net.bytebuddy</groupId> - <version>1.9.10</version> - <scope>test</scope> - </dependency> - - <!-- end for testing --> - <dependency> <groupId>${project.groupId}</groupId> <artifactId>ietf-alarms</artifactId> <version>${project.version}</version> + <scope>provided</scope> </dependency> <dependency> <groupId>${project.groupId}</groupId> @@ -87,7 +73,19 @@ <artifactId>sdnr-wt-data-provider-model</artifactId> <version>${project.version}</version> <scope>provided</scope> - </dependency> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>sdnr-wt-websocketmanager-model</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>sdnr-wt-common</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>sdnr-wt-netconfnode-state-service-model</artifactId> @@ -104,6 +102,19 @@ <artifactId>org.osgi.core</artifactId> <scope>provided</scope> </dependency> + <!-- begin for testing --> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <version>3.2.4</version> + <scope>test</scope> + </dependency> + <dependency> + <artifactId>byte-buddy</artifactId> + <groupId>net.bytebuddy</groupId> + <scope>test</scope> + </dependency> + <!-- end for testing --> </dependencies> <build> diff --git a/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java b/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java index 87f195dc3..4d64cca19 100644 --- a/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java +++ b/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java @@ -32,6 +32,7 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl.OpenroadmChangeNotificationListener; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit.pack.features.CircuitPackComponents; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.EditOperationType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfConfigChange; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.netconf.config.change.Edit; @@ -56,7 +57,7 @@ public class TestChangeNotificationListener { OpenroadmChangeNotificationListener notifListener = new OpenroadmChangeNotificationListener(netconfAccessor, databaseService, notificationService); when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID)); - Iterable<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() { + List<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() { @Override public int compareTo(PathArgument arg0) { @@ -65,10 +66,10 @@ public class TestChangeNotificationListener { @Override public Class<? extends DataObject> getType() { - return DataObject.class; + return CircuitPackComponents.class; } }); - InstanceIdentifier<?> target = InstanceIdentifier.create(pathArguments); + InstanceIdentifier<?> target = InstanceIdentifier.unsafeOf(pathArguments); notifListener.onNetconfConfigChange(createNotification(EditOperationType.Create, target)); EventlogEntity event = new EventlogBuilder().setNodeId(NODEID) diff --git a/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmDeviceChangeNotification.java b/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmDeviceChangeNotification.java index ca9ce351c..2e94e79ef 100644 --- a/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmDeviceChangeNotification.java +++ b/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmDeviceChangeNotification.java @@ -41,6 +41,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.CreateTe import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.CreateTechInfoNotificationBuilder; import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.change.notification.Edit; import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.change.notification.EditBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit.pack.features.circuit.pack.components.Component; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.EditOperationType; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity; @@ -65,7 +66,7 @@ public class TestOpenRoadmDeviceChangeNotification { public void testOnChangeNotification() { when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID)); - Iterable<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() { + List<? extends PathArgument> pathArguments = Arrays.asList(new PathArgument() { @Override public int compareTo(PathArgument arg0) { @@ -74,10 +75,10 @@ public class TestOpenRoadmDeviceChangeNotification { @Override public Class<? extends DataObject> getType() { - return DataObject.class; + return Component.class; } }); - InstanceIdentifier<?> target = InstanceIdentifier.create(pathArguments); + InstanceIdentifier<?> target = InstanceIdentifier.unsafeOf(pathArguments); deviceChangeListener.onChangeNotification(createNotification(EditOperationType.Create, target)); EventlogEntity event = diff --git a/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmPMDataBuilder.java b/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmPMDataBuilder.java index 2a70ec7b6..202449033 100644 --- a/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmPMDataBuilder.java +++ b/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmPMDataBuilder.java @@ -40,6 +40,7 @@ import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.http.org.openroadm.common.alarm.pm.types.rev191129.Direction; import org.opendaylight.yang.gen.v1.http.org.openroadm.common.alarm.pm.types.rev191129.Location; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev191129.circuit.pack.features.circuit.pack.components.Component; import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.HistoricalPmList; import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.historical.pm.group.HistoricalPm; import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev191129.historical.pm.group.HistoricalPmBuilder; @@ -142,10 +143,10 @@ public class TestOpenRoadmPMDataBuilder { @Override public @NonNull Class<? extends DataObject> getType() { // TODO Auto-generated method stub - return Pmdata15mEntity.class; + return Component.class; } }; - historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.create(Arrays.asList(pa))) + historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.unsafeOf(Arrays.asList(pa))) .setPmResourceTypeExtension("dshjdekjdewkk") .setPmResourceType(ResourceTypeEnum.CircuitPack).setHistoricalPm(historicalPMCollection); @@ -179,11 +180,11 @@ public class TestOpenRoadmPMDataBuilder { @Override public Class<? extends DataObject> getType() { // TODO Auto-generated method stub - return Pmdata15mEntity.class; + return Component.class; } }; historicalPMCollection.put(historicalPmBuilder.key(), historicalPmBuilder.build()); - historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.create(Arrays.asList(pa))) + historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.unsafeOf(Arrays.asList(pa))) .setPmResourceTypeExtension("dshjdekjdewkk") .setPmResourceType(ResourceTypeEnum.Device).setHistoricalPm(historicalPMCollection); |