X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Ftestingservices%2Fthreadpool%2Ftest%2FSimpleConfigurationTest.java;h=d837ffcdb481ade6eb41c7182b521c20232c08d5;hp=a15839d2d5b886104f21e8de88a551bdbbf14c12;hb=cbcc2b61265e903959f11d44c292771e76b3926e;hpb=71c540b3572415aef56acd4a31b503f24e9da437 diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/test/SimpleConfigurationTest.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/test/SimpleConfigurationTest.java index a15839d2d5..d837ffcdb4 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/test/SimpleConfigurationTest.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/test/SimpleConfigurationTest.java @@ -38,6 +38,7 @@ import org.opendaylight.controller.config.manager.impl.factoriesresolver.Hardcod import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingFixedThreadPool; import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingFixedThreadPoolConfigMXBean; import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingFixedThreadPoolModuleFactory; +import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingThreadPoolIfc; import org.opendaylight.controller.config.util.ConfigTransactionClient; import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; @@ -95,7 +96,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { } static ObjectName createFixedThreadPool( - ConfigTransactionJMXClient transaction) + final ConfigTransactionJMXClient transaction) throws InstanceAlreadyExistsException, InstanceNotFoundException { transaction.assertVersion(0, 1); @@ -130,7 +131,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { } - private void testValidation(ConfigTransactionClient transaction) + private static void testValidation(final ConfigTransactionClient transaction) throws InstanceAlreadyExistsException, ReflectionException, InstanceNotFoundException, MBeanException, ConflictingVersionException { ObjectName fixed1names = transaction.createModule( @@ -140,7 +141,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { platformMBeanServer.invoke(fixed1names, "validate", new Object[0], new String[0]); fail(); - } catch (MBeanException e) { + } catch (final MBeanException e) { Exception targetException = e.getTargetException(); assertNotNull(targetException); assertEquals(ValidationException.class, targetException.getClass()); @@ -150,7 +151,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { try { transaction.validateBean(fixed1names); fail(); - } catch (ValidationException e) { + } catch (final ValidationException e) { for (Map.Entry> exception : e .getFailedValidations().entrySet()) { for (Map.Entry entry : exception @@ -165,7 +166,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { try { transaction.validateConfig(); fail(); - } catch (ValidationException e) { + } catch (final ValidationException e) { for (Map.Entry> exception : e .getFailedValidations().entrySet()) { for (Map.Entry entry : exception @@ -178,7 +179,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { } try { transaction.commit(); - } catch (ValidationException e) { + } catch (final ValidationException e) { for (Map.Entry> exception : e .getFailedValidations().entrySet()) { for (Map.Entry entry : exception @@ -248,7 +249,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { try { platformMBeanServer.getMBeanInfo(on); fail(); - } catch (Exception e) { + } catch (final Exception e) { assertTrue(e instanceof InstanceNotFoundException); } } @@ -276,8 +277,8 @@ public class SimpleConfigurationTest extends AbstractConfigTest { checkThreadPools(1, numberOfThreads2); } - private void checkThreadPools(int expectedTotalNumberOfExecutors, - int expectedNumberOfThreadsInLastExecutor) { + private static void checkThreadPools(final int expectedTotalNumberOfExecutors, + final int expectedNumberOfThreadsInLastExecutor) { assertEquals(expectedTotalNumberOfExecutors, TestingFixedThreadPool.allExecutors.size()); for (int i = 0; i < expectedTotalNumberOfExecutors - 1; i++) { @@ -309,9 +310,8 @@ public class SimpleConfigurationTest extends AbstractConfigTest { } // return MBeanProxy for 'fixed1' and current transaction - private TestingFixedThreadPoolConfigMXBean startReconfiguringFixed1ThreadPool( - ConfigTransactionJMXClient transaction) - throws InstanceNotFoundException { + private static TestingFixedThreadPoolConfigMXBean startReconfiguringFixed1ThreadPool( + final ConfigTransactionJMXClient transaction) throws InstanceNotFoundException { ObjectName fixed1name = transaction.lookupConfigBean( TestingFixedThreadPoolModuleFactory.NAME, fixed1); @@ -331,7 +331,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { try { platformMBeanServer.getMBeanInfo(transaction.getObjectName()); fail(); - }catch(InstanceNotFoundException e){ + }catch(final InstanceNotFoundException e){ assertEquals("org.opendaylight.controller:TransactionName=ConfigTransaction-0-1,type=ConfigTransaction", e.getMessage()); } } @@ -347,7 +347,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { try { transaction1.commit(); fail(); - } catch (ConflictingVersionException e) { + } catch (final ConflictingVersionException e) { assertEquals( "Optimistic lock failed. Expected parent version 2, was 0", e.getMessage()); @@ -365,7 +365,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { try { configRegistryClient.commitConfig(transaction1.getObjectName()); fail(); - } catch (ConflictingVersionException e) { + } catch (final ConflictingVersionException e) { assertEquals( "Optimistic lock failed. Expected parent version 2, was 0", e.getMessage());