use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table._case.multipart.reply.table.TableStatsBuilder in project openflowplugin by opendaylight.
the class OF10StatsReplyMessageFactoryTest method createTableStats.
private static List<TableStats> createTableStats() {
TableStatsBuilder builder = new TableStatsBuilder();
builder.setTableId((short) 1);
builder.setName("Table name");
builder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
builder.setMaxEntries(1L);
builder.setActiveCount(1L);
builder.setLookupCount(BigInteger.valueOf(1234L));
builder.setMatchedCount(BigInteger.valueOf(1234L));
List<TableStats> list = new ArrayList<>();
list.add(builder.build());
return list;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table._case.multipart.reply.table.TableStatsBuilder in project openflowplugin by opendaylight.
the class StatisticsGatheringUtilsTest method testGatherStatistics_table.
@Test
public void testGatherStatistics_table() throws Exception {
final MultipartType type = MultipartType.OFPMPTABLE;
final TableStatsBuilder tableStatsBld = new TableStatsBuilder().setActiveCount(33L).setLookupCount(BigInteger.valueOf(34L)).setMatchedCount(BigInteger.valueOf(35L)).setTableId((short) 0);
final MultipartReplyTableBuilder mpReplyTableBld = new MultipartReplyTableBuilder();
mpReplyTableBld.setTableStats(Lists.newArrayList(tableStatsBld.build()));
final MultipartReplyTableCaseBuilder mpReplyTableCaseBld = new MultipartReplyTableCaseBuilder();
mpReplyTableCaseBld.setMultipartReplyTable(mpReplyTableBld.build());
final MultipartReply meterStatsUpdated = assembleMPReplyMessage(type, mpReplyTableCaseBld.build());
final List<MultipartReply> statsData = Collections.singletonList(meterStatsUpdated);
fireAndCheck(type, statsData);
final InstanceIdentifier<FlowTableStatistics> tablePath = dummyNodePath.augmentation(FlowCapableNode.class).child(Table.class, new TableKey((short) 0)).augmentation(FlowTableStatisticsData.class).child(FlowTableStatistics.class);
verify(deviceContext).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL), Matchers.eq(tablePath), Matchers.any(FlowTableStatistics.class));
}
Aggregations