import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class MountInstanceTest {
+ private static final Logger LOG = LoggerFactory.getLogger(MountInstanceTest.class);
+
private static SchemaContext SCHEMA_CONTEXT;
@Mock
private NetconfDeviceSalProvider.MountInstance mountInstance;
@BeforeClass
- public static void suiteSetUp() throws Exception{
+ public static void suiteSetUp() throws Exception {
final ModuleInfoBackedContext moduleInfoBackedContext = ModuleInfoBackedContext.create();
- moduleInfoBackedContext.addModuleInfos(
- Lists.newArrayList(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.$YangModuleInfoImpl.getInstance()));
+ moduleInfoBackedContext.addModuleInfos(Lists.newArrayList(org.opendaylight.yang.gen
+ .v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.$YangModuleInfoImpl.getInstance()));
SCHEMA_CONTEXT = moduleInfoBackedContext.tryToCreateSchemaContext().get();
}
when(service.createMountPoint(any(YangInstanceIdentifier.class))).thenReturn(mountPointBuilder);
when(mountPointBuilder.register()).thenReturn(registration);
- mountInstance = new NetconfDeviceSalProvider.MountInstance(service, new RemoteDeviceId("device-1", InetSocketAddress.createUnresolved("localhost", 17830)));
+ mountInstance = new NetconfDeviceSalProvider.MountInstance(
+ service, new RemoteDeviceId("device-1", InetSocketAddress.createUnresolved("localhost", 17830)));
}
try {
mountInstance.onTopologyDeviceConnected(SCHEMA_CONTEXT, broker, rpcService, notificationService);
} catch (final IllegalStateException e) {
- e.printStackTrace();
+ LOG.warn("Operation failed.", e);
Assert.fail("Topology registration still present after disconnect ");
}
}