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;
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();
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());
}
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());
}
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));
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);
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());
}
}