Search in sources :

Example 1 with ControlLoadSnapshotCodec

use of org.onosproject.cpman.codec.ControlLoadSnapshotCodec 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);
}
Also used : ClusterService(org.onosproject.cluster.ClusterService) ControlLoadSnapshotCodec(org.onosproject.cpman.codec.ControlLoadSnapshotCodec) ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) NodeId(org.onosproject.cluster.NodeId) ControllerNode(org.onosproject.cluster.ControllerNode) CodecManager(org.onosproject.codec.impl.CodecManager) Before(org.junit.Before)

Example 2 with ControlLoadSnapshotCodec

use of org.onosproject.cpman.codec.ControlLoadSnapshotCodec in project onos by opennetworkinglab.

the class CPManCodecRegistrator method activate.

@Activate
public void activate() {
    codecService.registerCodec(ControlLoadSnapshot.class, new ControlLoadSnapshotCodec());
    log.info("Started");
}
Also used : ControlLoadSnapshotCodec(org.onosproject.cpman.codec.ControlLoadSnapshotCodec) Activate(org.osgi.service.component.annotations.Activate)

Aggregations

ControlLoadSnapshotCodec (org.onosproject.cpman.codec.ControlLoadSnapshotCodec)2 Before (org.junit.Before)1 ServiceDirectory (org.onlab.osgi.ServiceDirectory)1 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)1 ClusterService (org.onosproject.cluster.ClusterService)1 ControllerNode (org.onosproject.cluster.ControllerNode)1 NodeId (org.onosproject.cluster.NodeId)1 CodecManager (org.onosproject.codec.impl.CodecManager)1 Activate (org.osgi.service.component.annotations.Activate)1