use of org.opendaylight.controller.config.api.jmx.CommitStatus in project controller by opendaylight.
the class NetconfTestImplModuleTest method testDependencyList.
@Test
public void testDependencyList() throws Exception {
ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
final ObjectName on = createInstance(transaction, this.instanceName, 4);
transaction.validateConfig();
final CommitStatus status1 = transaction.commit();
assertBeanCount(1, this.factory.getImplementationName());
assertBeanCount(4 + 1, DepTestImplModuleFactory.NAME);
assertStatus(status1, 1 + 4 + 1, 0, 0);
transaction = this.configRegistryClient.createTransaction();
final NetconfTestImplModuleMXBean proxy = transaction.newMXBeanProxy(ObjectNameUtil.withoutTransactionName(on), NetconfTestImplModuleMXBean.class);
proxy.getComplexList();
final List<ObjectName> testingDeps = proxy.getTestingDeps();
final ObjectName testingDep = proxy.getTestingDep();
assertEquals(TESTING_DEP_PREFIX, ObjectNameUtil.getInstanceName(testingDep));
assertTestingDeps(testingDeps, 4);
transaction.abortConfig();
// check that reuse logic works - equals on list of dependencies.
transaction = this.configRegistryClient.createTransaction();
final CommitStatus status2 = transaction.commit();
assertStatus(status2, 0, 0, 6);
// replace single dependency
transaction = this.configRegistryClient.createTransaction();
final String instanceName1 = TESTING_DEP_PREFIX + 1;
transaction.destroyModule(DepTestImplModuleFactory.NAME, instanceName1);
transaction.createModule(DepTestImplModuleFactory.NAME, instanceName1);
final CommitStatus status3 = transaction.commit();
assertStatus(status3, 1, 1, 4);
}
use of org.opendaylight.controller.config.api.jmx.CommitStatus 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);
}
use of org.opendaylight.controller.config.api.jmx.CommitStatus 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);
}
use of org.opendaylight.controller.config.api.jmx.CommitStatus 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);
}
use of org.opendaylight.controller.config.api.jmx.CommitStatus 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);
}
Aggregations