Search in sources :

Example 26 with ServiceDirectory

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);
}
Also used : ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) OFAgentAdminService(org.onosproject.ofagent.api.OFAgentAdminService) Before(org.junit.Before)

Example 27 with ServiceDirectory

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();
}
Also used : KubevirtNetworkCodec(org.onosproject.kubevirtnetworking.codec.KubevirtNetworkCodec) ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) KubevirtNetworkAdminService(org.onosproject.kubevirtnetworking.api.KubevirtNetworkAdminService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CodecManager(org.onosproject.codec.impl.CodecManager) KubevirtIpPool(org.onosproject.kubevirtnetworking.api.KubevirtIpPool) KubevirtIpPoolCodec(org.onosproject.kubevirtnetworking.codec.KubevirtIpPoolCodec) KubevirtHostRouteCodec(org.onosproject.kubevirtnetworking.codec.KubevirtHostRouteCodec) Before(org.junit.Before)

Example 28 with ServiceDirectory

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);
}
Also used : MappingKeyCodec(org.onosproject.mapping.codec.MappingKeyCodec) ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) MappingEntryCodec(org.onosproject.mapping.codec.MappingEntryCodec) MappingTreatmentCodec(org.onosproject.mapping.codec.MappingTreatmentCodec) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) DeviceService(org.onosproject.net.device.DeviceService) CodecManager(org.onosproject.codec.impl.CodecManager) MappingAddressCodec(org.onosproject.mapping.codec.MappingAddressCodec) MappingInstructionCodec(org.onosproject.mapping.codec.MappingInstructionCodec) MappingValueCodec(org.onosproject.mapping.codec.MappingValueCodec) MappingActionCodec(org.onosproject.mapping.codec.MappingActionCodec) Before(org.junit.Before)

Example 29 with ServiceDirectory

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);
}
Also used : ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) OpenstackRouterAdminService(org.onosproject.openstacknetworking.api.OpenstackRouterAdminService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) OpenstackNetworkAdminService(org.onosproject.openstacknetworking.api.OpenstackNetworkAdminService) Before(org.junit.Before)

Example 30 with ServiceDirectory

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);
}
Also used : ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) OpenstackRouterAdminService(org.onosproject.openstacknetworking.api.OpenstackRouterAdminService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) Before(org.junit.Before)

Aggregations

ServiceDirectory (org.onlab.osgi.ServiceDirectory)54 Before (org.junit.Before)51 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)51 CodecManager (org.onosproject.codec.impl.CodecManager)30 DeviceService (org.onosproject.net.device.DeviceService)7 CfmCodecContext (org.onosproject.cfm.CfmCodecContext)5 CodecService (org.onosproject.codec.CodecService)5 CoreService (org.onosproject.core.CoreService)3 CfmMdService (org.onosproject.incubator.net.l2monitoring.cfm.service.CfmMdService)3 OpenstackRouterAdminService (org.onosproject.openstacknetworking.api.OpenstackRouterAdminService)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 DefaultServiceDirectory (org.onlab.osgi.DefaultServiceDirectory)2 ClusterService (org.onosproject.cluster.ClusterService)2 SoamService (org.onosproject.incubator.net.l2monitoring.soam.SoamService)2 K8sNetworkAdminService (org.onosproject.k8snetworking.api.K8sNetworkAdminService)2 GroupService (org.onosproject.net.group.GroupService)2 OpenstackNetworkAdminService (org.onosproject.openstacknetworking.api.OpenstackNetworkAdminService)2 OpenstackSecurityGroupAdminService (org.onosproject.openstacknetworking.api.OpenstackSecurityGroupAdminService)2 RemovalNotification (com.google.common.cache.RemovalNotification)1 MetricsService (org.onlab.metrics.MetricsService)1