Examples of OffsetIdPrinterParser


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

        assertParsed(expected);
    }

    @Test(dataProvider="offsets")
    public void test_parse_startStringMatch(String pattern, String parse, ZoneOffset expected) throws Exception {
        OffsetIdPrinterParser pp = new OffsetIdPrinterParser("Z", pattern);
        int result = pp.parse(parseContext, parse + ":OTHER", 0);
        assertEquals(result, parse.length());
        assertParsed(expected);
    }
View Full Code Here

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

        assertParsed(expected);
    }

    @Test(dataProvider="offsets")
    public void test_parse_midStringMatch(String pattern, String parse, ZoneOffset expected) throws Exception {
        OffsetIdPrinterParser pp = new OffsetIdPrinterParser("Z", pattern);
        int result = pp.parse(parseContext, "OTHER" + parse + ":OTHER", 5);
        assertEquals(result, parse.length() + 5);
        assertParsed(expected);
    }
View Full Code Here

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

        assertParsed(expected);
    }

    @Test(dataProvider="offsets")
    public void test_parse_endStringMatch(String pattern, String parse, ZoneOffset expected) throws Exception {
        OffsetIdPrinterParser pp = new OffsetIdPrinterParser("Z", pattern);
        int result = pp.parse(parseContext, "OTHER" + parse, 5);
        assertEquals(result, parse.length() + 5);
        assertParsed(expected);
    }
View Full Code Here

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

        assertParsed(expected);
    }

    @Test(dataProvider="offsets")
    public void test_parse_exactMatch_EmptyUTC(String pattern, String parse, ZoneOffset expected) throws Exception {
        OffsetIdPrinterParser pp = new OffsetIdPrinterParser("", pattern);
        int result = pp.parse(parseContext, parse, 0);
        assertEquals(result, parse.length());
        assertParsed(expected);
    }
View Full Code Here

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

        assertParsed(expected);
    }

    @Test(dataProvider="offsets")
    public void test_parse_startStringMatch_EmptyUTC(String pattern, String parse, ZoneOffset expected) throws Exception {
        OffsetIdPrinterParser pp = new OffsetIdPrinterParser("", pattern);
        int result = pp.parse(parseContext, parse + ":OTHER", 0);
        assertEquals(result, parse.length());
        assertParsed(expected);
    }
View Full Code Here

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

        assertParsed(expected);
    }

    @Test(dataProvider="offsets")
    public void test_parse_midStringMatch_EmptyUTC(String pattern, String parse, ZoneOffset expected) throws Exception {
        OffsetIdPrinterParser pp = new OffsetIdPrinterParser("", pattern);
        int result = pp.parse(parseContext, "OTHER" + parse + ":OTHER", 5);
        assertEquals(result, parse.length() + 5);
        assertParsed(expected);
    }
View Full Code Here

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

        assertParsed(expected);
    }

    @Test(dataProvider="offsets")
    public void test_parse_endStringMatch_EmptyUTC(String pattern, String parse, ZoneOffset expected) throws Exception {
        OffsetIdPrinterParser pp = new OffsetIdPrinterParser("", pattern);
        int result = pp.parse(parseContext, "OTHER" + parse, 5);
        assertEquals(result, parse.length() + 5);
        assertParsed(expected);
    }
View Full Code Here

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

        };
    }

    @Test(dataProvider="bigOffsets")
    public void test_parse_bigOffsets(String pattern, String parse, long offsetSecs) throws Exception {
        OffsetIdPrinterParser pp = new OffsetIdPrinterParser("Z", pattern);
        int result = pp.parse(parseContext, parse, 0);
        assertEquals(result, parse.length());
        assertEquals(parseContext.getParsed(OFFSET_SECONDS), (Long) offsetSecs);
    }
View Full Code Here

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

        };
    }

    @Test(dataProvider="badOffsets")
    public void test_parse_invalid(String pattern, String parse, int expectedPosition) throws Exception {
        OffsetIdPrinterParser pp = new OffsetIdPrinterParser("Z", pattern);
        int result = pp.parse(parseContext, parse, 0);
        assertEquals(result, expectedPosition);
    }
View Full Code Here

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

    //-----------------------------------------------------------------------
    //-----------------------------------------------------------------------
    //-----------------------------------------------------------------------
    public void test_parse_caseSensitiveUTC_matchedCase() throws Exception {
        parseContext.setCaseSensitive(true);
        OffsetIdPrinterParser pp = new OffsetIdPrinterParser("Z", "+HH:MM:ss");
        int result = pp.parse(parseContext, "Z", 0);
        assertEquals(result, 1);
        assertParsed(ZoneOffset.UTC);
    }
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.