Search in sources :

Example 1 with NodesBlock

use of org.apache.hadoop.yarn.server.resourcemanager.webapp.NodesPage.NodesBlock in project hadoop by apache.

the class TestNodesPage method testNodesBlockRenderForNodeLabelFilterWithEmptyLabel.

@Test
public void testNodesBlockRenderForNodeLabelFilterWithEmptyLabel() {
    NodesBlock nodesBlock = injector.getInstance(NodesBlock.class);
    nodesBlock.set("node.label", "");
    nodesBlock.render();
    PrintWriter writer = injector.getInstance(PrintWriter.class);
    WebAppTests.flushOutput(injector);
    Mockito.verify(writer, Mockito.times(numberOfThInMetricsTable)).print("<td");
}
Also used : NodesBlock(org.apache.hadoop.yarn.server.resourcemanager.webapp.NodesPage.NodesBlock) PrintWriter(java.io.PrintWriter) Test(org.junit.Test)

Example 2 with NodesBlock

use of org.apache.hadoop.yarn.server.resourcemanager.webapp.NodesPage.NodesBlock in project hadoop by apache.

the class TestNodesPage method testNodesBlockRenderForLostNodes.

@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(numberOfThInMetricsTable)).print("<td");
}
Also used : NodesBlock(org.apache.hadoop.yarn.server.resourcemanager.webapp.NodesPage.NodesBlock) PrintWriter(java.io.PrintWriter) Test(org.junit.Test)

Example 3 with NodesBlock

use of org.apache.hadoop.yarn.server.resourcemanager.webapp.NodesPage.NodesBlock in project hadoop by apache.

the class TestNodesPage method testNodesBlockRenderForNodeLabelFilterWithNonEmptyLabel.

@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(numberOfThInMetricsTable)).print("<td");
    Mockito.verify(writer, Mockito.times(1)).print("<script");
}
Also used : NodesBlock(org.apache.hadoop.yarn.server.resourcemanager.webapp.NodesPage.NodesBlock) PrintWriter(java.io.PrintWriter) Test(org.junit.Test)

Example 4 with NodesBlock

use of org.apache.hadoop.yarn.server.resourcemanager.webapp.NodesPage.NodesBlock in project hadoop by apache.

the class TestNodesPage method testNodesBlockRenderForNodeLabelFilterWithAnyLabel.

@Test
public void testNodesBlockRenderForNodeLabelFilterWithAnyLabel() {
    NodesBlock nodesBlock = injector.getInstance(NodesBlock.class);
    nodesBlock.set("node.label", "*");
    nodesBlock.render();
    PrintWriter writer = injector.getInstance(PrintWriter.class);
    WebAppTests.flushOutput(injector);
    Mockito.verify(writer, Mockito.times(numberOfThInMetricsTable)).print("<td");
}
Also used : NodesBlock(org.apache.hadoop.yarn.server.resourcemanager.webapp.NodesPage.NodesBlock) PrintWriter(java.io.PrintWriter) Test(org.junit.Test)

Aggregations

PrintWriter (java.io.PrintWriter)4 NodesBlock (org.apache.hadoop.yarn.server.resourcemanager.webapp.NodesPage.NodesBlock)4 Test (org.junit.Test)4