use of org.apache.geode.management.internal.cli.result.TableBuilder.RowGroup in project geode by apache.
the class TableBuilderJUnitTest method testSeparatorWithMultipleChars.
@Test
public void testSeparatorWithMultipleChars() throws Exception {
assertTrue(TableBuilderHelper.shouldTrimColumns());
Table table = createTableStructure(4, "<|>");
RowGroup rowGroup = table.getLastRowGroup();
Row row1 = rowGroup.newRow();
row1.newLeftCol("1").newLeftCol("123456789-").newLeftCol("123456789-").newLeftCol("123456789-123456789-12345");
List<String> result = validateTable(table, true);
// Check the last line
assertEquals("1 <|>123456789-<|>123456789-<|>123..", result.get(3));
}
use of org.apache.geode.management.internal.cli.result.TableBuilder.RowGroup in project geode by apache.
the class TableBuilderJUnitTest method testMultipleColumnsTruncated.
@Test
public void testMultipleColumnsTruncated() throws Exception {
assertTrue(TableBuilderHelper.shouldTrimColumns());
Table table = createTableStructure(4, "|");
RowGroup rowGroup = table.getLastRowGroup();
Row row1 = rowGroup.newRow();
row1.newLeftCol("1").newLeftCol("123456789-").newLeftCol("123456789-123456789-123456789-").newLeftCol("123456789-123456789-12345");
List<String> result = validateTable(table, true);
// Check the last line
assertEquals("1 |123456789-|123456789..|1234567..", result.get(3));
}
use of org.apache.geode.management.internal.cli.result.TableBuilder.RowGroup in project geode by apache.
the class TableBuilderJUnitTest method testDisableColumnAdjustment.
/**
* set gfsh env property result_viewer to basic disable for external reader
*/
@Test
public void testDisableColumnAdjustment() throws Exception {
when(TableBuilderHelper.class, "shouldTrimColumns").thenReturn(false);
assertFalse(TableBuilderHelper.shouldTrimColumns());
Table table = createTableStructure(5, "|");
RowGroup rowGroup = table.getLastRowGroup();
Row row1 = rowGroup.newRow();
row1.newLeftCol("1").newLeftCol("123456789-").newLeftCol("123456789-").newLeftCol("123456789-123456789-12345").newLeftCol("1");
List<String> result = validateTable(table, false);
// Check the last line
assertEquals("1 |123456789-|123456789-|123456789-123456789-12345|1", result.get(3));
}
use of org.apache.geode.management.internal.cli.result.TableBuilder.RowGroup in project geode by apache.
the class TableBuilderJUnitTest method testLongestColumnFirstTruncated.
@Test
public void testLongestColumnFirstTruncated() throws Exception {
assertTrue(TableBuilderHelper.shouldTrimColumns());
Table table = createTableStructure(4, "|");
RowGroup rowGroup = table.getLastRowGroup();
Row row1 = rowGroup.newRow();
row1.newLeftCol("123456789-123456789-").newLeftCol("123456789-12345").newLeftCol("123456789-").newLeftCol("1");
List<String> result = validateTable(table, true);
// Check the last line
assertEquals("1234..|123456789-12345|123456789-|1", result.get(3));
}
use of org.apache.geode.management.internal.cli.result.TableBuilder.RowGroup in project geode by apache.
the class TableBuilderJUnitTest method testMultipleColumnsTruncatedLongestFirst.
@Test
public void testMultipleColumnsTruncatedLongestFirst() throws Exception {
assertTrue(TableBuilderHelper.shouldTrimColumns());
Table table = createTableStructure(4, "|");
RowGroup rowGroup = table.getLastRowGroup();
Row row1 = rowGroup.newRow();
row1.newLeftCol("123456789-123456789-123456789-").newLeftCol("123456789-123456789-12345").newLeftCol("1").newLeftCol("123456789-");
List<String> result = validateTable(table, true);
// Check the last line
assertEquals("123456789..|1234567..|1 |123456789-", result.get(3));
}
Aggregations