Package org.threeten.bp.format.DateTimeFormatterBuilder

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


public class TestPadParserDecorator extends AbstractTestPrinterParser {

    //-----------------------------------------------------------------------
    @Test(expectedExceptions=IndexOutOfBoundsException.class)
    public void test_parse_negativePosition() throws Exception {
        PadPrinterParserDecorator pp = new PadPrinterParserDecorator(new CharLiteralPrinterParser('Z'), 3, '-');
        pp.parse(parseContext, "--Z", -1);
    }
View Full Code Here


        pp.parse(parseContext, "--Z", -1);
    }

    @Test(expectedExceptions=IndexOutOfBoundsException.class)
    public void test_parse_offEndPosition() throws Exception {
        PadPrinterParserDecorator pp = new PadPrinterParserDecorator(new CharLiteralPrinterParser('Z'), 3, '-');
        pp.parse(parseContext, "--Z", 4);
    }
View Full Code Here

@Test
public class TestPadPrinterDecorator extends AbstractTestPrinterParser {

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

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

    public void test_print_fullDateTime() throws Exception {
        printContext.setDateTime(LocalDate.of(2008, 12, 3));
        PadPrinterParserDecorator pp = new PadPrinterParserDecorator(new CharLiteralPrinterParser('Z'), 3, '-');
        pp.print(printContext, buf);
        assertEquals(buf.toString(), "--Z");
    }
View Full Code Here

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

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

        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

        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

        pp.print(printEmptyContext, buf);
    }

    //-----------------------------------------------------------------------
    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

        PadPrinterParserDecorator pp = new PadPrinterParserDecorator(wrapped, 5, ' ');
        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

public class TestCharLiteralPrinter extends AbstractTestPrinterParser {

    //-----------------------------------------------------------------------
    public void test_print_emptyCalendrical() throws Exception {
        buf.append("EXISTING");
        CharLiteralPrinterParser pp = new CharLiteralPrinterParser('a');
        pp.print(printEmptyContext, buf);
        assertEquals(buf.toString(), "EXISTINGa");
    }
View Full Code Here

TOP

Related Classes of org.threeten.bp.format.DateTimeFormatterBuilder.CharLiteralPrinterParser

Copyright © 2018 www.massapicom. 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.