use of org.opendaylight.controller.config.util.ConfigTransactionJMXClient in project controller by opendaylight.
the class SimpleConfigurationTest method testCreateAndDestroyBeanInSameTransaction.
@Test
public void testCreateAndDestroyBeanInSameTransaction() throws Exception {
ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
ObjectName fixed1names = createFixedThreadPool(transaction);
transaction.destroyModule(fixed1names);
CommitStatus commitStatus = transaction.commit();
assertStatus(commitStatus, 0, 0, 0);
}
use of org.opendaylight.controller.config.util.ConfigTransactionJMXClient in project controller by opendaylight.
the class SimpleConfigurationTest method testAbort.
@Test
public void testAbort() throws Exception {
ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
assertEquals(1, configRegistryClient.getOpenConfigs().size());
transaction.abortConfig();
assertEquals(0, configRegistryClient.getOpenConfigs().size());
try {
platformMBeanServer.getMBeanInfo(transaction.getObjectName());
fail();
} catch (final InstanceNotFoundException e) {
assertEquals("org.opendaylight.controller:TransactionName=ConfigTransaction-0-1,type=ConfigTransaction", e.getMessage());
}
}
use of org.opendaylight.controller.config.util.ConfigTransactionJMXClient in project controller by opendaylight.
the class SimpleConfigurationTest method testOptimisticLock_ConfigTransactionClient.
@Test
public void testOptimisticLock_ConfigTransactionClient() throws Exception {
ConfigTransactionJMXClient transaction1 = configRegistryClient.createTransaction();
ConfigTransactionJMXClient transaction2 = configRegistryClient.createTransaction();
transaction2.assertVersion(0, 2);
transaction2.commit();
try {
transaction1.commit();
fail();
} catch (final ConflictingVersionException e) {
assertEquals("Optimistic lock failed. Expected parent version 2, was 0", e.getMessage());
}
}
Aggregations