use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class K8sPortWebResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
final CodecManager codecService = new CodecManager();
codecService.activate();
codecService.registerCodec(K8sPort.class, new K8sPortCodec());
ServiceDirectory testDirectory = new TestServiceDirectory().add(K8sNetworkAdminService.class, mockAdminService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class ControlMetricsResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
final CodecManager codecService = new CodecManager();
codecService.activate();
codecService.registerCodec(ControlLoadSnapshot.class, new ControlLoadSnapshotCodec());
ServiceDirectory testDirectory = new TestServiceDirectory().add(ControlPlaneMonitorService.class, mockControlPlaneMonitorService).add(ClusterService.class, mockClusterService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
nodeId = new NodeId("1");
mockControlLoad = new MockControlLoad();
ControllerNode mockControllerNode = new MockControllerNode(nodeId);
expect(mockClusterService.getLocalNode()).andReturn(mockControllerNode).anyTimes();
replay(mockClusterService);
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class OpenstackVtapNetworkWebResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
final CodecManager codecService = new CodecManager();
codecService.activate();
codecService.registerCodec(OpenstackVtapNetwork.class, new OpenstackVtapNetworkCodec());
ServiceDirectory testDirectory = new TestServiceDirectory().add(OpenstackVtapService.class, mockVtapService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
vtapNetwork = DefaultOpenstackVtapNetwork.builder().mode(OpenstackVtapNetwork.Mode.VXLAN).networkId(1).serverIp(IpAddress.valueOf("10.10.10.1")).build();
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class KubevirtMm5WebResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
final CodecManager codecService = new CodecManager();
codecService.activate();
codecService.registerCodec(KubevirtNetwork.class, new KubevirtNetworkCodec());
codecService.registerCodec(KubevirtHostRoute.class, new KubevirtHostRouteCodec());
codecService.registerCodec(KubevirtIpPool.class, new KubevirtIpPoolCodec());
ServiceDirectory testDirectory = new TestServiceDirectory().add(KubevirtNodeService.class, mockNodeService).add(KubevirtNetworkService.class, mockNetworkService).add(KubevirtRouterService.class, mockRouterService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class VirtualNetworkFlowObjectiveManagerTest method setUp.
@Before
public void setUp() throws Exception {
virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
CoreService coreService = new TestCoreService();
TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
TestUtils.setField(virtualNetworkManagerStore, "storageService", storageService);
virtualNetworkManagerStore.activate();
flowObjectiveStore = new SimpleVirtualFlowObjectiveStore();
TestUtils.setField(flowObjectiveStore, "storageService", storageService);
flowObjectiveStore.activate();
flowRuleStore = new SimpleVirtualFlowRuleStore();
flowRuleStore.activate();
manager = new VirtualNetworkManager();
manager.store = virtualNetworkManagerStore;
TestUtils.setField(manager, "coreService", coreService);
providerRegistryService = new VirtualProviderManager();
providerRegistryService.registerProvider(flowRuleProvider);
eventDeliveryService = new TestEventDispatcher();
NetTestTools.injectEventDispatcher(manager, eventDeliveryService);
appId = new TestApplicationId("FlowRuleManagerTest");
testDirectory = new TestServiceDirectory().add(VirtualNetworkStore.class, virtualNetworkManagerStore).add(CoreService.class, coreService).add(EventDeliveryService.class, eventDeliveryService).add(VirtualProviderRegistryService.class, providerRegistryService).add(VirtualNetworkFlowRuleStore.class, flowRuleStore).add(VirtualNetworkFlowObjectiveStore.class, flowObjectiveStore);
TestUtils.setField(manager, "serviceDirectory", testDirectory);
manager.activate();
vnet1 = setupVirtualNetworkTopology(manager, TID1);
vnet2 = setupVirtualNetworkTopology(manager, TID2);
service1 = new VirtualNetworkFlowObjectiveManager(manager, vnet1.id());
service2 = new VirtualNetworkFlowObjectiveManager(manager, vnet2.id());
}
Aggregations