use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class K8sPodManagerTest method setUp.
@Before
public void setUp() throws Exception {
k8sPodStore = new DistributedK8sPodStore();
TestUtils.setField(k8sPodStore, "coreService", new TestCoreService());
TestUtils.setField(k8sPodStore, "storageService", new TestStorageService());
TestUtils.setField(k8sPodStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
k8sPodStore.activate();
target = new K8sPodManager();
TestUtils.setField(target, "coreService", new TestCoreService());
target.k8sPodStore = k8sPodStore;
target.addListener(testListener);
target.activate();
}
use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class ExternalNetworkManagerTest method setUp.
/**
* Initial setup for this unit test.
*/
@Before
public void setUp() {
target = new ExternalNetworkManager();
target.coreService = new TestCoreService();
target.storageService = new TestStorageService();
target.activate();
}
use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class K8sHostManagerTest method setUp.
/**
* Initial setup for this unit test.
*/
@Before
public void setUp() {
hostStore = new DistributedK8sHostStore();
TestUtils.setField(hostStore, "coreService", new TestCoreService());
TestUtils.setField(hostStore, "storageService", new TestStorageService());
TestUtils.setField(hostStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
hostStore.activate();
hostStore.createHost(HOST_2);
hostStore.createHost(HOST_3);
target = new K8sHostManager();
target.storageService = new TestStorageService();
target.coreService = new TestCoreService();
target.clusterService = new TestClusterService();
target.leadershipService = new TestLeadershipService();
target.hostStore = hostStore;
target.addListener(testListener);
target.activate();
testListener.events.clear();
}
use of org.onosproject.store.service.TestStorageService in project dhcpl2relay by opencord.
the class DhcpL2RelayCountersStoreTest method setUp.
/**
* Sets up the services required by the dhcpl2relay app.
*/
@Before
public void setUp() {
dhcpL2Relay = new DhcpL2Relay();
dhcpL2Relay.cfgService = new DhcpL2RelayConfigTest.TestNetworkConfigRegistry();
dhcpL2Relay.coreService = new MockCoreServiceAdapter();
dhcpL2Relay.flowObjectiveService = new FlowObjectiveServiceAdapter();
dhcpL2Relay.packetService = new MockPacketService();
dhcpL2Relay.componentConfigService = mockConfigService;
dhcpL2Relay.deviceService = new MockDeviceService();
dhcpL2Relay.sadisService = new MockSadisService();
dhcpL2Relay.mastershipService = new MockMastershipService();
dhcpL2Relay.storageService = new TestStorageService();
dhcpL2Relay.leadershipService = new LeadershipServiceAdapter();
TestUtils.setField(dhcpL2Relay, "eventDispatcher", new TestEventDispatcher());
store = new SimpleDhcpL2RelayCountersStore();
store.storageService = new TestStorageService();
store.clusterService = new ClusterServiceAdapter();
store.leadershipService = new LeadershipServiceAdapter();
store.clusterCommunicationService = new TestClusterCommunicationService<>();
store.componentConfigService = mockConfigService;
TestUtils.setField(store, "eventDispatcher", new TestEventDispatcher());
store.activate(new MockComponentContext());
dhcpL2Relay.dhcpL2RelayCounters = this.store;
dhcpL2Relay.activate(new ComponentContextAdapter());
}
use of org.onosproject.store.service.TestStorageService in project dhcpl2relay by opencord.
the class DhcpL2RelayTest method setUp.
/**
* Sets up the services required by the dhcpl2relay app.
*/
@Before
public void setUp() {
dhcpL2Relay = new DhcpL2Relay();
dhcpL2Relay.cfgService = new DhcpL2RelayConfigTest.TestNetworkConfigRegistry();
dhcpL2Relay.coreService = new MockCoreServiceAdapter();
dhcpL2Relay.flowObjectiveService = new FlowObjectiveServiceAdapter();
dhcpL2Relay.packetService = new MockPacketService();
dhcpL2Relay.componentConfigService = mockConfigService;
dhcpL2Relay.deviceService = new MockDeviceService();
dhcpL2Relay.sadisService = new MockSadisService();
dhcpL2Relay.hostService = new MockHostService();
dhcpL2Relay.mastershipService = new MockMastershipService();
dhcpL2Relay.dhcpL2RelayCounters = new MockDhcpL2RelayCountersStore();
dhcpL2Relay.storageService = new TestStorageService();
dhcpL2Relay.leadershipService = new LeadershipServiceAdapter();
TestUtils.setField(dhcpL2Relay, "eventDispatcher", new TestEventDispatcher());
dhcpL2Relay.refreshService = new MockExecutor(dhcpL2Relay.refreshService);
dhcpL2Relay.activate(new DhcpL2RelayTestBase.MockComponentContext());
store = new SimpleDhcpL2RelayCountersStore();
store.storageService = new TestStorageService();
store.leadershipService = new LeadershipServiceAdapter();
store.clusterService = new ClusterServiceAdapter();
store.clusterCommunicationService = new ClusterCommunicationServiceAdapter();
store.componentConfigService = mockConfigService;
TestUtils.setField(store, "eventDispatcher", new TestEventDispatcher());
TestUtils.setField(dhcpL2Relay, "packetProcessorExecutor", MoreExecutors.newDirectExecutorService());
store.activate(new MockComponentContext());
dhcpL2Relay.dhcpL2RelayCounters = this.store;
}
Aggregations