diff options
author | Michael Dürre <michael.duerre@highstreet-technologies.com> | 2024-08-15 10:04:54 +0200 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2024-09-12 15:48:04 -0400 |
commit | 7964e8aa9b9748678f6dadfe7b0c17c936679351 (patch) | |
tree | f4859812acd6ccccdaa698c567bb121f03f7b985 /sdnr/wt/netconfnode-state-service/provider/src/test | |
parent | 556306410bc9c3a421cde351d287adeb705d1e8c (diff) |
migrate sdnr features to potassium
adapt features and poms for potassium-sr2
Issue-ID: CCSDK-4046
Change-Id: I67e8fc442811eca40c19f1f3777f1a36812d3e35
Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/netconfnode-state-service/provider/src/test')
5 files changed, 45 insertions, 10 deletions
diff --git a/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/TestNetconfNodeStateService.java b/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/TestNetconfNodeStateService.java index ee1f72158..e97f4e80e 100644 --- a/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/TestNetconfNodeStateService.java +++ b/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/TestNetconfNodeStateService.java @@ -61,7 +61,7 @@ import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSeriali import org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext; import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers; import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider; -import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.ConnectionOper.ConnectionStatus; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev240118.ConnectionOper.ConnectionStatus; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNode; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNodeBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconfnode.state.rev191011.AttributeChangeNotification; diff --git a/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/example/ExampleConfig.java b/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/example/ExampleConfig.java index caf7d9c1b..9ed43f5d6 100644 --- a/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/example/ExampleConfig.java +++ b/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/example/ExampleConfig.java @@ -22,7 +22,6 @@ package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.test.example; import java.io.IOException; -import java.net.URI; import java.util.Objects; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.DomContext; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.impl.access.dom.DomParser; @@ -32,12 +31,11 @@ import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.XMLNamespace; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizationResult; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; import org.opendaylight.yangtools.yang.parser.api.YangParser; import org.opendaylight.yangtools.yang.parser.api.YangParserException; -import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -63,10 +61,10 @@ public class ExampleConfig { final EffectiveModelContext schemaContext = parser.buildEffectiveModel(); // (2) parsing of configuration into binding-independent format - final NormalizedNode data = DomParser.parseJsonFile("/example.json", schemaContext); + final NormalizationResult<?> data = DomParser.parseJsonFile("/example.json", schemaContext); // (3) conversion into binding-aware format (md-sal codec needs to know about path on which data is placed) - final Configuration config = (Configuration) domContext.getBindingNormalizedNodeSerializer().fromNormalizedNode(CONFIGURATION_PATH, data) + final Configuration config = (Configuration) domContext.getBindingNormalizedNodeSerializer().fromNormalizedNode(CONFIGURATION_PATH, data.data()) .getValue(); // (4) printing some useful information diff --git a/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/example/TestNetconfHelper.java b/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/example/TestNetconfHelper.java index 5b7104621..511ad424e 100644 --- a/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/example/TestNetconfHelper.java +++ b/sdnr/wt/netconfnode-state-service/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/test/example/TestNetconfHelper.java @@ -27,9 +27,9 @@ import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.impl.NetconfNodeS import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.impl.access.NetconfAccessorImpl; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.impl.access.NetconfCommunicatorManager; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.impl.access.dom.DomContextImpl; -import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.ConnectionOper.ConnectionStatus; -import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.connection.oper.AvailableCapabilitiesBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.connection.oper.available.capabilities.AvailableCapabilityBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev240118.ConnectionOper.ConnectionStatus; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev240118.connection.oper.AvailableCapabilitiesBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev240118.connection.oper.available.capabilities.AvailableCapabilityBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNode; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNodeBuilder; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; @@ -40,7 +40,8 @@ public class TestNetconfHelper extends Mockito { /** * Provide a test node. - * @param nodeIdString + * @param nodeId + * @param capabilityString */ public static Node getTestNode(NodeId nodeId, String capabilityString) { NetconfNodeBuilder netconfNodeBuilder = new NetconfNodeBuilder(); diff --git a/sdnr/wt/netconfnode-state-service/provider/src/test/resources/example.json b/sdnr/wt/netconfnode-state-service/provider/src/test/resources/example.json new file mode 100644 index 000000000..e37eb8d6f --- /dev/null +++ b/sdnr/wt/netconfnode-state-service/provider/src/test/resources/example.json @@ -0,0 +1,16 @@ +{ + "config:configuration": { + "config1": "test", + "config2": true, + "entry": [ + { + "setting": "set1", + "value": 1 + }, + { + "setting": "set1", + "value": 2 + } + ] + } +}
\ No newline at end of file diff --git a/sdnr/wt/netconfnode-state-service/provider/src/test/resources/sample.json b/sdnr/wt/netconfnode-state-service/provider/src/test/resources/sample.json new file mode 100644 index 000000000..b1f3e14e8 --- /dev/null +++ b/sdnr/wt/netconfnode-state-service/provider/src/test/resources/sample.json @@ -0,0 +1,20 @@ +{ + "config:configuration": { + "config1": "this is a test", + "entry": [ + { + "setting": "setting-3", + "value": 255 + }, + { + "setting": "setting-1", + "value": 1 + }, + { + "setting": "setting-2", + "value": 2 + } + ], + "config2": true + } +}
\ No newline at end of file |