Search in sources :

Example 16 with TestServiceDirectory

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

the class TenantWebResourceTest method setUpTest.

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

Example 17 with TestServiceDirectory

use of org.onlab.osgi.TestServiceDirectory 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 18 with TestServiceDirectory

use of org.onlab.osgi.TestServiceDirectory 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 19 with TestServiceDirectory

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

the class ProtectionConfigTest method setUpClass.

@BeforeClass
public static void setUpClass() throws TestUtilsException {
    directory = new TestServiceDirectory();
    CodecManager codecService = new CodecManager();
    codecService.activate();
    directory.add(CodecService.class, codecService);
    // replace service directory used by BaseConfig
    original = TestUtils.getField(BaseConfig.class, "services");
    TestUtils.setField(BaseConfig.class, "services", directory);
}
Also used : TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CodecManager(org.onosproject.codec.impl.CodecManager) BaseConfig(org.onosproject.net.config.BaseConfig) BeforeClass(org.junit.BeforeClass)

Example 20 with TestServiceDirectory

use of org.onlab.osgi.TestServiceDirectory 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)

Aggregations

TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)71 Before (org.junit.Before)66 ServiceDirectory (org.onlab.osgi.ServiceDirectory)53 CodecManager (org.onosproject.codec.impl.CodecManager)37 DistributedVirtualNetworkStore (org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore)14 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)13 TestStorageService (org.onosproject.store.service.TestStorageService)12 CoreService (org.onosproject.core.CoreService)10 BeforeClass (org.junit.BeforeClass)5 CfmCodecContext (org.onosproject.cfm.CfmCodecContext)5 CodecService (org.onosproject.codec.CodecService)5 VirtualProviderManager (org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager)5 BaseConfig (org.onosproject.net.config.BaseConfig)5 DeviceService (org.onosproject.net.device.DeviceService)5 TestApplicationId (org.onosproject.TestApplicationId)4 CfmMdService (org.onosproject.incubator.net.l2monitoring.cfm.service.CfmMdService)3 VirtualNetworkStore (org.onosproject.incubator.net.virtual.VirtualNetworkStore)3 VirtualProviderRegistryService (org.onosproject.incubator.net.virtual.provider.VirtualProviderRegistryService)3 SimpleVirtualFlowRuleStore (org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualFlowRuleStore)3 Semaphore (java.util.concurrent.Semaphore)2