use of org.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.
the class OpenstackVtapNetworkWebResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
final CodecManager codecService = new CodecManager();
codecService.activate();
codecService.registerCodec(OpenstackVtapNetwork.class, new OpenstackVtapNetworkCodec());
ServiceDirectory testDirectory = new TestServiceDirectory().add(OpenstackVtapService.class, mockVtapService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
vtapNetwork = DefaultOpenstackVtapNetwork.builder().mode(OpenstackVtapNetwork.Mode.VXLAN).networkId(1).serverIp(IpAddress.valueOf("10.10.10.1")).build();
}
use of org.onosproject.codec.impl.CodecManager 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.onosproject.codec.impl.CodecManager 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.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.
the class ControlMetricsResourceTest method setUpTest.
/**
* Sets up the global values for all the tests.
*/
@Before
public void setUpTest() {
final CodecManager codecService = new CodecManager();
codecService.activate();
codecService.registerCodec(ControlLoadSnapshot.class, new ControlLoadSnapshotCodec());
ServiceDirectory testDirectory = new TestServiceDirectory().add(ControlPlaneMonitorService.class, mockControlPlaneMonitorService).add(ClusterService.class, mockClusterService).add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
nodeId = new NodeId("1");
mockControlLoad = new MockControlLoad();
ControllerNode mockControllerNode = new MockControllerNode(nodeId);
expect(mockClusterService.getLocalNode()).andReturn(mockControllerNode).anyTimes();
replay(mockClusterService);
}
use of org.onosproject.codec.impl.CodecManager in project onos by opennetworkinglab.
the class AlarmsWebResourceTest method setUpMock.
@Before
public void setUpMock() {
CodecManager codecService = new CodecManager();
codecService.activate();
ServiceDirectory testDirectory = new TestServiceDirectory().add(CodecService.class, codecService);
setServiceDirectory(testDirectory);
}
Aggregations