use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class NetworkConfigWebResourceTest method setUpMocks.
/**
* Sets up mocked config service.
*/
@Before
public void setUpMocks() {
mockNetworkConfigService = new MockNetworkConfigService();
ServiceDirectory testDirectory = new TestServiceDirectory().add(NetworkConfigService.class, mockNetworkConfigService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class RegionsResourceTest method setupTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setupTest() {
final CodecManager codecService = new CodecManager();
codecService.activate();
ServiceDirectory testDirectory = new TestServiceDirectory().add(RegionService.class, mockRegionService).add(RegionAdminService.class, mockRegionAdminService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class ComponentConfigWebResourceTest method setUpMock.
@Before
public void setUpMock() {
service = new TestConfigManager();
ServiceDirectory testDirectory = new TestServiceDirectory().add(ComponentConfigService.class, service);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class DeviceKeyWebResourceTest method setUpMocks.
/**
* Initializes test mocks and environment.
*/
@Before
public void setUpMocks() {
expect(mockDeviceKeyService.getDeviceKeys()).andReturn(deviceKeySet).anyTimes();
// Register the services needed for the test
CodecManager codecService = new CodecManager();
codecService.activate();
ServiceDirectory testDirectory = new TestServiceDirectory().add(DeviceKeyService.class, mockDeviceKeyService).add(DeviceKeyAdminService.class, mockDeviceKeyAdminService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.
the class DevicesResourceTest method setUpMocks.
/**
* Initializes test mocks and environment.
*/
@Before
public void setUpMocks() {
mockDeviceService = createMock(DeviceService.class);
mockDriverService = createMock(DriverService.class);
expect(mockDeviceService.isAvailable(isA(DeviceId.class))).andReturn(true).anyTimes();
expect(mockDeviceService.getRole(isA(DeviceId.class))).andReturn(MastershipRole.MASTER).anyTimes();
expect(mockDeviceService.getLastUpdatedInstant(isA(DeviceId.class))).andReturn(0L).anyTimes();
expect(mockDeviceService.localStatus(isA(DeviceId.class))).andReturn("").anyTimes();
// Register the services needed for the test
CodecManager codecService = new CodecManager();
codecService.activate();
ServiceDirectory testDirectory = new TestServiceDirectory().add(DeviceService.class, mockDeviceService).add(DriverService.class, mockDriverService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
}
Aggregations