@Test public void testLayer1ToRow() { Row row = layer1EdgeToRow(new Layer1Edge("host1", "int1", "host2", "int2")); assertThat( row, allOf( hasColumn( COL_INTERFACE, equalTo(NodeInterfacePair.of("host1", "int1")), Schema.INTERFACE), hasColumn( COL_REMOTE_INTERFACE, equalTo(NodeInterfacePair.of("host2", "int2")), Schema.INTERFACE))); }
@VisibleForTesting static Row layer1EdgeToRow(Layer1Edge layer1Edge) { RowBuilder row = Row.builder(); row.put( COL_INTERFACE, NodeInterfacePair.of( layer1Edge.getNode1().getHostname(), layer1Edge.getNode1().getInterfaceName())) .put( COL_REMOTE_INTERFACE, NodeInterfacePair.of( layer1Edge.getNode2().getHostname(), layer1Edge.getNode2().getInterfaceName())); return row.build(); }
EdgesAnswerer extends Answerer { @VisibleForTesting static Row layer1EdgeToRow(Layer1Edge layer1Edge) { RowBuilder row = Row.builder(); row.put( COL_INTERFACE, NodeInterfacePair.of( layer1Edge.getNode1().getHostname(), layer1Edge.getNode1().getInterfaceName())) .put( COL_REMOTE_INTERFACE, NodeInterfacePair.of( layer1Edge.getNode2().getHostname(), layer1Edge.getNode2().getInterfaceName())); return row.build(); } }
EdgesAnswerer extends Answerer { @VisibleForTesting static Row layer1EdgeToRow(Layer1Edge layer1Edge) { RowBuilder row = Row.builder(); row.put( COL_INTERFACE, NodeInterfacePair.of( layer1Edge.getNode1().getHostname(), layer1Edge.getNode1().getInterfaceName())) .put( COL_REMOTE_INTERFACE, NodeInterfacePair.of( layer1Edge.getNode2().getHostname(), layer1Edge.getNode2().getInterfaceName())); return row.build(); } EdgesAnswerer(Question question, IBatfish batfish); }
EdgesAnswerer extends Answerer { @VisibleForTesting static Row layer1EdgeToRow(Layer1Edge layer1Edge) { RowBuilder row = Row.builder(); row.put( COL_INTERFACE, NodeInterfacePair.of( layer1Edge.getNode1().getHostname(), layer1Edge.getNode1().getInterfaceName())) .put( COL_REMOTE_INTERFACE, NodeInterfacePair.of( layer1Edge.getNode2().getHostname(), layer1Edge.getNode2().getInterfaceName())); return row.build(); } EdgesAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot); }
EdgesAnswerer extends Answerer { @VisibleForTesting static Row layer1EdgeToRow(Layer1Edge layer1Edge) { RowBuilder row = Row.builder(); row.put( COL_INTERFACE, NodeInterfacePair.of( layer1Edge.getNode1().getHostname(), layer1Edge.getNode1().getInterfaceName())) .put( COL_REMOTE_INTERFACE, NodeInterfacePair.of( layer1Edge.getNode2().getHostname(), layer1Edge.getNode2().getInterfaceName())); return row.build(); } EdgesAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot);  }