use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.
the class FlowObjectiveResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
// Mock Core Service
expect(mockCoreService.getAppId(anyShort())).andReturn(NetTestTools.APP_ID).anyTimes();
expect(mockCoreService.registerApplication(REST_APP_ID)).andReturn(APP_ID).anyTimes();
replay(mockCoreService);
// Register the services needed for the test
final CodecManager codecService = new CodecManager();
codecService.activate();
ServiceDirectory testDirectory = new TestServiceDirectory().add(FlowObjectiveService.class, mockFlowObjectiveService).add(CodecService.class, codecService).add(CoreService.class, mockCoreService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.
the class IntentsResourceTest method setUpTest.
/**
* Initializes test mocks and environment.
*/
@Before
public void setUpTest() {
expect(mockIntentService.getIntents()).andReturn(intents).anyTimes();
expect(mockIntentService.getIntentState(anyObject())).andReturn(IntentState.INSTALLED).anyTimes();
// Register the services needed for the test
final CodecManager codecService = new CodecManager();
codecService.activate();
ServiceDirectory testDirectory = new TestServiceDirectory().add(IntentService.class, mockIntentService).add(FlowRuleService.class, mockFlowService).add(CodecService.class, codecService).add(CoreService.class, mockCoreService);
setServiceDirectory(testDirectory);
MockIdGenerator.cleanBind();
}
use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.
the class MulticastRouteResourceTest method setupTest.
@Before
public void setupTest() {
final CodecManager codecService = new CodecManager();
codecService.activate();
ServiceDirectory testDirectory = new TestServiceDirectory().add(MulticastRouteService.class, mockMulticastRouteService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.
the class PathsResourceTest method setUpTest.
/**
* Initializes test mocks and environment.
*/
@Before
public void setUpTest() {
// Register the services needed for the test
CodecManager codecService = new CodecManager();
codecService.activate();
ServiceDirectory testDirectory = new TestServiceDirectory().add(PathService.class, mockPathService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
}
use of org.onlab.osgi.ServiceDirectory in project onos by opennetworkinglab.
the class TopologyResourceTest method setUpTest.
/**
* Initializes the test harness.
*/
@Before
public void setUpTest() {
TopologyService topologyService = new MockTopologyService();
DeviceService mockDeviceService = new MockDeviceService();
CodecManager codecService = new CodecManager();
codecService.activate();
ServiceDirectory testDirectory = new TestServiceDirectory().add(DeviceService.class, mockDeviceService).add(TopologyService.class, topologyService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
}
Aggregations