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();
}
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());
}
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;
}
Aggregations