X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fnetconf-topology-singleton%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Ftopology%2Fsingleton%2Fimpl%2Ftx%2FProxyReadWriteTransactionTest.java;h=83f1dd9ae980d88941398f655abee0538037e284;hb=276fb1df2ffee67a9ee7fb5e7c9a78d1cb62bdc8;hp=60cf7fab8e399b216fbbbd18d1b3b74985910c6d;hpb=1d91e1bbe29d0da6ea427a5d0837064c8a3d5134;p=netconf.git diff --git a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ProxyReadWriteTransactionTest.java b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ProxyReadWriteTransactionTest.java index 60cf7fab8e..83f1dd9ae9 100644 --- a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ProxyReadWriteTransactionTest.java +++ b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ProxyReadWriteTransactionTest.java @@ -43,6 +43,8 @@ import org.opendaylight.netconf.topology.singleton.messages.transactions.MergeRe import org.opendaylight.netconf.topology.singleton.messages.transactions.PutRequest; import org.opendaylight.netconf.topology.singleton.messages.transactions.ReadRequest; import org.opendaylight.netconf.topology.singleton.messages.transactions.SubmitRequest; +import org.opendaylight.yangtools.yang.common.ErrorSeverity; +import org.opendaylight.yangtools.yang.common.ErrorType; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -56,7 +58,7 @@ public class ProxyReadWriteTransactionTest { private static final FiniteDuration EXP_NO_MESSAGE_TIMEOUT = Duration.apply(300, TimeUnit.MILLISECONDS); private static final RemoteDeviceId DEVICE_ID = new RemoteDeviceId("dev1", InetSocketAddress.createUnresolved("localhost", 17830)); - private static final YangInstanceIdentifier PATH = YangInstanceIdentifier.EMPTY; + private static final YangInstanceIdentifier PATH = YangInstanceIdentifier.empty(); private static final LogicalDatastoreType STORE = LogicalDatastoreType.CONFIGURATION; private static ActorSystem system = ActorSystem.apply(); @@ -203,13 +205,13 @@ public class ProxyReadWriteTransactionTest { public void testRead() throws Exception { ProxyReadWriteTransaction tx = newSuccessfulProxyTx(); - final ListenableFuture>> read = tx.read(STORE, PATH); + final ListenableFuture> read = tx.read(STORE, PATH); final ReadRequest readRequest = masterActor.expectMsgClass(ReadRequest.class); assertEquals(STORE, readRequest.getStore()); assertEquals(PATH, readRequest.getPath()); masterActor.reply(new NormalizedNodeMessage(PATH, node)); - final Optional> result = read.get(5, TimeUnit.SECONDS); + final Optional result = read.get(5, TimeUnit.SECONDS); assertTrue(result.isPresent()); assertEquals(node, result.get()); } @@ -218,10 +220,10 @@ public class ProxyReadWriteTransactionTest { public void testReadEmpty() throws Exception { ProxyReadWriteTransaction tx = newSuccessfulProxyTx(); - final ListenableFuture>> read = tx.read(STORE, PATH); + final ListenableFuture> read = tx.read(STORE, PATH); masterActor.expectMsgClass(ReadRequest.class); masterActor.reply(new EmptyReadResponse()); - final Optional> result = read.get(5, TimeUnit.SECONDS); + final Optional result = read.get(5, TimeUnit.SECONDS); assertFalse(result.isPresent()); } @@ -229,7 +231,7 @@ public class ProxyReadWriteTransactionTest { public void testReadFailure() throws InterruptedException, TimeoutException { ProxyReadWriteTransaction tx = newSuccessfulProxyTx(); - final ListenableFuture>> read = tx.read(STORE, PATH); + final ListenableFuture> read = tx.read(STORE, PATH); masterActor.expectMsgClass(ReadRequest.class); final RuntimeException mockEx = new RuntimeException("fail"); masterActor.reply(new Failure(mockEx)); @@ -327,7 +329,7 @@ public class ProxyReadWriteTransactionTest { ProxyReadWriteTransaction tx = new ProxyReadWriteTransaction(DEVICE_ID, promise.future(), system.dispatcher(), Timeout.apply(5, TimeUnit.SECONDS)); - final ListenableFuture>> read = tx.read(STORE, PATH); + final ListenableFuture> read = tx.read(STORE, PATH); final ListenableFuture exists = tx.exists(STORE, PATH); tx.put(STORE, PATH, node); @@ -400,8 +402,8 @@ public class ProxyReadWriteTransactionTest { private static void verifyDocumentedException(final Throwable cause) { assertTrue("Unexpected cause " + cause, cause instanceof DocumentedException); final DocumentedException de = (DocumentedException) cause; - assertEquals(DocumentedException.ErrorSeverity.WARNING, de.getErrorSeverity()); + assertEquals(ErrorSeverity.WARNING, de.getErrorSeverity()); assertEquals(DocumentedException.ErrorTag.OPERATION_FAILED, de.getErrorTag()); - assertEquals(DocumentedException.ErrorType.APPLICATION, de.getErrorType()); + assertEquals(ErrorType.APPLICATION, de.getErrorType()); } }