Examples of PadPrinterParserDecorator


Examples of org.threeten.bp.format.DateTimeFormatterBuilder.PadPrinterParserDecorator

        assertEquals(buf.toString(), "EXISTING--Z");
    }

    //-----------------------------------------------------------------------
    public void test_print_noPadRequiredSingle() throws Exception {
        PadPrinterParserDecorator pp = new PadPrinterParserDecorator(new CharLiteralPrinterParser('Z'), 1, '-');
        pp.print(printEmptyContext, buf);
        assertEquals(buf.toString(), "Z");
    }
View Full Code Here

Examples of org.threeten.bp.format.DateTimeFormatterBuilder.PadPrinterParserDecorator

        pp.print(printEmptyContext, buf);
        assertEquals(buf.toString(), "Z");
    }

    public void test_print_padRequiredSingle() throws Exception {
        PadPrinterParserDecorator pp = new PadPrinterParserDecorator(new CharLiteralPrinterParser('Z'), 5, '-');
        pp.print(printEmptyContext, buf);
        assertEquals(buf.toString(), "----Z");
    }
View Full Code Here

Examples of org.threeten.bp.format.DateTimeFormatterBuilder.PadPrinterParserDecorator

        pp.print(printEmptyContext, buf);
        assertEquals(buf.toString(), "----Z");
    }

    public void test_print_noPadRequiredMultiple() throws Exception {
        PadPrinterParserDecorator pp = new PadPrinterParserDecorator(new StringLiteralPrinterParser("WXYZ"), 4, '-');
        pp.print(printEmptyContext, buf);
        assertEquals(buf.toString(), "WXYZ");
    }
View Full Code Here

Examples of org.threeten.bp.format.DateTimeFormatterBuilder.PadPrinterParserDecorator

        pp.print(printEmptyContext, buf);
        assertEquals(buf.toString(), "WXYZ");
    }

    public void test_print_padRequiredMultiple() throws Exception {
        PadPrinterParserDecorator pp = new PadPrinterParserDecorator(new StringLiteralPrinterParser("WXYZ"), 5, '-');
        pp.print(printEmptyContext, buf);
        assertEquals(buf.toString(), "-WXYZ");
    }
View Full Code Here

Examples of org.threeten.bp.format.DateTimeFormatterBuilder.PadPrinterParserDecorator

        assertEquals(buf.toString(), "-WXYZ");
    }

    @Test(expectedExceptions=DateTimeException.class)
    public void test_print_overPad() throws Exception {
        PadPrinterParserDecorator pp = new PadPrinterParserDecorator(new StringLiteralPrinterParser("WXYZ"), 3, '-');
        pp.print(printEmptyContext, buf);
    }
View Full Code Here

Examples of org.threeten.bp.format.DateTimeFormatterBuilder.PadPrinterParserDecorator

    }

    //-----------------------------------------------------------------------
    public void test_toString1() throws Exception {
        CharLiteralPrinterParser wrapped = new CharLiteralPrinterParser('Y');
        PadPrinterParserDecorator pp = new PadPrinterParserDecorator(wrapped, 5, ' ');
        assertEquals(pp.toString(), "Pad('Y',5)");
    }
View Full Code Here

Examples of org.threeten.bp.format.DateTimeFormatterBuilder.PadPrinterParserDecorator

        assertEquals(pp.toString(), "Pad('Y',5)");
    }

    public void test_toString2() throws Exception {
        CharLiteralPrinterParser wrapped = new CharLiteralPrinterParser('Y');
        PadPrinterParserDecorator pp = new PadPrinterParserDecorator(wrapped, 5, '-');
        assertEquals(pp.toString(), "Pad('Y',5,'-')");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.