use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.
the class OFAgentWebResourceTest method setUpMocks.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpMocks() {
ServiceDirectory testDirectory = new TestServiceDirectory().add(OFAgentAdminService.class, mockOFAgentAdminService).add(OFAgentService.class, mockOFAgentService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.
the class KubevirtNetworkWebResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
final CodecManager codecService = new CodecManager();
codecService.activate();
codecService.registerCodec(KubevirtHostRoute.class, new KubevirtHostRouteCodec());
codecService.registerCodec(KubevirtIpPool.class, new KubevirtIpPoolCodec());
codecService.registerCodec(KubevirtNetwork.class, new KubevirtNetworkCodec());
ServiceDirectory testDirectory = new TestServiceDirectory().add(KubevirtNetworkAdminService.class, mockAdminService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
network = DefaultKubevirtNetwork.builder().networkId("network").name("network").type(KubevirtNetwork.Type.FLAT).cidr("10.10.10.0/24").mtu(1500).gatewayIp(IpAddress.valueOf("10.10.10.1")).defaultRoute(true).ipPool(new KubevirtIpPool(IpAddress.valueOf("10.10.10.100"), IpAddress.valueOf("10.10.10.200"))).build();
}
use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.
the class MappingsWebResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
// Register the services needed for the test
final CodecManager codecService = new CodecManager();
codecService.activate();
codecService.registerCodec(MappingEntry.class, new MappingEntryCodec());
codecService.registerCodec(MappingAddress.class, new MappingAddressCodec());
codecService.registerCodec(MappingInstruction.class, new MappingInstructionCodec());
codecService.registerCodec(MappingAction.class, new MappingActionCodec());
codecService.registerCodec(MappingTreatment.class, new MappingTreatmentCodec());
codecService.registerCodec(MappingKey.class, new MappingKeyCodec());
codecService.registerCodec(MappingValue.class, new MappingValueCodec());
ServiceDirectory testDirectory = new TestServiceDirectory().add(MappingService.class, mockMappingService).add(DeviceService.class, mockDeviceService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.
the class OpenstackManagementWebResourceTest method setUpTest.
/**
* Sets up the global values for all tests.
*/
@Before
public void setUpTest() {
ServiceDirectory testDirectory = new TestServiceDirectory().add(OpenstackRouterAdminService.class, mockOpenstackRouterAdminService).add(OpenstackSecurityGroupAdminService.class, mockOpenstackSecurityGroupAdminService).add(OpenstackNetworkAdminService.class, mockOpenstackNetworkAdminService).add(OpenstackNodeAdminService.class, mockOpenstackNodeAdminService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.
the class OpenstackRouterWebResourceTest method setUpTest.
/**
* Sets up the global values for all tests.
*/
@Before
public void setUpTest() {
ServiceDirectory testDirectory = new TestServiceDirectory().add(OpenstackRouterAdminService.class, mockOpenstackRouterAdminService).add(OpenstackHaService.class, mockOpenstackHaService);
setServiceDirectory(testDirectory);
}
Aggregations