Search in sources :

Example 1 with StripCRLFStringConverter

use of com.questdb.printer.converter.StripCRLFStringConverter in project questdb by bluestreak01.

the class PrinterTest method testCRLFStripping.

@Test
public void testCRLFStripping() {
    try (JournalPrinter printer = new JournalPrinter()) {
        printer.setAppender(testAppender).setNullString("").types(String.class, TestEntity.class).v(0).c(new StripCRLFStringConverter(printer)).h("Test String").f("bStr").c(new StripCRLFStringConverter(printer)).h("destination");
        printer.out("test string", new TestEntity().setBStr("ok\nbunny"));
        printer.out("test\nstring2\r_good", new TestEntity().setBStr("ok foxy"));
        testAppender.assertLine("test string\tok bunny", 0);
        testAppender.assertLine("test string2_good\tok foxy", 1);
    }
}
Also used : TestEntity(com.questdb.model.TestEntity) StripCRLFStringConverter(com.questdb.printer.converter.StripCRLFStringConverter) Test(org.junit.Test)

Aggregations

TestEntity (com.questdb.model.TestEntity)1 StripCRLFStringConverter (com.questdb.printer.converter.StripCRLFStringConverter)1 Test (org.junit.Test)1