Search in sources :

Example 71 with TestStorageService

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();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 72 with TestStorageService

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();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 73 with TestStorageService

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();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 74 with TestStorageService

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());
}
Also used : ComponentContextAdapter(org.onlab.osgi.ComponentContextAdapter) LeadershipServiceAdapter(org.onosproject.cluster.LeadershipServiceAdapter) TestStorageService(org.onosproject.store.service.TestStorageService) ClusterServiceAdapter(org.onosproject.cluster.ClusterServiceAdapter) FlowObjectiveServiceAdapter(org.onosproject.net.flowobjective.FlowObjectiveServiceAdapter) Before(org.junit.Before)

Example 75 with TestStorageService

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;
}
Also used : LeadershipServiceAdapter(org.onosproject.cluster.LeadershipServiceAdapter) TestStorageService(org.onosproject.store.service.TestStorageService) ClusterCommunicationServiceAdapter(org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter) ClusterServiceAdapter(org.onosproject.cluster.ClusterServiceAdapter) FlowObjectiveServiceAdapter(org.onosproject.net.flowobjective.FlowObjectiveServiceAdapter) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)75 TestStorageService (org.onosproject.store.service.TestStorageService)75 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)18 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)12 DistributedVirtualNetworkStore (org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore)12 CoreService (org.onosproject.core.CoreService)8 ClusterServiceAdapter (org.onosproject.cluster.ClusterServiceAdapter)6 ClusterCommunicationServiceAdapter (org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter)5 TestApplicationId (org.onosproject.TestApplicationId)3 ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)3 ClusterService (org.onosproject.cluster.ClusterService)3 LeadershipServiceAdapter (org.onosproject.cluster.LeadershipServiceAdapter)3 CoreServiceAdapter (org.onosproject.core.CoreServiceAdapter)3 VirtualNetworkStore (org.onosproject.incubator.net.virtual.VirtualNetworkStore)3 VirtualProviderManager (org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager)3 FlowObjectiveServiceAdapter (org.onosproject.net.flowobjective.FlowObjectiveServiceAdapter)3 Semaphore (java.util.concurrent.Semaphore)2 ComponentContextAdapter (org.onlab.osgi.ComponentContextAdapter)2 KryoNamespace (org.onlab.util.KryoNamespace)2 NodeId (org.onosproject.cluster.NodeId)2