use of org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext in project netconf by opendaylight.
the class NetconfDeviceDataBrokerTest method getDataBroker.
private NetconfDeviceDataBroker getDataBroker(final String... caps) {
NetconfSessionPreferences prefs = NetconfSessionPreferences.fromStrings(Arrays.asList(caps));
final RemoteDeviceId id = new RemoteDeviceId("device-1", InetSocketAddress.createUnresolved("localhost", 17830));
return new NetconfDeviceDataBroker(id, new EmptyMountPointContext(SCHEMA_CONTEXT), rpcService, prefs);
}
use of org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext in project netconf by opendaylight.
the class NetconfMessageTransformerTest method testCreateSubscriberNotificationSchemaNotPresent.
@Test
public void testCreateSubscriberNotificationSchemaNotPresent() throws Exception {
final NetconfMessageTransformer transformer = new NetconfMessageTransformer(new EmptyMountPointContext(SCHEMA), true, BASE_SCHEMAS.getBaseSchemaWithNotifications());
NetconfMessage netconfMessage = transformer.toRpcRequest(CREATE_SUBSCRIPTION_RPC_QNAME, CREATE_SUBSCRIPTION_RPC_CONTENT);
String documentString = XmlUtil.toString(netconfMessage.getDocument());
assertThat(documentString, CoreMatchers.containsString("<create-subscription"));
assertThat(documentString, CoreMatchers.containsString("<rpc"));
}
use of org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext in project netconf by opendaylight.
the class NetconfToNotificationTest method testMostRecentWrongYangModel.
@Test
public void testMostRecentWrongYangModel() throws Exception {
final EffectiveModelContext schemaContext = getNotificationSchemaContext(getClass(), true);
messageTransformer = new NetconfMessageTransformer(new EmptyMountPointContext(schemaContext), true, BASE_SCHEMAS.getBaseSchema());
assertThrows(IllegalArgumentException.class, () -> messageTransformer.toNotification(userNotification));
}
use of org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext in project netconf by opendaylight.
the class NetconfDataTreeServiceImplTest method getNetconService.
private AbstractNetconfDataTreeService getNetconService() {
NetconfSessionPreferences prefs = NetconfSessionPreferences.fromStrings(Collections.singletonList(NetconfMessageTransformUtil.NETCONF_CANDIDATE_URI.toString()));
final RemoteDeviceId id = new RemoteDeviceId("device-1", InetSocketAddress.createUnresolved("localhost", 17830));
return AbstractNetconfDataTreeService.of(id, new EmptyMountPointContext(SCHEMA_CONTEXT), rpcService, prefs);
}
use of org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext in project yangtools by opendaylight.
the class AbstractMountPointChild method normalizeTo.
@Override
public final NormalizedNode normalizeTo(final EffectiveModelContext schemaContext) throws IOException {
final NormalizedNodeResult result = new NormalizedNodeResult();
final NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result);
writeTo(streamWriter, new EmptyMountPointContext(schemaContext));
return result.getResult();
}
Aggregations