Search in sources :

Example 11 with ClusterServiceAdapter

use of org.onosproject.cluster.ClusterServiceAdapter in project onos by opennetworkinglab.

the class InfluxDbMetricsReporterTest method setUp.

/**
 * Sets up the services required by influxDB metrics reporter.
 */
@Before
public void setUp() {
    influxReporter = new DefaultInfluxDbMetricsReporter();
    influxReporter.coreService = new CoreServiceAdapter();
    influxReporter.cfgService = new ComponentConfigAdapter();
    influxReporter.clusterService = new ClusterServiceAdapter();
    influxReporter.metricsService = new TestMetricsService();
    influxReporter.activate();
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) CoreServiceAdapter(org.onosproject.core.CoreServiceAdapter) ClusterServiceAdapter(org.onosproject.cluster.ClusterServiceAdapter) Before(org.junit.Before)

Example 12 with ClusterServiceAdapter

use of org.onosproject.cluster.ClusterServiceAdapter 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 13 with ClusterServiceAdapter

use of org.onosproject.cluster.ClusterServiceAdapter 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

ClusterServiceAdapter (org.onosproject.cluster.ClusterServiceAdapter)13 Before (org.junit.Before)10 TestStorageService (org.onosproject.store.service.TestStorageService)6 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)4 Test (org.junit.Test)3 CoreServiceAdapter (org.onosproject.core.CoreServiceAdapter)3 ClusterCommunicationServiceAdapter (org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter)3 ControllerNode (org.onosproject.cluster.ControllerNode)2 DefaultControllerNode (org.onosproject.cluster.DefaultControllerNode)2 LeadershipServiceAdapter (org.onosproject.cluster.LeadershipServiceAdapter)2 NodeId (org.onosproject.cluster.NodeId)2 VirtualNetworkPacketStore (org.onosproject.incubator.net.virtual.VirtualNetworkPacketStore)2 VirtualProviderManager (org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager)2 FlowObjectiveServiceAdapter (org.onosproject.net.flowobjective.FlowObjectiveServiceAdapter)2 Maps (com.google.common.collect.Maps)1 Sets (com.google.common.collect.Sets)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 List (java.util.List)1 Map (java.util.Map)1