import com.google.common.annotations.Beta;
import com.google.common.collect.ClassToInstanceMap;
-import com.google.common.collect.ImmutableClassToInstanceMap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.MutableClassToInstanceMap;
import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
import org.opendaylight.controller.sal.binding.api.mount.MountProviderService;
import org.opendaylight.controller.sal.binding.impl.RootBindingAwareBroker;
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
import org.opendaylight.controller.sal.core.api.BrokerService;
import org.opendaylight.controller.sal.core.spi.data.DOMStore;
import org.opendaylight.controller.sal.dom.broker.BrokerImpl;
public void startNewDomDataBroker() {
checkState(executor != null, "Executor needs to be set");
- final InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
- final InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", MoreExecutors.sameThreadExecutor());
+ final InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER",
+ MoreExecutors.newDirectExecutorService());
+ final InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG",
+ MoreExecutors.newDirectExecutorService());
newDatastores = ImmutableMap.<LogicalDatastoreType, DOMStore>builder()
.put(LogicalDatastoreType.OPERATIONAL, operStore)
.put(LogicalDatastoreType.CONFIGURATION, configStore)
}
- private ProviderSession createMockContext() {
-
- @SuppressWarnings("deprecation")
- final ClassToInstanceMap<BrokerService> domBrokerServices = ImmutableClassToInstanceMap
- .<BrokerService> builder()
- //
- .put(DOMRpcRouter.class, biBrokerImpl.getRouter()) //
- .put(DOMMountPointService.class, biMountImpl)
- .build();
-
- return new ProviderSession() {
-
- @Override
- public <T extends BrokerService> T getService(final Class<T> service) {
- return domBrokerServices.getInstance(service);
- }
-
- @Override
- public boolean isClosed() {
- return false;
- }
-
- @Override
- public void close() {
- }
- };
- }
-
public void startBindingToDomMappingService() {
checkState(classPool != null, "ClassPool needs to be present");