Search in sources :

Example 1 with Report

use of org.apache.rya.indexing.pcj.fluo.client.util.Report in project incubator-rya by apache.

the class ReportTests method singleLineValues.

@Test
public void singleLineValues() {
    final Report.Builder builder = Report.builder();
    builder.appendItem(new ReportItem("Title 1", new String[] { "Short value." }));
    builder.appendItem(new ReportItem("Title 2", new String[] { "This is the longest values that appears in the report." }));
    builder.appendItem(new ReportItem("This is a long title", new String[] { "Short value." }));
    final Report report = builder.build();
    final String expected = "---------------------------------------------------------------------------------\n" + "| Title 1              | Short value.                                           |\n" + "| Title 2              | This is the longest values that appears in the report. |\n" + "| This is a long title | Short value.                                           |\n" + "---------------------------------------------------------------------------------\n";
    assertEquals(expected, report.toString());
}
Also used : Report(org.apache.rya.indexing.pcj.fluo.client.util.Report) ReportItem(org.apache.rya.indexing.pcj.fluo.client.util.Report.ReportItem) Test(org.junit.Test)

Example 2 with Report

use of org.apache.rya.indexing.pcj.fluo.client.util.Report in project incubator-rya by apache.

the class ReportTests method emptyValues.

@Test
public void emptyValues() {
    final Report.Builder builder = Report.builder();
    builder.appendItem(new ReportItem("No Value Here", new String[] {}));
    builder.appendItem(new ReportItem("Value Here", new String[] { "This one has a value." }));
    final Report report = builder.build();
    final String expected = "-----------------------------------------\n" + "| No Value Here |                       |\n" + "| Value Here    | This one has a value. |\n" + "-----------------------------------------\n";
    assertEquals(expected, report.toString());
}
Also used : Report(org.apache.rya.indexing.pcj.fluo.client.util.Report) ReportItem(org.apache.rya.indexing.pcj.fluo.client.util.Report.ReportItem) Test(org.junit.Test)

Example 3 with Report

use of org.apache.rya.indexing.pcj.fluo.client.util.Report in project incubator-rya by apache.

the class ReportTests method multiLineValues.

@Test
public void multiLineValues() {
    final Report.Builder builder = Report.builder();
    builder.appendItem(new ReportItem("Title 1", new String[] { "Value 1" }));
    builder.appendItem(new ReportItem("Multiple Lines", new String[] { "This is the first line.", "This is the second line." }));
    builder.appendItem(new ReportItem("Title 2", new String[] { "Value 2" }));
    final Report report = builder.build();
    final String expected = "---------------------------------------------\n" + "| Title 1        | Value 1                  |\n" + "| Multiple Lines | This is the first line.  |\n" + "|                | This is the second line. |\n" + "| Title 2        | Value 2                  |\n" + "---------------------------------------------\n";
    assertEquals(expected, report.toString());
}
Also used : Report(org.apache.rya.indexing.pcj.fluo.client.util.Report) ReportItem(org.apache.rya.indexing.pcj.fluo.client.util.Report.ReportItem) Test(org.junit.Test)

Aggregations

Report (org.apache.rya.indexing.pcj.fluo.client.util.Report)3 ReportItem (org.apache.rya.indexing.pcj.fluo.client.util.Report.ReportItem)3 Test (org.junit.Test)3