*/
package org.opendaylight.controller.config.manager.impl;
+import static org.junit.Assert.assertEquals;
+
import com.google.common.collect.Sets;
+import java.lang.management.ManagementFactory;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.controller.config.spi.ModuleFactory;
import org.osgi.framework.BundleContext;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-import java.lang.management.ManagementFactory;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import static org.junit.Assert.assertEquals;
-
public class ConfigTransactionControllerImplTest extends
AbstractLockedPlatformMBeanServerTest {
transactionsMBeanServer = MBeanServerFactory.createMBeanServer();
Map<String, Map.Entry<ModuleFactory, BundleContext>> currentlyRegisteredFactories = new HashMap<>();
- ConfigTransactionLookupRegistry txLookupRegistry = new ConfigTransactionLookupRegistry(new TransactionIdentifier(transactionName123), new TransactionJMXRegistratorFactory() {
- @Override
- public TransactionJMXRegistrator create() {
- return baseJMXRegistrator.createTransactionJMXRegistrator(transactionName123);
- }
- }, currentlyRegisteredFactories);
+ ConfigTransactionLookupRegistry txLookupRegistry = new ConfigTransactionLookupRegistry(
+ new TransactionIdentifier(transactionName123), () ->
+ baseJMXRegistrator.createTransactionJMXRegistrator(transactionName123), currentlyRegisteredFactories);
SearchableServiceReferenceWritableRegistry writableRegistry = ServiceReferenceRegistryImpl.createSRWritableRegistry(
ServiceReferenceRegistryImpl.createInitialSRLookupRegistry(), txLookupRegistry, currentlyRegisteredFactories);
/**
* Tests if lookup method returns all beans with defined transaction name
- *
- * @throws Exception
*/
@Test
public void testLookupConfigBeans() {
moduleName124, instanceName134);
assertEquals(Sets.newHashSet(name1), beans);
}
-
-}
+}
\ No newline at end of file