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