Beispiel #1
0
  @Test
  public void testNodesBlockRenderForNodeLabelFilterWithNonEmptyLabel() {
    NodesBlock nodesBlock = injector.getInstance(NodesBlock.class);
    nodesBlock.set("node.label", "x");
    nodesBlock.render();
    PrintWriter writer = injector.getInstance(PrintWriter.class);
    WebAppTests.flushOutput(injector);

    Mockito.verify(
            writer,
            Mockito.times(numberOfRacks * numberOfActualTableHeaders + numberOfThInMetricsTable))
        .print("<td");
  }
Beispiel #2
0
  @Test
  public void testNodesBlockRenderForLostNodes() {
    NodesBlock nodesBlock = injector.getInstance(NodesBlock.class);
    nodesBlock.set("node.state", "lost");
    nodesBlock.render();
    PrintWriter writer = injector.getInstance(PrintWriter.class);
    WebAppTests.flushOutput(injector);

    Mockito.verify(writer, Mockito.times(numberOfActualTableHeaders + numberOfThInMetricsTable))
        .print("<th");
    Mockito.verify(
            writer,
            Mockito.times(
                numberOfRacks * numberOfLostNodesPerRack * numberOfActualTableHeaders
                    + numberOfThInMetricsTable))
        .print("<td");
  }