import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.available.capabilities.AvailableCapability;
import org.opendaylight.yangtools.rfc8528.data.api.MountPointContext;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.Revision;
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.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.repo.api.EffectiveModelContextFactory;
import org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException;
-import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
import org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository;
import org.opendaylight.yangtools.yang.model.repo.api.SchemaResolutionException;
import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
public static final String TEST_NAMESPACE = "test:namespace";
public static final String TEST_MODULE = "test-module";
public static final String TEST_REVISION = "2013-07-22";
- public static final SourceIdentifier TEST_SID =
- RevisionSourceIdentifier.create(TEST_MODULE, Revision.of(TEST_REVISION));
+ public static final SourceIdentifier TEST_SID = new SourceIdentifier(TEST_MODULE, TEST_REVISION);
public static final String TEST_CAPABILITY =
TEST_NAMESPACE + "?module=" + TEST_MODULE + "&revision=" + TEST_REVISION;
- public static final SourceIdentifier TEST_SID2 =
- RevisionSourceIdentifier.create(TEST_MODULE + "2", Revision.of(TEST_REVISION));
+ public static final SourceIdentifier TEST_SID2 = new SourceIdentifier(TEST_MODULE + "2", TEST_REVISION);
public static final String TEST_CAPABILITY2 =
TEST_NAMESPACE + "?module=" + TEST_MODULE + "2" + "&revision=" + TEST_REVISION;
@Test
public void testNetconfDeviceFlawedModelFailedResolution() throws Exception {
- final RemoteDeviceHandler<NetconfSessionPreferences> facade = getFacade();
+ final RemoteDeviceHandler facade = getFacade();
final NetconfDeviceCommunicator listener = getListener();
final EffectiveModelContextFactory schemaFactory = getSchemaFactory();
public void testNetconfDeviceFailFirstSchemaFailSecondEmpty() throws Exception {
final ArrayList<String> capList = Lists.newArrayList(TEST_CAPABILITY);
- final RemoteDeviceHandler<NetconfSessionPreferences> facade = getFacade();
+ final RemoteDeviceHandler facade = getFacade();
final NetconfDeviceCommunicator listener = getListener();
final EffectiveModelContextFactory schemaFactory = getSchemaFactory();
@Test
public void testNetconfDeviceMissingSource() throws Exception {
- final RemoteDeviceHandler<NetconfSessionPreferences> facade = getFacade();
+ final RemoteDeviceHandler facade = getFacade();
final NetconfDeviceCommunicator listener = getListener();
final EffectiveModelContextFactory schemaFactory = getSchemaFactory();
@Test
public void testNotificationBeforeSchema() throws Exception {
- final RemoteDeviceHandler<NetconfSessionPreferences> facade = getFacade();
+ final RemoteDeviceHandler facade = getFacade();
final NetconfDeviceCommunicator listener = getListener();
final EffectiveModelContextFactory schemaContextProviderFactory = mock(EffectiveModelContextFactory.class);
final SettableFuture<SchemaContext> schemaFuture = SettableFuture.create();
@Test
public void testNetconfDeviceReconnect() throws Exception {
- final RemoteDeviceHandler<NetconfSessionPreferences> facade = getFacade();
+ final RemoteDeviceHandler facade = getFacade();
final NetconfDeviceCommunicator listener = getListener();
final EffectiveModelContextFactory schemaContextProviderFactory = getSchemaFactory();
@Test
public void testNetconfDeviceDisconnectListenerCallCancellation() throws Exception {
- final RemoteDeviceHandler<NetconfSessionPreferences> facade = getFacade();
+ final RemoteDeviceHandler facade = getFacade();
final NetconfDeviceCommunicator listener = getListener();
final EffectiveModelContextFactory schemaContextProviderFactory = mock(EffectiveModelContextFactory.class);
final SettableFuture<SchemaContext> schemaFuture = SettableFuture.create();
@Test
public void testNetconfDeviceAvailableCapabilitiesBuilding() throws Exception {
- final RemoteDeviceHandler<NetconfSessionPreferences> facade = getFacade();
+ final RemoteDeviceHandler facade = getFacade();
final NetconfDeviceCommunicator listener = getListener();
final EffectiveModelContextFactory schemaContextProviderFactory = getSchemaFactory();
@Test
public void testNetconfDeviceNotificationsModelNotPresentWithCapability() throws Exception {
- final RemoteDeviceHandler<NetconfSessionPreferences> facade = getFacade();
+ final RemoteDeviceHandler facade = getFacade();
final NetconfDeviceCommunicator listener = getListener();
final EffectiveModelContextFactory schemaContextProviderFactory = getSchemaFactory();
@Test
public void testNetconfDeviceNotificationsCapabilityIsNotPresent() throws Exception {
- final RemoteDeviceHandler<NetconfSessionPreferences> facade = getFacade();
+ final RemoteDeviceHandler facade = getFacade();
final NetconfDeviceCommunicator listener = getListener();
final EffectiveModelContextFactory schemaContextProviderFactory = getSchemaFactory();
@Test
public void testNetconfDeviceNotificationsModelIsPresent() throws Exception {
- final RemoteDeviceHandler<NetconfSessionPreferences> facade = getFacade();
+ final RemoteDeviceHandler facade = getFacade();
final NetconfDeviceCommunicator listener = getListener();
final EffectiveModelContextFactory schemaContextProviderFactory = getSchemaFactory();
return schemaFactory;
}
- private static RemoteDeviceHandler<NetconfSessionPreferences> getFacade() throws Exception {
- final RemoteDeviceHandler<NetconfSessionPreferences> remoteDeviceHandler =
- mockCloseableClass(RemoteDeviceHandler.class);
+ private static RemoteDeviceHandler getFacade() throws Exception {
+ final RemoteDeviceHandler remoteDeviceHandler = mockCloseableClass(RemoteDeviceHandler.class);
doNothing().when(remoteDeviceHandler).onDeviceConnected(
any(MountPointContext.class), any(NetconfSessionPreferences.class), any(NetconfDeviceRpc.class),
any(DOMActionService.class));
return MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
}
- public MessageTransformer<NetconfMessage> getMessageTransformer() throws Exception {
- final MessageTransformer<NetconfMessage> messageTransformer = mockClass(MessageTransformer.class);
- doReturn(NOTIFICATION).when(messageTransformer).toRpcRequest(any(SchemaPath.class), any(NormalizedNode.class));
- doReturn(RPC_RESULT).when(messageTransformer).toRpcResult(any(NetconfMessage.class), any(SchemaPath.class));
+ public MessageTransformer getMessageTransformer() throws Exception {
+ final MessageTransformer messageTransformer = mockClass(MessageTransformer.class);
+ doReturn(NOTIFICATION).when(messageTransformer).toRpcRequest(any(QName.class), any(NormalizedNode.class));
+ doReturn(RPC_RESULT).when(messageTransformer).toRpcResult(any(NetconfMessage.class), any(QName.class));
doReturn(COMPOSITE_NODE).when(messageTransformer).toNotification(any(NetconfMessage.class));
return messageTransformer;
}