Examples of ZoneIdPrinterParser


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

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

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

        }
    }

    //-----------------------------------------------------------------------
    public void test_parse_exactMatch_Denver() throws Exception {
        ZoneIdPrinterParser pp = new ZoneIdPrinterParser(TemporalQueries.zoneId(), null);
        int result = pp.parse(parseContext, AMERICA_DENVER, 0);
        assertEquals(result, AMERICA_DENVER.length());
        assertParsed(TIME_ZONE_DENVER);
    }
View Full Code Here

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

        assertEquals(result, AMERICA_DENVER.length());
        assertParsed(TIME_ZONE_DENVER);
    }

    public void test_parse_startStringMatch_Denver() throws Exception {
        ZoneIdPrinterParser pp = new ZoneIdPrinterParser(TemporalQueries.zoneId(), null);
        int result = pp.parse(parseContext, AMERICA_DENVER + "OTHER", 0);
        assertEquals(result, AMERICA_DENVER.length());
        assertParsed(TIME_ZONE_DENVER);
    }
View Full Code Here

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

        assertEquals(result, AMERICA_DENVER.length());
        assertParsed(TIME_ZONE_DENVER);
    }

    public void test_parse_midStringMatch_Denver() throws Exception {
        ZoneIdPrinterParser pp = new ZoneIdPrinterParser(TemporalQueries.zoneId(), null);
        int result = pp.parse(parseContext, "OTHER" + AMERICA_DENVER + "OTHER", 5);
        assertEquals(result, 5 + AMERICA_DENVER.length());
        assertParsed(TIME_ZONE_DENVER);
    }
View Full Code Here

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

        assertEquals(result, 5 + AMERICA_DENVER.length());
        assertParsed(TIME_ZONE_DENVER);
    }

    public void test_parse_endStringMatch_Denver() throws Exception {
        ZoneIdPrinterParser pp = new ZoneIdPrinterParser(TemporalQueries.zoneId(), null);
        int result = pp.parse(parseContext, "OTHER" + AMERICA_DENVER, 5);
        assertEquals(result, 5+ AMERICA_DENVER.length());
        assertParsed(TIME_ZONE_DENVER);
    }
View Full Code Here

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

        assertEquals(result, 5+ AMERICA_DENVER.length());
        assertParsed(TIME_ZONE_DENVER);
    }

    public void test_parse_partialMatch() throws Exception {
        ZoneIdPrinterParser pp = new ZoneIdPrinterParser(TemporalQueries.zoneId(), null);
        int result = pp.parse(parseContext, "OTHERAmerica/Bogusville", 5);
        assertEquals(result, -6);
        assertParsed(null);
    }
View Full Code Here

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

        return rtnval;
    }

    @Test(dataProvider="zones")
    public void test_parse_exactMatch(String parse, ZoneId expected) throws Exception {
        ZoneIdPrinterParser pp = new ZoneIdPrinterParser(TemporalQueries.zoneId(), null);
        int result = pp.parse(parseContext, parse, 0);
        assertEquals(result, parse.length());
        assertParsed(expected);
    }
View Full Code Here

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

        assertParsed(expected);
    }

    @Test
    public void test_parse_lowerCase() throws Exception {
        ZoneIdPrinterParser pp = new ZoneIdPrinterParser(TemporalQueries.zoneId(), null);
        parseContext.setCaseSensitive(false);
        int result = pp.parse(parseContext, "europe/london", 0);
        assertEquals(result, 13);
        assertParsed(ZoneId.of("Europe/London"));
    }
View Full Code Here

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

        assertParsed(ZoneId.of("Europe/London"));
    }

    //-----------------------------------------------------------------------
    public void test_parse_endStringMatch_utc() throws Exception {
        ZoneIdPrinterParser pp = new ZoneIdPrinterParser(TemporalQueries.zoneId(), null);
        int result = pp.parse(parseContext, "OTHERZ", 5);
        assertEquals(result, 6);
        assertParsed(ZoneOffset.UTC);
    }
View Full Code Here

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

        assertEquals(result, 6);
        assertParsed(ZoneOffset.UTC);
    }

    public void test_parse_endStringMatch_utc_plus1() throws Exception {
        ZoneIdPrinterParser pp = new ZoneIdPrinterParser(TemporalQueries.zoneId(), null);
        int result = pp.parse(parseContext, "OTHER+01:00", 5);
        assertEquals(result, 11);
        assertParsed(ZoneId.of("+01:00"));
    }
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.