Search in sources :

Example 1 with NullScheduledExecutor

use of org.onlab.junit.NullScheduledExecutor in project onos by opennetworkinglab.

the class WorkPartitionManagerTest method setUp.

@Before
public void setUp() {
    leadershipService = createMock(LeadershipService.class);
    leadershipService.addListener(anyObject(LeadershipEventListener.class));
    expectLastCall().andDelegateTo(new TestLeadershipService());
    for (int i = 0; i < WorkPartitionManager.NUM_PARTITIONS; i++) {
        expect(leadershipService.runForLeadership(ELECTION_PREFIX + i)).andReturn(null).times(1);
    }
    partitionManager = new WorkPartitionManager().withScheduledExecutor(new NullScheduledExecutor());
    partitionManager.clusterService = new TestClusterService();
    partitionManager.localNodeId = MY_NODE_ID;
    partitionManager.leadershipService = leadershipService;
    partitionManager.eventDispatcher = new TestEventDispatcher();
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) LeadershipService(org.onosproject.cluster.LeadershipService) NullScheduledExecutor(org.onlab.junit.NullScheduledExecutor) LeadershipEventListener(org.onosproject.cluster.LeadershipEventListener) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 NullScheduledExecutor (org.onlab.junit.NullScheduledExecutor)1 LeadershipEventListener (org.onosproject.cluster.LeadershipEventListener)1 LeadershipService (org.onosproject.cluster.LeadershipService)1 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)1