Package org.threeten.bp.format.DateTimeFormatterBuilder

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


        assertEquals(buf.toString(), "EXISTINGa");
    }

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


        pp.print(printContext, buf);
        assertEquals(buf.toString(), "EXISTINGa");
    }

    public void test_print_emptyAppendable() throws Exception {
        CharLiteralPrinterParser pp = new CharLiteralPrinterParser('a');
        pp.print(printContext, buf);
        assertEquals(buf.toString(), "a");
    }
View Full Code Here

        assertEquals(buf.toString(), "a");
    }

    //-----------------------------------------------------------------------
    public void test_toString() throws Exception {
        CharLiteralPrinterParser pp = new CharLiteralPrinterParser('a');
        assertEquals(pp.toString(), "'a'");
    }
View Full Code Here

        assertEquals(pp.toString(), "'a'");
    }

    //-----------------------------------------------------------------------
    public void test_toString_apos() throws Exception {
        CharLiteralPrinterParser pp = new CharLiteralPrinterParser('\'');
        assertEquals(pp.toString(), "''");
    }
View Full Code Here

    @DataProvider(name="success")
    Object[][] data_success() {
        return new Object[][] {
            // match
            {new CharLiteralPrinterParser('a'), true, "a", 0, 1},
            {new CharLiteralPrinterParser('a'), true, "aOTHER", 0, 1},
            {new CharLiteralPrinterParser('a'), true, "OTHERaOTHER", 5, 6},
            {new CharLiteralPrinterParser('a'), true, "OTHERa", 5, 6},

            // no match
            {new CharLiteralPrinterParser('a'), true, "", 0, ~0},
            {new CharLiteralPrinterParser('a'), true, "a", 1, ~1},
            {new CharLiteralPrinterParser('a'), true, "A", 0, ~0},
            {new CharLiteralPrinterParser('a'), true, "b", 0, ~0},
            {new CharLiteralPrinterParser('a'), true, "OTHERbOTHER", 5, ~5},
            {new CharLiteralPrinterParser('a'), true, "OTHERb", 5, ~5},

            // case insensitive
            {new CharLiteralPrinterParser('a'), false, "a", 0, 1},
            {new CharLiteralPrinterParser('a'), false, "A", 0, 1},
        };
    }
View Full Code Here

    //-----------------------------------------------------------------------
    @DataProvider(name="error")
    Object[][] data_error() {
        return new Object[][] {
            {new CharLiteralPrinterParser('a'), "a", -1, IndexOutOfBoundsException.class},
            {new CharLiteralPrinterParser('a'), "a", 2, IndexOutOfBoundsException.class},
        };
    }
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.