Examples of StringLiteralPrinterParser


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

        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.StringLiteralPrinterParser

        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.StringLiteralPrinterParser

        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.StringLiteralPrinterParser

    @DataProvider(name="success")
    Object[][] data_success() {
        return new Object[][] {
            // match
            {new StringLiteralPrinterParser("hello"), true, "hello", 0, 5},
            {new StringLiteralPrinterParser("hello"), true, "helloOTHER", 0, 5},
            {new StringLiteralPrinterParser("hello"), true, "OTHERhelloOTHER", 5, 10},
            {new StringLiteralPrinterParser("hello"), true, "OTHERhello", 5, 10},

            // no match
            {new StringLiteralPrinterParser("hello"), true, "", 0, ~0},
            {new StringLiteralPrinterParser("hello"), true, "a", 1, ~1},
            {new StringLiteralPrinterParser("hello"), true, "HELLO", 0, ~0},
            {new StringLiteralPrinterParser("hello"), true, "hlloo", 0, ~0},
            {new StringLiteralPrinterParser("hello"), true, "OTHERhllooOTHER", 5, ~5},
            {new StringLiteralPrinterParser("hello"), true, "OTHERhlloo", 5, ~5},
            {new StringLiteralPrinterParser("hello"), true, "h", 0, ~0},
            {new StringLiteralPrinterParser("hello"), true, "OTHERh", 5, ~5},

            // case insensitive
            {new StringLiteralPrinterParser("hello"), false, "hello", 0, 5},
            {new StringLiteralPrinterParser("hello"), false, "HELLO", 0, 5},
            {new StringLiteralPrinterParser("hello"), false, "HelLo", 0, 5},
            {new StringLiteralPrinterParser("hello"), false, "HelLO", 0, 5},
        };
    }
View Full Code Here

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

    //-----------------------------------------------------------------------
    @DataProvider(name="error")
    Object[][] data_error() {
        return new Object[][] {
            {new StringLiteralPrinterParser("hello"), "hello", -1, IndexOutOfBoundsException.class},
            {new StringLiteralPrinterParser("hello"), "hello", 6, IndexOutOfBoundsException.class},
        };
    }
View Full Code Here

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

public class TestStringLiteralPrinter extends AbstractTestPrinterParser {

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

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

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

    public void test_print_dateTime() throws Exception {
        buf.append("EXISTING");
        StringLiteralPrinterParser pp = new StringLiteralPrinterParser("hello");
        pp.print(printContext, buf);
        assertEquals(buf.toString(), "EXISTINGhello");
    }
View Full Code Here

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

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

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

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

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

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

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

        StringLiteralPrinterParser pp = new StringLiteralPrinterParser("hello");
        assertEquals(pp.toString(), "'hello'");
    }

    public void test_toString_apos() throws Exception {
        StringLiteralPrinterParser pp = new StringLiteralPrinterParser("o'clock");
        assertEquals(pp.toString(), "'o''clock'");
    }
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.