Search in sources :

Example 1 with ControlMessage

use of org.onosproject.cpman.ControlMessage in project onos by opennetworkinglab.

the class ControlMessageEventTest method createControlMessages.

private Set<ControlMessage> createControlMessages() {
    final DeviceId deviceId = DeviceId.deviceId("of:0000000000000001");
    Set<ControlMessage> controlMessages = Sets.newConcurrentHashSet();
    controlMessages.add(createControlMessage(INBOUND_PACKET, deviceId));
    controlMessages.add(createControlMessage(OUTBOUND_PACKET, deviceId));
    return controlMessages;
}
Also used : DeviceId(org.onosproject.net.DeviceId) ControlMessage(org.onosproject.cpman.ControlMessage) DefaultControlMessage(org.onosproject.cpman.DefaultControlMessage)

Example 2 with ControlMessage

use of org.onosproject.cpman.ControlMessage in project onos by opennetworkinglab.

the class ControlMessageManagerTest method updateStatsInfo.

/**
 * Tests the updateStatsInfo method.
 */
@Test
public void updateStatsInfo() {
    Set<ControlMessage> cms = Sets.newHashSet();
    ControlMessage.Type in = ControlMessage.Type.INBOUND_PACKET;
    ControlMessage.Type out = ControlMessage.Type.OUTBOUND_PACKET;
    ControlMessage.Type mod = ControlMessage.Type.FLOW_MOD_PACKET;
    ControlMessage.Type rmv = ControlMessage.Type.FLOW_REMOVED_PACKET;
    ControlMessage.Type req = ControlMessage.Type.REQUEST_PACKET;
    ControlMessage.Type rep = ControlMessage.Type.REPLY_PACKET;
    cms.add(new DefaultControlMessage(in, DID, 0, 0, 0, 0));
    cms.add(new DefaultControlMessage(out, DID, 0, 0, 0, 0));
    cms.add(new DefaultControlMessage(mod, DID, 0, 0, 0, 0));
    cms.add(new DefaultControlMessage(rmv, DID, 0, 0, 0, 0));
    cms.add(new DefaultControlMessage(req, DID, 0, 0, 0, 0));
    cms.add(new DefaultControlMessage(rep, DID, 0, 0, 0, 0));
    providerService.updateStatsInfo(DID, cms);
    validateEvents(ControlMessageEvent.Type.STATS_UPDATE);
    cms.clear();
}
Also used : DefaultControlMessage(org.onosproject.cpman.DefaultControlMessage) ControlMessage(org.onosproject.cpman.ControlMessage) DefaultControlMessage(org.onosproject.cpman.DefaultControlMessage) Test(org.junit.Test)

Aggregations

ControlMessage (org.onosproject.cpman.ControlMessage)2 DefaultControlMessage (org.onosproject.cpman.DefaultControlMessage)2 Test (org.junit.Test)1 DeviceId (org.onosproject.net.DeviceId)1