X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Ftestingservices%2Fthreadpool%2Ftest%2FSimpleConfigurationTest.java;h=28408abed2fb564c05688302cc0d3b20be0465a9;hb=e1658face07c354aa8fd5b12da700401ce1efc37;hp=441de36db07655558a3f882e7ebbb9ba929e964f;hpb=d1ab4c3ea79bcd74e02aa9334bc660cb7fc6d037;p=controller.git 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 441de36db0..28408abed2 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 @@ -30,7 +30,6 @@ import javax.management.InstanceNotFoundException; import javax.management.MBeanException; import javax.management.ObjectName; import javax.management.ReflectionException; -import javax.management.RuntimeMBeanException; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -135,7 +134,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { private void testValidation(ConfigTransactionClient transaction) throws InstanceAlreadyExistsException, ReflectionException, - InstanceNotFoundException, MBeanException { + InstanceNotFoundException, MBeanException, ConflictingVersionException { ObjectName fixed1names = transaction.createModule( TestingFixedThreadPoolModuleFactory.NAME, fixed1); // call validate on config bean @@ -143,8 +142,8 @@ public class SimpleConfigurationTest extends AbstractConfigTest { platformMBeanServer.invoke(fixed1names, "validate", new Object[0], new String[0]); fail(); - } catch (RuntimeMBeanException e) { - RuntimeException targetException = e.getTargetException(); + } catch (MBeanException e) { + Exception targetException = e.getTargetException(); assertNotNull(targetException); assertEquals(ValidationException.class, targetException.getClass()); } @@ -327,7 +326,7 @@ public class SimpleConfigurationTest extends AbstractConfigTest { } @Test - public void testAbort() { + public void testAbort() throws InstanceAlreadyExistsException, ValidationException { ConfigTransactionJMXClient transaction = configRegistryClient .createTransaction(); assertEquals(1, configRegistryClient.getOpenConfigs().size()); @@ -337,14 +336,14 @@ public class SimpleConfigurationTest extends AbstractConfigTest { transaction.createModule(TestingFixedThreadPoolModuleFactory.NAME, fixed1); fail(); - } catch (Exception e) { - assertTrue(e.getCause() instanceof InstanceNotFoundException); + } catch (IllegalStateException e) { + assertEquals("Configuration was aborted", e.getMessage()); } try { transaction.validateConfig(); fail(); - } catch (Exception e) { - assertTrue(e.getCause() instanceof InstanceNotFoundException); + } catch (IllegalStateException e) { + assertEquals("Configuration was aborted", e.getMessage()); } assertEquals(0, configRegistryClient.getOpenConfigs().size()); }