Search in sources :

Example 66 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class TestCodecService method setup.

@Before
public void setup() throws IOException {
    storageService = new TestStorageService();
    mastershipService = createNiceMock(MastershipService.class);
    coreService = createNiceMock(CoreService.class);
    hostService = createNiceMock(HostService.class);
    deviceService = createNiceMock(DeviceService.class);
    expect(deviceService.getDevices()).andReturn(ImmutableList.of()).anyTimes();
    networkConfigRegistry = createNiceMock(NetworkConfigRegistry.class);
    networkConfigService = createNiceMock(NetworkConfigService.class);
    manager = new SimpleIntManager();
    manager.coreService = coreService;
    manager.deviceService = deviceService;
    manager.storageService = storageService;
    manager.mastershipService = mastershipService;
    manager.hostService = hostService;
    manager.netcfgService = networkConfigService;
    manager.netcfgRegistry = networkConfigRegistry;
    manager.eventExecutor = MoreExecutors.newDirectExecutorService();
    manager.codecService = codecService;
    expect(coreService.registerApplication(APP_NAME)).andReturn(APP_ID).anyTimes();
    networkConfigRegistry.registerConfigFactory(anyObject());
    expectLastCall().once();
    Capture<NetworkConfigListener> capture = newCapture();
    networkConfigService.addListener(EasyMock.capture(capture));
    expectLastCall().once();
    IntReportConfig config = getIntReportConfig("/report-config.json");
    expect(networkConfigService.getConfig(APP_ID, IntReportConfig.class)).andReturn(config).anyTimes();
    replay(mastershipService, deviceService, coreService, hostService, networkConfigRegistry, networkConfigService);
    manager.activate();
    networkConfigListener = capture.getValue();
}
Also used : HostService(org.onosproject.net.host.HostService) NetworkConfigRegistry(org.onosproject.net.config.NetworkConfigRegistry) NetworkConfigService(org.onosproject.net.config.NetworkConfigService) TestStorageService(org.onosproject.store.service.TestStorageService) DeviceService(org.onosproject.net.device.DeviceService) CoreService(org.onosproject.core.CoreService) MastershipService(org.onosproject.mastership.MastershipService) IntReportConfig(org.onosproject.net.behaviour.inbandtelemetry.IntReportConfig) NetworkConfigListener(org.onosproject.net.config.NetworkConfigListener) Before(org.junit.Before)

Example 67 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class K8sEndpointsManagerTest method setUp.

@Before
public void setUp() throws Exception {
    k8sEndpointsStore = new DistributedK8sEndpointsStore();
    TestUtils.setField(k8sEndpointsStore, "coreService", new TestCoreService());
    TestUtils.setField(k8sEndpointsStore, "storageService", new TestStorageService());
    TestUtils.setField(k8sEndpointsStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
    k8sEndpointsStore.activate();
    target = new K8sEndpointsManager();
    TestUtils.setField(target, "coreService", new TestCoreService());
    target.k8sEndpointsStore = k8sEndpointsStore;
    target.addListener(testListener);
    target.activate();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 68 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class K8sIpamManagerTest method setUp.

@Before
public void setUp() throws Exception {
    k8sIpamStore = new DistributedK8sIpamStore();
    TestUtils.setField(k8sIpamStore, "coreService", new TestCoreService());
    TestUtils.setField(k8sIpamStore, "storageService", new TestStorageService());
    TestUtils.setField(k8sIpamStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
    k8sIpamStore.activate();
    target = new K8sIpamManager();
    TestUtils.setField(target, "coreService", new TestCoreService());
    target.k8sIpamStore = k8sIpamStore;
    target.activate();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 69 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class K8sNamespaceManagerTest method setUp.

@Before
public void setUp() throws Exception {
    k8sNamespaceStore = new DistributedK8sNamespaceStore();
    TestUtils.setField(k8sNamespaceStore, "coreService", new TestCoreService());
    TestUtils.setField(k8sNamespaceStore, "storageService", new TestStorageService());
    TestUtils.setField(k8sNamespaceStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
    k8sNamespaceStore.activate();
    target = new K8sNamespaceManager();
    TestUtils.setField(target, "coreService", new TestCoreService());
    target.k8sNamespaceStore = k8sNamespaceStore;
    target.addListener(testListener);
    target.activate();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 70 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class K8sNetworkPolicyManagerTest method setUp.

@Before
public void setUp() throws Exception {
    k8sNetworkPolicyStore = new DistributedK8sNetworkPolicyStore();
    TestUtils.setField(k8sNetworkPolicyStore, "coreService", new TestCoreService());
    TestUtils.setField(k8sNetworkPolicyStore, "storageService", new TestStorageService());
    TestUtils.setField(k8sNetworkPolicyStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
    k8sNetworkPolicyStore.activate();
    target = new K8sNetworkPolicyManager();
    TestUtils.setField(target, "coreService", new TestCoreService());
    target.k8sNetworkPolicyStore = k8sNetworkPolicyStore;
    target.addListener(testListener);
    target.activate();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) 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