From 62468daa9029368b321b6e1e18fa9cfa0ae994b4 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 8 Nov 2022 11:30:12 +0100 Subject: [PATCH] Bump upstreams Adopt: - odlparent-12.0.0 - yangtools-10.0.0 - mdsal-11.0.0-SNAPSHOT Update toaster test to not use the same transaction for both config and oper access. Update RPC invocation paths to assume ContainerNode as opposed to a plain NormalizedNode. Change-Id: I31c6350746be4e176a389d8a14a12de89119a78b Signed-off-by: Robert Varga --- akka/pom.xml | 2 +- akka/repackaged-akka-jar/pom.xml | 2 +- artifacts/pom.xml | 2 +- benchmark/pom.xml | 2 +- bundle-parent/pom.xml | 2 +- docs/pom.xml | 8 +++--- .../features-controller-experimental/pom.xml | 2 +- features/features-controller-testing/pom.xml | 2 +- features/features-controller/pom.xml | 2 +- .../src/main/feature/feature.xml | 2 +- .../src/main/feature/feature.xml | 8 +++--- .../src/main/feature/feature.xml | 8 +++--- .../src/main/feature/feature.xml | 2 +- .../src/main/feature/feature.xml | 4 +-- .../src/main/feature/feature.xml | 4 +-- .../src/main/feature/feature.xml | 10 +++---- .../src/main/feature/feature.xml | 10 +++---- .../odl-toaster/src/main/feature/feature.xml | 2 +- features/pom.xml | 2 +- features/single-feature-parent/pom.xml | 2 +- jolokia/pom.xml | 2 +- karaf/pom.xml | 2 +- opendaylight/blueprint/pom.xml | 6 ++--- .../netty-event-executor-config/pom.xml | 2 +- .../config/netty-threadgroup-config/pom.xml | 2 +- .../config/netty-timer-config/pom.xml | 2 +- opendaylight/config/pom.xml | 2 +- .../config/threadpool-config-api/pom.xml | 2 +- .../config/threadpool-config-impl/pom.xml | 2 +- opendaylight/md-sal/mdsal-it-base/pom.xml | 4 +-- opendaylight/md-sal/mdsal-it-parent/pom.xml | 2 +- opendaylight/md-sal/parent/pom.xml | 2 +- opendaylight/md-sal/pom.xml | 2 +- .../md-sal/sal-clustering-config/pom.xml | 2 +- .../controller/remote/rpc/OpsInvoker.java | 5 ++-- .../remote/rpc/RemoteRpcImplementation.java | 5 ++-- .../remote/rpc/messages/ExecuteRpc.java | 10 +++---- .../remote/rpc/messages/RpcResponse.java | 21 ++++++++++++--- .../remote/rpc/AbstractOpsTest.java | 4 +-- .../controller/remote/rpc/OpsBrokerTest.java | 2 +- .../rpc/RemoteOpsImplementationTest.java | 27 +++++++++---------- .../clustering-test-app/configuration/pom.xml | 2 +- .../it/karaf/cli/AbstractDOMRpcAction.java | 6 ++--- .../lowlevel/tgt/GetConstantCommand.java | 4 +-- .../tgt/GetContextedConstantCommand.java | 4 +-- .../tgt/GetSingletonConstantCommand.java | 4 +-- .../samples/clustering-test-app/pom.xml | 2 +- .../it/provider/impl/GetConstantService.java | 4 +-- .../impl/RoutedGetConstantService.java | 4 +-- .../impl/SingletonGetConstantService.java | 4 +-- opendaylight/md-sal/samples/pom.xml | 2 +- .../provider/OpenDaylightToasterTest.java | 12 ++++++--- pom.xml | 2 +- 53 files changed, 126 insertions(+), 110 deletions(-) diff --git a/akka/pom.xml b/akka/pom.xml index 03dc415254..9216338c51 100644 --- a/akka/pom.xml +++ b/akka/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.odlparent odlparent-lite - 11.0.2 + 12.0.0 diff --git a/akka/repackaged-akka-jar/pom.xml b/akka/repackaged-akka-jar/pom.xml index 0b3c531e0a..449afdf2c9 100644 --- a/akka/repackaged-akka-jar/pom.xml +++ b/akka/repackaged-akka-jar/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent - 11.0.2 + 12.0.0 diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 9026b82d0d..5dfc9ca4ea 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -14,7 +14,7 @@ org.opendaylight.odlparent odlparent-lite - 11.0.2 + 12.0.0 diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 28f0e5b784..26205a7119 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -10,7 +10,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent odlparent-lite - 11.0.2 + 12.0.0 diff --git a/bundle-parent/pom.xml b/bundle-parent/pom.xml index 124f941e39..14975c071d 100644 --- a/bundle-parent/pom.xml +++ b/bundle-parent/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.mdsal dom-parent - 10.0.3 + 11.0.0-SNAPSHOT diff --git a/docs/pom.xml b/docs/pom.xml index fa1ad9deef..87323d794d 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.odlparent odlparent - 11.0.2 + 12.0.0 @@ -229,9 +229,9 @@ http://netty.io/4.1/api/ https://commons.apache.org/proper/commons-lang/javadocs/api-release/ - https://www.javadoc.io/doc/org.opendaylight.odlparent/odlparent-docs/11.0.2/ - https://www.javadoc.io/doc/org.opendaylight.yangtools/yangtools-docs/9.0.2/ - https://www.javadoc.io/doc/org.opendaylight.mdsal/mdsal-docs/10.0.3/ + https://www.javadoc.io/doc/org.opendaylight.odlparent/odlparent-docs/12.0.0/ + https://www.javadoc.io/doc/org.opendaylight.yangtools/yangtools-docs/10.0.0/ + https://www.javadoc.io/doc/org.opendaylight.mdsal/mdsal-docs/11.0.0-SNAPSHOT/ diff --git a/features/features-controller-experimental/pom.xml b/features/features-controller-experimental/pom.xml index ac072739d3..bcd13960bb 100644 --- a/features/features-controller-experimental/pom.xml +++ b/features/features-controller-experimental/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.odlparent feature-repo-parent - 11.0.2 + 12.0.0 diff --git a/features/features-controller-testing/pom.xml b/features/features-controller-testing/pom.xml index e141bf32f8..7f7a890640 100644 --- a/features/features-controller-testing/pom.xml +++ b/features/features-controller-testing/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.odlparent feature-repo-parent - 11.0.2 + 12.0.0 diff --git a/features/features-controller/pom.xml b/features/features-controller/pom.xml index b57d0ce2e6..e84c71fb0f 100644 --- a/features/features-controller/pom.xml +++ b/features/features-controller/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.odlparent feature-repo-parent - 11.0.2 + 12.0.0 diff --git a/features/odl-clustering-test-app/src/main/feature/feature.xml b/features/odl-clustering-test-app/src/main/feature/feature.xml index e31d50148b..1a4c7ad2b8 100644 --- a/features/odl-clustering-test-app/src/main/feature/feature.xml +++ b/features/odl-clustering-test-app/src/main/feature/feature.xml @@ -8,6 +8,6 @@ --> - odl-mdsal-model-rfc6991 + odl-mdsal-model-rfc6991 diff --git a/features/odl-controller-blueprint/src/main/feature/feature.xml b/features/odl-controller-blueprint/src/main/feature/feature.xml index e0e9c955d3..b339ffa8e6 100644 --- a/features/odl-controller-blueprint/src/main/feature/feature.xml +++ b/features/odl-controller-blueprint/src/main/feature/feature.xml @@ -8,10 +8,10 @@ --> - odl-yangtools-codec - odl-mdsal-binding-api - odl-mdsal-binding-runtime - odl-mdsal-dom-api + odl-yangtools-codec + odl-mdsal-binding-api + odl-mdsal-binding-runtime + odl-mdsal-dom-api mvn:org.opendaylight.controller/blueprint/${project.version} diff --git a/features/odl-controller-broker-local/src/main/feature/feature.xml b/features/odl-controller-broker-local/src/main/feature/feature.xml index d5fe32cb96..d2c697508f 100644 --- a/features/odl-controller-broker-local/src/main/feature/feature.xml +++ b/features/odl-controller-broker-local/src/main/feature/feature.xml @@ -8,9 +8,9 @@ --> - odl-mdsal-dom - odl-mdsal-eos-binding - odl-mdsal-eos-dom - odl-mdsal-singleton-dom + odl-mdsal-dom + odl-mdsal-eos-binding + odl-mdsal-eos-dom + odl-mdsal-singleton-dom diff --git a/features/odl-controller-exp-netty-config/src/main/feature/feature.xml b/features/odl-controller-exp-netty-config/src/main/feature/feature.xml index 5e6bc3c088..9b07644cc0 100644 --- a/features/odl-controller-exp-netty-config/src/main/feature/feature.xml +++ b/features/odl-controller-exp-netty-config/src/main/feature/feature.xml @@ -8,6 +8,6 @@ --> - odl-netty-4 + odl-netty-4 diff --git a/features/odl-controller-mdsal-common/src/main/feature/feature.xml b/features/odl-controller-mdsal-common/src/main/feature/feature.xml index 567080d1d9..48c9fe5cfe 100644 --- a/features/odl-controller-mdsal-common/src/main/feature/feature.xml +++ b/features/odl-controller-mdsal-common/src/main/feature/feature.xml @@ -8,7 +8,7 @@ --> - odl-mdsal-common - odl-mdsal-binding-runtime + odl-mdsal-common + odl-mdsal-binding-runtime diff --git a/features/odl-mdsal-broker/src/main/feature/feature.xml b/features/odl-mdsal-broker/src/main/feature/feature.xml index f10a915c9a..215415b961 100644 --- a/features/odl-mdsal-broker/src/main/feature/feature.xml +++ b/features/odl-mdsal-broker/src/main/feature/feature.xml @@ -8,7 +8,7 @@ --> - odl-mdsal-singleton-dom - odl-mdsal-eos-binding + odl-mdsal-singleton-dom + odl-mdsal-eos-binding diff --git a/features/odl-mdsal-clustering-commons/src/main/feature/feature.xml b/features/odl-mdsal-clustering-commons/src/main/feature/feature.xml index b206e7f439..d2d5c009f9 100644 --- a/features/odl-mdsal-clustering-commons/src/main/feature/feature.xml +++ b/features/odl-mdsal-clustering-commons/src/main/feature/feature.xml @@ -8,10 +8,10 @@ --> - odl-apache-commons-lang3 - odl-dropwizard-metrics - odl-servlet-api - odl-yangtools-data - odl-yangtools-codec + odl-apache-commons-lang3 + odl-dropwizard-metrics + odl-servlet-api + odl-yangtools-data + odl-yangtools-codec diff --git a/features/odl-mdsal-distributed-datastore/src/main/feature/feature.xml b/features/odl-mdsal-distributed-datastore/src/main/feature/feature.xml index d5c6767065..0fd16bd9aa 100644 --- a/features/odl-mdsal-distributed-datastore/src/main/feature/feature.xml +++ b/features/odl-mdsal-distributed-datastore/src/main/feature/feature.xml @@ -8,11 +8,11 @@ --> - odl-apache-commons-text - odl-yangtools-codec - odl-mdsal-eos-dom - odl-mdsal-dom-broker - odl-mdsal-binding-dom-adapter + odl-apache-commons-text + odl-yangtools-codec + odl-mdsal-eos-dom + odl-mdsal-dom-broker + odl-mdsal-binding-dom-adapter mvn:org.opendaylight.controller/sal-clustering-config/${project.version}/xml/akkaconf diff --git a/features/odl-toaster/src/main/feature/feature.xml b/features/odl-toaster/src/main/feature/feature.xml index cb2bf7e301..9a8e7aad42 100644 --- a/features/odl-toaster/src/main/feature/feature.xml +++ b/features/odl-toaster/src/main/feature/feature.xml @@ -8,6 +8,6 @@ --> - odl-mdsal-binding-runtime + odl-mdsal-binding-runtime diff --git a/features/pom.xml b/features/pom.xml index ebb20e6b54..654978eadd 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.odlparent odlparent-lite - 11.0.2 + 12.0.0 diff --git a/features/single-feature-parent/pom.xml b/features/single-feature-parent/pom.xml index 36f3983573..4de91aa52f 100644 --- a/features/single-feature-parent/pom.xml +++ b/features/single-feature-parent/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.odlparent single-feature-parent - 11.0.2 + 12.0.0 diff --git a/jolokia/pom.xml b/jolokia/pom.xml index cfa8697e99..797d1f02f5 100644 --- a/jolokia/pom.xml +++ b/jolokia/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.odlparent odlparent - 11.0.2 + 12.0.0 diff --git a/karaf/pom.xml b/karaf/pom.xml index 65b84ac2cb..34d2cd91bb 100644 --- a/karaf/pom.xml +++ b/karaf/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.odlparent karaf4-parent - 11.0.2 + 12.0.0 diff --git a/opendaylight/blueprint/pom.xml b/opendaylight/blueprint/pom.xml index 9c9c94ad69..b15b276477 100644 --- a/opendaylight/blueprint/pom.xml +++ b/opendaylight/blueprint/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.odlparent bundle-parent - 11.0.2 + 12.0.0 @@ -27,14 +27,14 @@ org.opendaylight.yangtools yangtools-artifacts - 9.0.2 + 10.0.0 pom import org.opendaylight.mdsal mdsal-artifacts - 10.0.3 + 11.0.0-SNAPSHOT pom import diff --git a/opendaylight/config/netty-event-executor-config/pom.xml b/opendaylight/config/netty-event-executor-config/pom.xml index d93b078cc1..c012c836d4 100644 --- a/opendaylight/config/netty-event-executor-config/pom.xml +++ b/opendaylight/config/netty-event-executor-config/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent bundle-parent - 11.0.2 + 12.0.0 diff --git a/opendaylight/config/netty-threadgroup-config/pom.xml b/opendaylight/config/netty-threadgroup-config/pom.xml index 1085614266..0e8d6325cd 100644 --- a/opendaylight/config/netty-threadgroup-config/pom.xml +++ b/opendaylight/config/netty-threadgroup-config/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent bundle-parent - 11.0.2 + 12.0.0 diff --git a/opendaylight/config/netty-timer-config/pom.xml b/opendaylight/config/netty-timer-config/pom.xml index 578c5fc7dd..01c3e63864 100644 --- a/opendaylight/config/netty-timer-config/pom.xml +++ b/opendaylight/config/netty-timer-config/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent bundle-parent - 11.0.2 + 12.0.0 diff --git a/opendaylight/config/pom.xml b/opendaylight/config/pom.xml index 148696fa20..31ca9c90ff 100644 --- a/opendaylight/config/pom.xml +++ b/opendaylight/config/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 11.0.2 + 12.0.0 diff --git a/opendaylight/config/threadpool-config-api/pom.xml b/opendaylight/config/threadpool-config-api/pom.xml index 49a9f41885..955934318b 100644 --- a/opendaylight/config/threadpool-config-api/pom.xml +++ b/opendaylight/config/threadpool-config-api/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent bundle-parent - 11.0.2 + 12.0.0 diff --git a/opendaylight/config/threadpool-config-impl/pom.xml b/opendaylight/config/threadpool-config-impl/pom.xml index 47f55afcda..69c4381fc6 100644 --- a/opendaylight/config/threadpool-config-impl/pom.xml +++ b/opendaylight/config/threadpool-config-impl/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent bundle-parent - 11.0.2 + 12.0.0 diff --git a/opendaylight/md-sal/mdsal-it-base/pom.xml b/opendaylight/md-sal/mdsal-it-base/pom.xml index d3fc071a07..c93f86436b 100644 --- a/opendaylight/md-sal/mdsal-it-base/pom.xml +++ b/opendaylight/md-sal/mdsal-it-base/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent bundle-parent - 11.0.2 + 12.0.0 @@ -26,7 +26,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.mdsal mdsal-artifacts - 10.0.3 + 11.0.0-SNAPSHOT pom import diff --git a/opendaylight/md-sal/mdsal-it-parent/pom.xml b/opendaylight/md-sal/mdsal-it-parent/pom.xml index 925df5e1b8..4e1eb5bb24 100644 --- a/opendaylight/md-sal/mdsal-it-parent/pom.xml +++ b/opendaylight/md-sal/mdsal-it-parent/pom.xml @@ -13,7 +13,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent bundle-parent - 11.0.2 + 12.0.0 diff --git a/opendaylight/md-sal/parent/pom.xml b/opendaylight/md-sal/parent/pom.xml index e730a89dd9..9d5a26bf2b 100644 --- a/opendaylight/md-sal/parent/pom.xml +++ b/opendaylight/md-sal/parent/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.mdsal binding-parent - 10.0.3 + 11.0.0-SNAPSHOT diff --git a/opendaylight/md-sal/pom.xml b/opendaylight/md-sal/pom.xml index b53d20cbf0..07dabe99e2 100644 --- a/opendaylight/md-sal/pom.xml +++ b/opendaylight/md-sal/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 11.0.2 + 12.0.0 diff --git a/opendaylight/md-sal/sal-clustering-config/pom.xml b/opendaylight/md-sal/sal-clustering-config/pom.xml index 4f6724024b..5301e3a66f 100644 --- a/opendaylight/md-sal/sal-clustering-config/pom.xml +++ b/opendaylight/md-sal/sal-clustering-config/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.odlparent odlparent-lite - 11.0.2 + 12.0.0 diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/OpsInvoker.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/OpsInvoker.java index 4ac3867d67..9c47e68faa 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/OpsInvoker.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/OpsInvoker.java @@ -33,7 +33,6 @@ import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.RpcError; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -import org.opendaylight.yangtools.yang.model.api.SchemaPath; import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute; /** @@ -102,8 +101,8 @@ final class OpsInvoker extends AbstractUntypedActor { @Override Object response(final QName type, final DOMRpcResult result) { - final Collection errors = result.getErrors(); - return errors.isEmpty() ? new RpcResponse(result.getResult()) + final Collection errors = result.errors(); + return errors.isEmpty() ? new RpcResponse(result.value()) // This is legacy (wrong) behavior, which ignores the fact that errors may be just warnings, // discarding any output : new Failure(new RpcErrorsException(String.format("Execution of rpc %s failed", type), diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementation.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementation.java index 67da0963ee..3046f7e6dd 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementation.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementation.java @@ -13,7 +13,7 @@ import org.opendaylight.controller.remote.rpc.messages.ExecuteRpc; import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier; import org.opendaylight.mdsal.dom.api.DOMRpcImplementation; import org.opendaylight.mdsal.dom.api.DOMRpcResult; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; /** * A {@link DOMRpcImplementation} which routes invocation requests to a remote invoker actor. @@ -26,8 +26,7 @@ final class RemoteRpcImplementation extends AbstractRemoteImplementation invokeRpc(final DOMRpcIdentifier rpc, - final NormalizedNode input) { + public ListenableFuture invokeRpc(final DOMRpcIdentifier rpc, final ContainerNode input) { return new RemoteDOMRpcFuture(rpc.getType(), ask(ExecuteRpc.from(rpc, input))); } diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteRpc.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteRpc.java index 873c5b8901..d9f6a67b5f 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteRpc.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteRpc.java @@ -17,20 +17,20 @@ import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput; import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataOutput; import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeStreamVersion; -public final class ExecuteRpc extends AbstractExecute { +public final class ExecuteRpc extends AbstractExecute { private static final long serialVersionUID = 1128904894827335676L; - private ExecuteRpc(final @NonNull QName type, final @Nullable NormalizedNode input) { + private ExecuteRpc(final @NonNull QName type, final @Nullable ContainerNode input) { super(type, input); } public static @NonNull ExecuteRpc from(final @NonNull DOMRpcIdentifier rpc, - final @Nullable NormalizedNode input) { + final @Nullable ContainerNode input) { return new ExecuteRpc(rpc.getType(), input); } @@ -67,7 +67,7 @@ public final class ExecuteRpc extends AbstractExecute { +public class RpcResponse extends AbstractResponse { private static final long serialVersionUID = -4211279498688989245L; - public RpcResponse(final @Nullable NormalizedNode output) { + public RpcResponse(final @Nullable ContainerNode output) { super(output); } @@ -27,6 +30,18 @@ public class RpcResponse extends AbstractResponse { return new Proxy(this); } + static @Nullable ContainerNode unmaskContainer(final Optional optNode) + throws InvalidObjectException { + if (optNode.isEmpty()) { + return null; + } + final var node = optNode.orElseThrow(); + if (node instanceof ContainerNode container) { + return container; + } + throw new InvalidObjectException("Unexpected data " + node.contract().getSimpleName()); + } + private static class Proxy implements Externalizable { private static final long serialVersionUID = 1L; @@ -49,7 +64,7 @@ public class RpcResponse extends AbstractResponse { @Override public void readExternal(final ObjectInput in) throws IOException { - rpcResponse = new RpcResponse(SerializationUtils.readNormalizedNode(in).orElse(null)); + rpcResponse = new RpcResponse(unmaskContainer(SerializationUtils.readNormalizedNode(in))); } private Object readResolve() { diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/AbstractOpsTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/AbstractOpsTest.java index 8947d2e705..643e50e895 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/AbstractOpsTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/AbstractOpsTest.java @@ -156,7 +156,7 @@ public class AbstractOpsTest { final ErrorType errorType, final String tag, final String message, final String applicationTag, final String info, final String causeMsg) { assertNotNull("RpcResult was null", rpcResult); - final Collection rpcErrors = rpcResult.getErrors(); + final Collection rpcErrors = rpcResult.errors(); assertEquals("RpcErrors count", 1, rpcErrors.size()); assertRpcErrorEquals(rpcErrors.iterator().next(), severity, errorType, tag, message, applicationTag, info, causeMsg); @@ -164,7 +164,7 @@ public class AbstractOpsTest { static void assertSuccessfulRpcResult(final DOMRpcResult rpcResult, final NormalizedNode expOutput) { assertNotNull("RpcResult was null", rpcResult); - assertCompositeNodeEquals(expOutput, rpcResult.getResult()); + assertCompositeNodeEquals(expOutput, rpcResult.value()); } static class TestException extends Exception { diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/OpsBrokerTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/OpsBrokerTest.java index a4e00591d1..8e6d17edc7 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/OpsBrokerTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/OpsBrokerTest.java @@ -40,7 +40,7 @@ public class OpsBrokerTest extends AbstractOpsTest { final RpcResponse rpcResponse = rpcRegistry1Probe.expectMsgClass(Duration.ofSeconds(5), RpcResponse.class); - assertEquals(rpcResult.getResult(), rpcResponse.getOutput()); + assertEquals(rpcResult.value(), rpcResponse.getOutput()); } @Test diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteOpsImplementationTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteOpsImplementationTest.java index 6af91a1ee8..259655976d 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteOpsImplementationTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteOpsImplementationTest.java @@ -52,9 +52,8 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest { final ContainerNode rpcOutput = makeRPCOutput("bar"); final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput); - final NormalizedNode invokeRpcInput = makeRPCInput("foo"); - final ArgumentCaptor inputCaptor = - ArgumentCaptor.forClass(NormalizedNode.class); + final ContainerNode invokeRpcInput = makeRPCInput("foo"); + final ArgumentCaptor inputCaptor = ArgumentCaptor.forClass(ContainerNode.class); doReturn(FluentFutures.immediateFluentFuture(rpcResult)).when(domRpcService2) .invokeRpc(eq(TEST_RPC), inputCaptor.capture()); @@ -63,7 +62,7 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest { assertThat(frontEndFuture, instanceOf(RemoteDOMRpcFuture.class)); final DOMRpcResult result = frontEndFuture.get(5, TimeUnit.SECONDS); - assertEquals(rpcOutput, result.getResult()); + assertEquals(rpcOutput, result.value()); } /** @@ -93,7 +92,7 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest { final ContainerNode rpcOutput = makeRPCOutput("bar"); final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput); - final ArgumentCaptor inputCaptor = ArgumentCaptor.forClass(NormalizedNode.class); + final ArgumentCaptor inputCaptor = ArgumentCaptor.forClass(ContainerNode.class); doReturn(FluentFutures.immediateFluentFuture(rpcResult)).when(domRpcService2) .invokeRpc(eq(TEST_RPC), inputCaptor.capture()); @@ -102,7 +101,7 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest { assertThat(frontEndFuture, instanceOf(RemoteDOMRpcFuture.class)); final DOMRpcResult result = frontEndFuture.get(5, TimeUnit.SECONDS); - assertEquals(rpcOutput, result.getResult()); + assertEquals(rpcOutput, result.value()); } /** @@ -133,8 +132,8 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest { final ContainerNode rpcOutput = null; final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput); - final NormalizedNode invokeRpcInput = makeRPCInput("foo"); - final ArgumentCaptor inputCaptor = ArgumentCaptor.forClass(NormalizedNode.class); + final ContainerNode invokeRpcInput = makeRPCInput("foo"); + final ArgumentCaptor inputCaptor = ArgumentCaptor.forClass(ContainerNode.class); doReturn(FluentFutures.immediateFluentFuture(rpcResult)).when(domRpcService2) .invokeRpc(eq(TEST_RPC), inputCaptor.capture()); @@ -143,7 +142,7 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest { assertThat(frontEndFuture, instanceOf(RemoteDOMRpcFuture.class)); final DOMRpcResult result = frontEndFuture.get(5, TimeUnit.SECONDS); - assertNull(result.getResult()); + assertNull(result.value()); } /** @@ -151,8 +150,8 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest { */ @Test public void testInvokeRpcWithRemoteFailedFuture() { - final NormalizedNode invokeRpcInput = makeRPCInput("foo"); - final ArgumentCaptor inputCaptor = ArgumentCaptor.forClass(NormalizedNode.class); + final ContainerNode invokeRpcInput = makeRPCInput("foo"); + final ArgumentCaptor inputCaptor = ArgumentCaptor.forClass(ContainerNode.class); doReturn(FluentFutures.immediateFailedFluentFuture(new RemoteDOMRpcException("Test Exception", null))) .when(domRpcService2).invokeRpc(eq(TEST_RPC), inputCaptor.capture()); @@ -190,7 +189,7 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest { @Ignore @Test public void testInvokeRpcWithAkkaTimeoutException() { - final NormalizedNode invokeRpcInput = makeRPCInput("foo"); + final ContainerNode invokeRpcInput = makeRPCInput("foo"); final ListenableFuture frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput); assertThat(frontEndFuture, instanceOf(RemoteDOMRpcFuture.class)); @@ -202,10 +201,10 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest { */ @Test public void testInvokeRpcWithLookupException() { - final NormalizedNode invokeRpcInput = makeRPCInput("foo"); + final ContainerNode invokeRpcInput = makeRPCInput("foo"); doThrow(new RuntimeException("test")).when(domRpcService2).invokeRpc(any(QName.class), - any(NormalizedNode.class)); + any(ContainerNode.class)); final ListenableFuture frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput); assertThat(frontEndFuture, instanceOf(RemoteDOMRpcFuture.class)); diff --git a/opendaylight/md-sal/samples/clustering-test-app/configuration/pom.xml b/opendaylight/md-sal/samples/clustering-test-app/configuration/pom.xml index 2d6bdc79fd..5f40825c2a 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/configuration/pom.xml +++ b/opendaylight/md-sal/samples/clustering-test-app/configuration/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.odlparent odlparent-lite - 11.0.2 + 12.0.0 diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/AbstractDOMRpcAction.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/AbstractDOMRpcAction.java index ab2269eb5b..b8fcf74319 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/AbstractDOMRpcAction.java +++ b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/AbstractDOMRpcAction.java @@ -17,12 +17,12 @@ public abstract class AbstractDOMRpcAction implements Action { @SuppressWarnings("checkstyle:RegexpSinglelineJava") public final Object execute() throws InterruptedException, ExecutionException { final DOMRpcResult result = invokeRpc().get(); - if (!result.getErrors().isEmpty()) { + if (!result.errors().isEmpty()) { // FIXME: is there a better way to report errors? - System.out.println("Invocation failed: " + result.getErrors()); + System.out.println("Invocation failed: " + result.errors()); return null; } else { - return result.getResult().prettyTree().get(); + return result.value().prettyTree().get(); } } diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/tgt/GetConstantCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/tgt/GetConstantCommand.java index 86866db9e3..8cc874a9b2 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/tgt/GetConstantCommand.java +++ b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/tgt/GetConstantCommand.java @@ -18,7 +18,7 @@ import org.opendaylight.mdsal.dom.api.DOMRpcService; import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.target.rev170215.GetConstantInput; import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.target.rev170215.GetConstantInputBuilder; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @Service @Command(scope = "test-app", name = "get-constant", description = "Run an get-constant test") @@ -30,7 +30,7 @@ public class GetConstantCommand extends AbstractDOMRpcAction { @Override protected ListenableFuture invokeRpc() { - final NormalizedNode input = serializer.toNormalizedNodeRpcData(new GetConstantInputBuilder().build()); + final ContainerNode input = serializer.toNormalizedNodeRpcData(new GetConstantInputBuilder().build()); return rpcService.invokeRpc(QName.create(GetConstantInput.QNAME, "get-constant"), input); } } diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/tgt/GetContextedConstantCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/tgt/GetContextedConstantCommand.java index 75ebec4f63..762daad4c3 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/tgt/GetContextedConstantCommand.java +++ b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/tgt/GetContextedConstantCommand.java @@ -20,7 +20,7 @@ import org.opendaylight.mdsal.dom.api.DOMRpcService; import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.target.rev170215.GetContextedConstantInput; import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.target.rev170215.GetContextedConstantInputBuilder; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @Service @Command(scope = "test-app", name = "get-contexted-constant", description = "Run an get-contexted-constant test") @@ -36,7 +36,7 @@ public class GetContextedConstantCommand extends AbstractDOMRpcAction { @Override protected ListenableFuture invokeRpc() { - final NormalizedNode inputNode = serializer.toNormalizedNodeRpcData(new GetContextedConstantInputBuilder() + final ContainerNode inputNode = serializer.toNormalizedNodeRpcData(new GetContextedConstantInputBuilder() .setContext(iidSupport.parseArgument(context)) .build()); return rpcService.invokeRpc(QName.create(GetContextedConstantInput.QNAME, "get-contexted-constant"), inputNode); diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/tgt/GetSingletonConstantCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/tgt/GetSingletonConstantCommand.java index 466f2e3795..1713ecc9ab 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/tgt/GetSingletonConstantCommand.java +++ b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/tgt/GetSingletonConstantCommand.java @@ -18,7 +18,7 @@ import org.opendaylight.mdsal.dom.api.DOMRpcService; import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.target.rev170215.GetSingletonConstantInput; import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.target.rev170215.GetSingletonConstantInputBuilder; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @Service @Command(scope = "test-app", name = "get-singleton-constant", description = "Run an get-singleton-constant test") @@ -30,7 +30,7 @@ public class GetSingletonConstantCommand extends AbstractDOMRpcAction { @Override protected ListenableFuture invokeRpc() { - final NormalizedNode inputNode = + final ContainerNode inputNode = serializer.toNormalizedNodeRpcData(new GetSingletonConstantInputBuilder().build()); return rpcService.invokeRpc(QName.create(GetSingletonConstantInput.QNAME, "get-singleton-constant"), inputNode); } diff --git a/opendaylight/md-sal/samples/clustering-test-app/pom.xml b/opendaylight/md-sal/samples/clustering-test-app/pom.xml index 16258cc4bd..988034b9e8 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/pom.xml +++ b/opendaylight/md-sal/samples/clustering-test-app/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 11.0.2 + 12.0.0 diff --git a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/GetConstantService.java b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/GetConstantService.java index 284586c1cf..0ab114ba8b 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/GetConstantService.java +++ b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/GetConstantService.java @@ -21,7 +21,7 @@ import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.XMLNamespace; import org.opendaylight.yangtools.yang.common.YangConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; import org.slf4j.Logger; @@ -52,7 +52,7 @@ public final class GetConstantService implements DOMRpcImplementation { } @Override - public ListenableFuture invokeRpc(final DOMRpcIdentifier rpc, final NormalizedNode input) { + public ListenableFuture invokeRpc(final DOMRpcIdentifier rpc, final ContainerNode input) { LOG.debug("get-constant invoked, current value: {}", constant); return Futures.immediateFuture(new DefaultDOMRpcResult(Builders.containerBuilder() diff --git a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/RoutedGetConstantService.java b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/RoutedGetConstantService.java index 34a333521b..2e8a355ca5 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/RoutedGetConstantService.java +++ b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/RoutedGetConstantService.java @@ -24,7 +24,7 @@ import org.opendaylight.yangtools.yang.common.XMLNamespace; import org.opendaylight.yangtools.yang.common.YangConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; import org.slf4j.Logger; @@ -59,7 +59,7 @@ public final class RoutedGetConstantService implements DOMRpcImplementation { } @Override - public ListenableFuture invokeRpc(final DOMRpcIdentifier rpc, final NormalizedNode input) { + public ListenableFuture invokeRpc(final DOMRpcIdentifier rpc, final ContainerNode input) { LOG.debug("get-contexted-constant invoked, current value: {}", constant); return Futures.immediateFuture(new DefaultDOMRpcResult(Builders.containerBuilder() diff --git a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/SingletonGetConstantService.java b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/SingletonGetConstantService.java index d53b89e903..577981f4fc 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/SingletonGetConstantService.java +++ b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/SingletonGetConstantService.java @@ -25,7 +25,7 @@ import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.XMLNamespace; import org.opendaylight.yangtools.yang.common.YangConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; import org.slf4j.Logger; @@ -65,7 +65,7 @@ public final class SingletonGetConstantService implements DOMRpcImplementation, } @Override - public ListenableFuture invokeRpc(final DOMRpcIdentifier rpc, final NormalizedNode input) { + public ListenableFuture invokeRpc(final DOMRpcIdentifier rpc, final ContainerNode input) { LOG.debug("get-singleton-constant invoked, current value: {}", constant); return Futures.immediateFuture(new DefaultDOMRpcResult(Builders.containerBuilder() diff --git a/opendaylight/md-sal/samples/pom.xml b/opendaylight/md-sal/samples/pom.xml index 254798e4e8..a77ccfa15e 100644 --- a/opendaylight/md-sal/samples/pom.xml +++ b/opendaylight/md-sal/samples/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 11.0.2 + 12.0.0 diff --git a/opendaylight/md-sal/samples/toaster-provider/src/test/java/org/opendaylight/controller/sample/toaster/provider/OpenDaylightToasterTest.java b/opendaylight/md-sal/samples/toaster-provider/src/test/java/org/opendaylight/controller/sample/toaster/provider/OpenDaylightToasterTest.java index 4851522cb8..b703a2b20b 100644 --- a/opendaylight/md-sal/samples/toaster-provider/src/test/java/org/opendaylight/controller/sample/toaster/provider/OpenDaylightToasterTest.java +++ b/opendaylight/md-sal/samples/toaster-provider/src/test/java/org/opendaylight/controller/sample/toaster/provider/OpenDaylightToasterTest.java @@ -54,8 +54,10 @@ public class OpenDaylightToasterTest extends AbstractConcurrentDataBrokerTest { public void testToasterInitOnStartUp() throws Exception { DataBroker broker = getDataBroker(); - ReadTransaction readTx = broker.newReadOnlyTransaction(); - Optional optional = readTx.read(LogicalDatastoreType.OPERATIONAL, TOASTER_IID).get(); + Optional optional; + try (ReadTransaction readTx = broker.newReadOnlyTransaction()) { + optional = readTx.read(LogicalDatastoreType.OPERATIONAL, TOASTER_IID).get(); + } assertNotNull(optional); assertTrue("Operational toaster not present", optional.isPresent()); @@ -65,8 +67,10 @@ public class OpenDaylightToasterTest extends AbstractConcurrentDataBrokerTest { assertEquals(new DisplayString("Opendaylight"), toasterData.getToasterManufacturer()); assertEquals(new DisplayString("Model 1 - Binding Aware"), toasterData.getToasterModelNumber()); - Optional configToaster = readTx.read(LogicalDatastoreType.CONFIGURATION, TOASTER_IID).get(); - assertFalse("Didn't expect config data for toaster.", configToaster.isPresent()); + try (ReadTransaction readTx = broker.newReadOnlyTransaction()) { + Boolean configToaster = readTx.exists(LogicalDatastoreType.CONFIGURATION, TOASTER_IID).get(); + assertFalse("Didn't expect config data for toaster.", configToaster); + } } @Test diff --git a/pom.xml b/pom.xml index 18fe8c37af..84d0528e17 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 11.0.2 + 12.0.0 -- 2.36.6