use of org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool.TestingScheduledThreadPoolConfigBeanMXBean in project controller by opendaylight.
the class RuntimeBeanTest method testRecreate.
@Test
public void testRecreate() throws Exception {
ObjectName createdConfigBean = createScheduled();
// empty transaction
ConfigTransactionJMXClient configTransaction = configRegistryClient.createTransaction();
ObjectName scheduledWritableON = configTransaction.lookupConfigBean(TestingScheduledThreadPoolModuleFactory.NAME, SCHEDULED1);
TestingScheduledThreadPoolConfigBeanMXBean scheduledWritableProxy = configTransaction.newMXBeanProxy(scheduledWritableON, TestingScheduledThreadPoolConfigBeanMXBean.class);
scheduledWritableProxy.setRecreate(true);
CommitStatus commitInfo = configTransaction.commit();
// check that it was recreated
ObjectName readableConfigBean = ObjectNameUtil.withoutTransactionName(createdConfigBean);
List<ObjectName> newInstances = Collections.<ObjectName>emptyList();
List<ObjectName> reusedInstances = Collections.<ObjectName>emptyList();
List<ObjectName> recreatedInstaces = Lists.newArrayList(readableConfigBean);
assertEquals(new CommitStatus(newInstances, reusedInstances, recreatedInstaces), commitInfo);
checkRuntimeBeans();
}
Aggregations