Bug 8153: Enforce check-style rules for netconf - sal-netconf-connector
[netconf.git] / netconf / sal-netconf-connector / src / test / java / org / opendaylight / netconf / sal / connect / netconf / sal / MountInstanceTest.java
index 95e048e745871057e6f1318083b571bf7b7d5e33..b2274d1ec73b12079dc679782ded2fe766a34807 100644 (file)
@@ -30,9 +30,13 @@ import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 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
@@ -53,10 +57,10 @@ public class MountInstanceTest {
     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();
 
     }
@@ -67,7 +71,8 @@ public class MountInstanceTest {
         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)));
     }
 
 
@@ -88,7 +93,7 @@ public class MountInstanceTest {
         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 ");
         }
     }