X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-util%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Futil%2FLookupTest.java;h=9a6f931afdd0e1ac6752e944da117bf95631ab1b;hp=4489762a47c7c83655201d3f357f2a9a15426ef7;hb=f43b01b81319959b1907e3e04537f5169e7f33d8;hpb=8b27cf3ccf7fdac75a5740c7cbc8d386cbb50772 diff --git a/opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/LookupTest.java b/opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/LookupTest.java index 4489762a47..9a6f931afd 100644 --- a/opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/LookupTest.java +++ b/opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/LookupTest.java @@ -7,8 +7,20 @@ */ package org.opendaylight.controller.config.util; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; +import java.lang.management.ManagementFactory; +import java.lang.reflect.Method; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanServer; +import javax.management.ObjectName; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -17,19 +29,6 @@ import org.opendaylight.controller.config.api.LookupRegistry; import org.opendaylight.controller.config.api.jmx.ConfigTransactionControllerMXBean; import org.opendaylight.controller.config.api.jmx.ObjectNameUtil; -import javax.management.InstanceNotFoundException; -import javax.management.MBeanServer; -import javax.management.ObjectName; -import java.lang.management.ManagementFactory; -import java.lang.reflect.Method; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - public class LookupTest { private TestingConfigRegistry testingRegistry; @@ -93,8 +92,7 @@ public class LookupTest { public void testLookupConfigBeans2() throws Exception { Method method = LookupRegistry.class.getMethod("lookupConfigBeans", String.class, String.class); - Object[] args = new Object[] { TestingConfigRegistry.moduleName1, - TestingConfigRegistry.instName1 }; + Object[] args = new Object[] { TestingConfigRegistry.moduleName1, TestingConfigRegistry.instName1 }; test(method, args); } @@ -102,12 +100,11 @@ public class LookupTest { public void testLookupConfigBean() throws Exception { Method method = LookupRegistry.class.getMethod("lookupConfigBean", String.class, String.class); - Object[] args = new Object[] { TestingConfigRegistry.moduleName1, - TestingConfigRegistry.instName1 }; + Object[] args = new Object[] { TestingConfigRegistry.moduleName1, TestingConfigRegistry.instName1 }; test(method, args); } - private void test(Method method, Object[] args) throws Exception { + private void test(final Method method, final Object[] args) throws Exception { for (Entry> entry : lookupProvidersToClients .entrySet()) { Object expected = method.invoke(entry.getKey(), args); @@ -128,7 +125,7 @@ public class LookupTest { client.lookupConfigBean( InstanceNotFoundException.class.getSimpleName(), ""); fail(client.toString()); - } catch (InstanceNotFoundException e) { + } catch (final InstanceNotFoundException e) { } }