use of org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter in project onos by opennetworkinglab.
the class DistributedGroupStoreTest method setUp.
@Before
public void setUp() throws Exception {
groupStoreImpl = new DistributedGroupStore();
groupStoreImpl.storageService = new TestStorageService();
groupStoreImpl.clusterCommunicator = new ClusterCommunicationServiceAdapter();
groupStoreImpl.mastershipService = new MasterOfAll();
groupStoreImpl.cfgService = new ComponentConfigAdapter();
groupStoreImpl.deviceService = new InternalDeviceServiceImpl();
ClusterService mockClusterService = createMock(ClusterService.class);
NodeId nodeId = new NodeId(NODE_ID);
MockControllerNode mockControllerNode = new MockControllerNode(nodeId);
expect(mockClusterService.getLocalNode()).andReturn(mockControllerNode).anyTimes();
replay(mockClusterService);
groupStoreImpl.clusterService = mockClusterService;
groupStoreImpl.activate(null);
groupStore = groupStoreImpl;
auditPendingReqQueue = TestUtils.getField(groupStoreImpl, "auditPendingReqQueue");
}
use of org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter in project onos by opennetworkinglab.
the class DistributedStatisticStoreTest method setUp.
@Before
public void setUp() throws Exception {
statStore = new DistributedStatisticStore();
statStore.cfgService = new ComponentConfigAdapter();
mockClusterService = createMock(ClusterService.class);
statStore.clusterService = mockClusterService;
statStore.clusterService = mockClusterService;
nodeId = new NodeId("1");
mockControllerNode = new SetMockControllerNode(nodeId);
expect(mockClusterService.getLocalNode()).andReturn(mockControllerNode).anyTimes();
replay(mockClusterService);
statStore.clusterCommunicator = new ClusterCommunicationServiceAdapter();
statStore.mastershipService = new MasterOfAll();
statStore.activate(mockContext);
store = statStore;
}
use of org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter in project onos by opennetworkinglab.
the class ControlPlaneMonitorTest method setup.
/**
* Sets up the services required by control plane monitor.
*/
@Before
public void setup() {
monitor = new ControlPlaneMonitor();
mockCommunicationService = new ClusterCommunicationServiceAdapter();
monitor.communicationService = mockCommunicationService;
nodeId = new NodeId("1");
mockControllerNode = new MockControllerNode(nodeId);
mockClusterService = createMock(ClusterService.class);
monitor.clusterService = mockClusterService;
expect(mockClusterService.getNode(anyObject())).andReturn(mockControllerNode).anyTimes();
expect(mockClusterService.getLocalNode()).andReturn(mockControllerNode).anyTimes();
replay(mockClusterService);
monitor.activate();
}
use of org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter in project onos by opennetworkinglab.
the class ECFlowRuleStoreTest method setUp.
@Before
public void setUp() throws Exception {
flowStoreImpl = new ECFlowRuleStore();
flowStoreImpl.storageService = new TestStorageService() {
@Override
public <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder() {
return new ConsistentMapBuilder<K, V>() {
@Override
public AsyncConsistentMap<K, V> buildAsyncMap() {
return new AsyncConsistentMapAdapter<K, V>();
}
@Override
public ConsistentMap<K, V> build() {
return null;
}
};
}
};
ReplicaInfoManager replicaInfoManager = new ReplicaInfoManager();
replicaInfoManager.mastershipService = new MasterOfAll();
flowStoreImpl.replicaInfoManager = replicaInfoManager;
mockClusterService = createMock(ClusterService.class);
flowStoreImpl.clusterService = mockClusterService;
nodeId = new NodeId("1");
mockControllerNode = new MockControllerNode(nodeId);
expect(mockClusterService.getLocalNode()).andReturn(mockControllerNode).anyTimes();
replay(mockClusterService);
flowStoreImpl.clusterCommunicator = new ClusterCommunicationServiceAdapter();
flowStoreImpl.mastershipService = new MasterOfAll();
flowStoreImpl.deviceService = new DeviceServiceAdapter();
flowStoreImpl.coreService = new CoreServiceAdapter();
flowStoreImpl.configService = new ComponentConfigAdapter();
flowStoreImpl.persistenceService = new PersistenceServiceAdapter();
flowStoreImpl.activate(context);
}
Aggregations