Remove yang-test
[controller.git] / opendaylight / config / config-manager / src / test / java / org / opendaylight / controller / config / manager / ConfigRegistryImplTest.java
index ee47316f8d546716872c34aff2680cd03233acc2..55e8bb2a66f5939344ac4e39588b3670671a4866 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -24,40 +24,34 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class ConfigRegistryImplTest extends
-        AbstractLockedPlatformMBeanServerTest {
-    private static final Logger LOG = LoggerFactory
-            .getLogger(ConfigRegistryImplTest.class);
+public class ConfigRegistryImplTest extends AbstractLockedPlatformMBeanServerTest {
+    private static final Logger LOG = LoggerFactory.getLogger(ConfigRegistryImplTest.class);
 
     @Test
+    @SuppressWarnings("IllegalCatch")
     public void testFailOnTwoFactoriesExportingSameImpl() {
         ModuleFactory factory = new TestingFixedThreadPoolModuleFactory();
         BundleContext context = mock(BundleContext.class);
         ConfigRegistryImpl configRegistry = null;
         try {
-            ModuleFactoriesResolver resolver = new HardcodedModuleFactoriesResolver(mock(BundleContext.class),
-                    factory, factory);
+            ModuleFactoriesResolver resolver = new HardcodedModuleFactoriesResolver(mock(BundleContext.class), factory,
+                    factory);
 
-            configRegistry = new ConfigRegistryImpl(resolver,
-                    ManagementFactory.getPlatformMBeanServer(), null);
+            configRegistry = new ConfigRegistryImpl(resolver, ManagementFactory.getPlatformMBeanServer(), null);
 
             configRegistry.beginConfig();
             fail();
-        } catch (IllegalArgumentException e) {
-            assertTrue(
-                    e.getMessage(),
-                    e.getMessage()
-                            .startsWith("Module name is not unique. Found two conflicting factories with same name " +
-                                    "'fixed':"));
+        } catch (final IllegalArgumentException e) {
+            assertTrue(e.getMessage(), e.getMessage().startsWith(
+                    "Module name is not unique. Found two conflicting factories with same name " + "'fixed':"));
             verifyZeroInteractions(context);
         } finally {
             try {
                 configRegistry.close();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // ignore
                 LOG.warn("Ignoring exception", e);
             }
         }
     }
-
 }