Remove DocumentedException.ErrorType
[netconf.git] / netconf / netconf-topology-singleton / src / test / java / org / opendaylight / netconf / topology / singleton / impl / tx / ProxyReadWriteTransactionTest.java
index 60cf7fab8e399b216fbbbd18d1b3b74985910c6d..83f1dd9ae980d88941398f655abee0538037e284 100644 (file)
@@ -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<Optional<NormalizedNode<?, ?>>> read = tx.read(STORE, PATH);
+        final ListenableFuture<Optional<NormalizedNode>> 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<NormalizedNode<?, ?>> result = read.get(5, TimeUnit.SECONDS);
+        final Optional<NormalizedNode> 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<Optional<NormalizedNode<?, ?>>> read = tx.read(STORE, PATH);
+        final ListenableFuture<Optional<NormalizedNode>> read = tx.read(STORE, PATH);
         masterActor.expectMsgClass(ReadRequest.class);
         masterActor.reply(new EmptyReadResponse());
-        final Optional<NormalizedNode<?, ?>> result = read.get(5, TimeUnit.SECONDS);
+        final Optional<NormalizedNode> 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<Optional<NormalizedNode<?, ?>>> read = tx.read(STORE, PATH);
+        final ListenableFuture<Optional<NormalizedNode>> 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<Optional<NormalizedNode<?, ?>>> read = tx.read(STORE, PATH);
+        final ListenableFuture<Optional<NormalizedNode>> read = tx.read(STORE, PATH);
         final ListenableFuture<Boolean> 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());
     }
 }