Search in sources :

Example 1 with OFFactoryVer14

use of org.projectfloodlight.openflow.protocol.ver14.OFFactoryVer14 in project open-kilda by telstra.

the class OfPortStatsMapperTest method testToPortStatsDataV14.

@Test
public void testToPortStatsDataV14() {
    OFFactoryVer14 ofFactoryVer14 = new OFFactoryVer14();
    OFPortStatsProp opticalProps = ofFactoryVer14.buildPortStatsPropOptical().setRxPwr(123).build();
    OFPortStatsProp ethernetProps = ofFactoryVer14.buildPortStatsPropEthernet().setRxFrameErr(U64.of(rxFrameErr)).setRxOverErr(U64.of(rxOverErr)).setRxCrcErr(U64.of(rxCrcErr)).setCollisions(U64.of(collisions)).build();
    OFPortStatsEntry ofPortStatsEntry = prebuildPortStatsEntry(ofFactoryVer14.buildPortStatsEntry()).setProperties(Lists.newArrayList(opticalProps, ethernetProps)).build();
    OFPortStatsReply ofPortStatsReply = ofFactoryVer14.buildPortStatsReply().setXid(xId).setEntries(Collections.singletonList(ofPortStatsEntry)).build();
    PortStatsData data = OfPortStatsMapper.INSTANCE.toPostStatsData(Collections.singletonList(ofPortStatsReply), switchId);
    assertPortStatsData(data);
}
Also used : OFFactoryVer14(org.projectfloodlight.openflow.protocol.ver14.OFFactoryVer14) OFPortStatsReply(org.projectfloodlight.openflow.protocol.OFPortStatsReply) OFPortStatsEntry(org.projectfloodlight.openflow.protocol.OFPortStatsEntry) PortStatsData(org.openkilda.messaging.info.stats.PortStatsData) OFPortStatsProp(org.projectfloodlight.openflow.protocol.OFPortStatsProp) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 PortStatsData (org.openkilda.messaging.info.stats.PortStatsData)1 OFPortStatsEntry (org.projectfloodlight.openflow.protocol.OFPortStatsEntry)1 OFPortStatsProp (org.projectfloodlight.openflow.protocol.OFPortStatsProp)1 OFPortStatsReply (org.projectfloodlight.openflow.protocol.OFPortStatsReply)1 OFFactoryVer14 (org.projectfloodlight.openflow.protocol.ver14.OFFactoryVer14)1