@Test public void testMetaData() { List<ColumnMetadata> metas = OspfSessionCompatibilityAnswerer.createTableMetadata().getColumnMetadata(); assertThat( metas.stream().map(ColumnMetadata::getName).collect(ImmutableList.toImmutableList()), equalTo( ImmutableList.builder() .add(COL_INTERFACE) .add(COL_VRF) .add(COL_IP) .add(COL_AREA) .add(COL_REMOTE_INTERFACE) .add(COL_REMOTE_VRF) .add(COL_REMOTE_IP) .add(COL_REMOTE_AREA) .add(COL_SESSION_STATUS) .build())); }
@VisibleForTesting static TableMetadata createTableMetadata() { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); columnBuilder.add( new ColumnMetadata(COL_INTERFACE, Schema.INTERFACE, "Interface", true, false)); columnBuilder.add(new ColumnMetadata(COL_VRF, Schema.STRING, "VRF", true, false)); columnBuilder.add(new ColumnMetadata(COL_IP, Schema.IP, "Ip", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA, Schema.LONG, "Area", true, false)); columnBuilder.add( new ColumnMetadata( COL_REMOTE_INTERFACE, Schema.INTERFACE, "Remote Interface", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_VRF, Schema.STRING, "Remote VRF", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_IP, Schema.IP, "Remote IP", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_AREA, Schema.LONG, "Remote Area", false, true)); columnBuilder.add( new ColumnMetadata( COL_SESSION_STATUS, Schema.STRING, "Status of the OSPF session", false, true)); return new TableMetadata(columnBuilder.build(), "Display OSPF sessions"); }
OspfSessionCompatibilityAnswerer extends Answerer { @VisibleForTesting static TableMetadata createTableMetadata() { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); columnBuilder.add( new ColumnMetadata(COL_INTERFACE, Schema.INTERFACE, "Interface", true, false)); columnBuilder.add(new ColumnMetadata(COL_VRF, Schema.STRING, "VRF", true, false)); columnBuilder.add(new ColumnMetadata(COL_IP, Schema.IP, "Ip", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA, Schema.LONG, "Area", true, false)); columnBuilder.add( new ColumnMetadata( COL_REMOTE_INTERFACE, Schema.INTERFACE, "Remote Interface", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_VRF, Schema.STRING, "Remote VRF", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_IP, Schema.IP, "Remote IP", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_AREA, Schema.LONG, "Remote Area", false, true)); columnBuilder.add( new ColumnMetadata( COL_SESSION_STATUS, Schema.STRING, "Status of the OSPF session", false, true)); return new TableMetadata(columnBuilder.build(), "Display OSPF sessions"); } }
OspfSessionCompatibilityAnswerer extends Answerer { @VisibleForTesting static TableMetadata createTableMetadata() { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); columnBuilder.add( new ColumnMetadata(COL_INTERFACE, Schema.INTERFACE, "Interface", true, false)); columnBuilder.add(new ColumnMetadata(COL_VRF, Schema.STRING, "VRF", true, false)); columnBuilder.add(new ColumnMetadata(COL_IP, Schema.IP, "Ip", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA, Schema.LONG, "Area", true, false)); columnBuilder.add( new ColumnMetadata( COL_REMOTE_INTERFACE, Schema.INTERFACE, "Remote Interface", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_VRF, Schema.STRING, "Remote VRF", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_IP, Schema.IP, "Remote IP", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_AREA, Schema.LONG, "Remote Area", false, true)); columnBuilder.add( new ColumnMetadata( COL_SESSION_STATUS, Schema.STRING, "Status of the OSPF session", false, true)); return new TableMetadata(columnBuilder.build(), "Display OSPF sessions"); } OspfSessionCompatibilityAnswerer(Question question, IBatfish batfish); }
OspfSessionCompatibilityAnswerer extends Answerer { @VisibleForTesting static TableMetadata createTableMetadata() { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); columnBuilder.add( new ColumnMetadata(COL_INTERFACE, Schema.INTERFACE, "Interface", true, false)); columnBuilder.add(new ColumnMetadata(COL_VRF, Schema.STRING, "VRF", true, false)); columnBuilder.add(new ColumnMetadata(COL_IP, Schema.IP, "Ip", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA, Schema.LONG, "Area", true, false)); columnBuilder.add( new ColumnMetadata( COL_REMOTE_INTERFACE, Schema.INTERFACE, "Remote Interface", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_VRF, Schema.STRING, "Remote VRF", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_IP, Schema.IP, "Remote IP", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_AREA, Schema.LONG, "Remote Area", false, true)); columnBuilder.add( new ColumnMetadata( COL_SESSION_STATUS, Schema.STRING, "Status of the OSPF session", false, true)); return new TableMetadata(columnBuilder.build(), "Display OSPF sessions"); } OspfSessionCompatibilityAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot); }
OspfSessionCompatibilityAnswerer extends Answerer { @VisibleForTesting static TableMetadata createTableMetadata() { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); columnBuilder.add( new ColumnMetadata(COL_INTERFACE, Schema.INTERFACE, "Interface", true, false)); columnBuilder.add(new ColumnMetadata(COL_VRF, Schema.STRING, "VRF", true, false)); columnBuilder.add(new ColumnMetadata(COL_IP, Schema.IP, "Ip", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA, Schema.LONG, "Area", true, false)); columnBuilder.add( new ColumnMetadata( COL_REMOTE_INTERFACE, Schema.INTERFACE, "Remote Interface", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_VRF, Schema.STRING, "Remote VRF", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_IP, Schema.IP, "Remote IP", false, true)); columnBuilder.add(new ColumnMetadata(COL_REMOTE_AREA, Schema.LONG, "Remote Area", false, true)); columnBuilder.add( new ColumnMetadata( COL_SESSION_STATUS, Schema.STRING, "Status of the OSPF session", false, true)); return new TableMetadata(columnBuilder.build(), "Display OSPF sessions"); } OspfSessionCompatibilityAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot);  }