Search in sources :

Example 6 with ConfigTransactionJMXClient

use of org.opendaylight.controller.config.util.ConfigTransactionJMXClient in project controller by opendaylight.

the class ITTest method testCreateBean.

@Test
public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, ConflictingVersionException {
    ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
    createModule(transaction, instanceName);
    transaction.validateConfig();
    CommitStatus status = transaction.commit();
    assertBeanCount(1, factory.getImplementationName());
    assertStatus(status, 1, 0, 0);
}
Also used : ConfigTransactionJMXClient(org.opendaylight.controller.config.util.ConfigTransactionJMXClient) CommitStatus(org.opendaylight.controller.config.api.jmx.CommitStatus) Test(org.junit.Test) AbstractConfigTest(org.opendaylight.controller.config.manager.impl.AbstractConfigTest)

Example 7 with ConfigTransactionJMXClient

use of org.opendaylight.controller.config.util.ConfigTransactionJMXClient in project controller by opendaylight.

the class ITTest method testReusingOldInstance.

@Test
public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, ValidationException {
    ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
    createModule(transaction, instanceName);
    transaction.commit();
    assertBeanCount(1, factory.getImplementationName());
    transaction = configRegistryClient.createTransaction();
    CommitStatus status = transaction.commit();
    assertBeanCount(1, factory.getImplementationName());
    assertStatus(status, 0, 0, 1);
}
Also used : ConfigTransactionJMXClient(org.opendaylight.controller.config.util.ConfigTransactionJMXClient) CommitStatus(org.opendaylight.controller.config.api.jmx.CommitStatus) Test(org.junit.Test) AbstractConfigTest(org.opendaylight.controller.config.manager.impl.AbstractConfigTest)

Example 8 with ConfigTransactionJMXClient

use of org.opendaylight.controller.config.util.ConfigTransactionJMXClient in project controller by opendaylight.

the class ImmediateEventExecutorModuleTest method testReusingOldInstance.

@Test
public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, ValidationException {
    ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
    createInstance(transaction, instanceName);
    transaction.commit();
    transaction = configRegistryClient.createTransaction();
    assertBeanCount(1, factory.getImplementationName());
    CommitStatus status = transaction.commit();
    assertBeanCount(1, factory.getImplementationName());
    assertStatus(status, 0, 0, 1);
}
Also used : ConfigTransactionJMXClient(org.opendaylight.controller.config.util.ConfigTransactionJMXClient) CommitStatus(org.opendaylight.controller.config.api.jmx.CommitStatus) AbstractConfigTest(org.opendaylight.controller.config.manager.impl.AbstractConfigTest) Test(org.junit.Test)

Example 9 with ConfigTransactionJMXClient

use of org.opendaylight.controller.config.util.ConfigTransactionJMXClient in project controller by opendaylight.

the class NettyThreadgroupModuleTest method testCreateBean.

@Test
public void testCreateBean() throws InstanceAlreadyExistsException, ValidationException, ConflictingVersionException {
    ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
    createInstance(transaction, instanceName, 2);
    createInstance(transaction, instanceName + 2, null);
    transaction.validateConfig();
    CommitStatus status = transaction.commit();
    assertBeanCount(2, factory.getImplementationName());
    assertStatus(status, 2, 0, 0);
}
Also used : ConfigTransactionJMXClient(org.opendaylight.controller.config.util.ConfigTransactionJMXClient) CommitStatus(org.opendaylight.controller.config.api.jmx.CommitStatus) Test(org.junit.Test) AbstractConfigTest(org.opendaylight.controller.config.manager.impl.AbstractConfigTest)

Example 10 with ConfigTransactionJMXClient

use of org.opendaylight.controller.config.util.ConfigTransactionJMXClient in project controller by opendaylight.

the class NettyThreadgroupModuleTest method testReconfigure.

@Test
public void testReconfigure() throws InstanceAlreadyExistsException, ConflictingVersionException, ValidationException, InstanceNotFoundException {
    ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
    createInstance(transaction, instanceName, null);
    transaction.commit();
    transaction = configRegistryClient.createTransaction();
    assertBeanCount(1, factory.getImplementationName());
    NettyThreadgroupModuleMXBean mxBean = transaction.newMBeanProxy(transaction.lookupConfigBean(AbstractNettyThreadgroupModuleFactory.NAME, instanceName), NettyThreadgroupModuleMXBean.class);
    mxBean.setThreadCount(1);
    CommitStatus status = transaction.commit();
    assertBeanCount(1, factory.getImplementationName());
    assertStatus(status, 0, 1, 0);
}
Also used : ConfigTransactionJMXClient(org.opendaylight.controller.config.util.ConfigTransactionJMXClient) CommitStatus(org.opendaylight.controller.config.api.jmx.CommitStatus) Test(org.junit.Test) AbstractConfigTest(org.opendaylight.controller.config.manager.impl.AbstractConfigTest)

Aggregations

ConfigTransactionJMXClient (org.opendaylight.controller.config.util.ConfigTransactionJMXClient)43 Test (org.junit.Test)38 AbstractConfigTest (org.opendaylight.controller.config.manager.impl.AbstractConfigTest)26 ObjectName (javax.management.ObjectName)22 CommitStatus (org.opendaylight.controller.config.api.jmx.CommitStatus)15 TestingFixedThreadPoolConfigMXBean (org.opendaylight.controller.config.manager.testingservices.threadpool.TestingFixedThreadPoolConfigMXBean)5 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)3 TestingParallelAPSPConfigMXBean (org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPConfigMXBean)3 Map (java.util.Map)2 InstanceAlreadyExistsException (javax.management.InstanceAlreadyExistsException)2 InstanceNotFoundException (javax.management.InstanceNotFoundException)2 ConflictingVersionException (org.opendaylight.controller.config.api.ConflictingVersionException)2 ValidationException (org.opendaylight.controller.config.api.ValidationException)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 Attribute (javax.management.Attribute)1 IntrospectionException (javax.management.IntrospectionException)1 ReflectionException (javax.management.ReflectionException)1 Before (org.junit.Before)1 IdentityAttributeRef (org.opendaylight.controller.config.api.IdentityAttributeRef)1 ExceptionMessageWithStackTrace (org.opendaylight.controller.config.api.ValidationException.ExceptionMessageWithStackTrace)1