Search in sources :

Example 11 with ServiceDirectory

use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.

the class VirtualNetworkWebResourceTest method setUpTest.

/**
 * Sets up the global values for all the tests.
 */
@Before
public void setUpTest() {
    // Register the services needed for the test
    codecService = new CodecManager();
    codecService.activate();
    ServiceDirectory testDirectory = new TestServiceDirectory().add(VirtualNetworkAdminService.class, mockVnetAdminService).add(VirtualNetworkService.class, mockVnetService).add(CodecService.class, codecService);
    setServiceDirectory(testDirectory);
}
Also used : ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) VirtualNetworkService(org.onosproject.incubator.net.virtual.VirtualNetworkService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CodecManager(org.onosproject.codec.impl.CodecManager) Before(org.junit.Before)

Example 12 with ServiceDirectory

use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.

the class OpenstackTelemetryConfigWebResourceTest method setUpTest.

/**
 * Sets up the global values for all the tests.
 */
@Before
public void setUpTest() {
    ServiceDirectory testDirectory = new TestServiceDirectory().add(TelemetryConfigAdminService.class, mockConfigAdminService);
    setServiceDirectory(testDirectory);
    PROP.put(PROP_KEY_1, PROP_VALUE_1);
    PROP.put(PROP_KEY_2, PROP_VALUE_2);
    telemetryConfig = new DefaultTelemetryConfig(NAME, TYPE, null, MANUFACTURER, SW_VERSION, STATUS, PROP);
}
Also used : ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) DefaultTelemetryConfig(org.onosproject.openstacktelemetry.api.DefaultTelemetryConfig) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) Before(org.junit.Before)

Example 13 with ServiceDirectory

use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.

the class AclWebResourceTest method setUpMock.

@Before
public void setUpMock() {
    expect(mockAclService.getAclRules()).andReturn(rules).anyTimes();
    ServiceDirectory testDirectory = new TestServiceDirectory().add(AclService.class, mockAclService).add(AclStore.class, mockAclStore);
    setServiceDirectory(testDirectory);
    TestUtils.setField(BaseResource.class, "services", testDirectory);
    AclRule.idGenerator = new MockIdGenerator();
}
Also used : ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) Before(org.junit.Before)

Example 14 with ServiceDirectory

use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.

the class KubevirtApiConfigWebResourceTest method setUpTest.

/**
 * Sets up the global values for all the tests.
 */
@Before
public void setUpTest() {
    final CodecManager codecService = new CodecManager();
    codecService.activate();
    codecService.registerCodec(KubevirtApiConfig.class, new KubevirtApiConfigCodec());
    ServiceDirectory testDirectory = new TestServiceDirectory().add(KubevirtApiConfigAdminService.class, mockConfigAdminService).add(CodecService.class, codecService);
    setServiceDirectory(testDirectory);
    kubevirtApiConfig = DefaultKubevirtApiConfig.builder().scheme(HTTPS).ipAddress(IpAddress.valueOf("10.134.34.223")).port(6443).state(DISCONNECTED).token("tokenMod").caCertData("caCertData").clientCertData("clientCertData").clientKeyData("clientKeyData").datacenterId("DB").clusterId("BD-MEH-CT01").build();
}
Also used : ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) KubevirtApiConfigAdminService(org.onosproject.kubevirtnode.api.KubevirtApiConfigAdminService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) KubevirtApiConfigCodec(org.onosproject.kubevirtnode.codec.KubevirtApiConfigCodec) CodecManager(org.onosproject.codec.impl.CodecManager) Before(org.junit.Before)

Example 15 with ServiceDirectory

use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.

the class OpenstackFloatingIpWebResourceTest 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)56 Before (org.junit.Before)53 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)53 CodecManager (org.onosproject.codec.impl.CodecManager)32 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 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 KubevirtHostRouteCodec (org.onosproject.kubevirtnetworking.codec.KubevirtHostRouteCodec)2 KubevirtIpPoolCodec (org.onosproject.kubevirtnetworking.codec.KubevirtIpPoolCodec)2 KubevirtNetworkCodec (org.onosproject.kubevirtnetworking.codec.KubevirtNetworkCodec)2 GroupService (org.onosproject.net.group.GroupService)2 OpenstackNetworkAdminService (org.onosproject.openstacknetworking.api.OpenstackNetworkAdminService)2 OpenstackRouterAdminService (org.onosproject.openstacknetworking.api.OpenstackRouterAdminService)2