use of java.time.temporal.TemporalAccessor in project jdk8u_jdk by JetBrains.
the class TestZoneOffsetParser method test_parse_midStringMatch.
@Test(dataProvider = "offsets")
public void test_parse_midStringMatch(String pattern, String parse, ZoneOffset expected) throws Exception {
ParsePosition pos = new ParsePosition(5);
TemporalAccessor parsed = getFormatter(pattern, "Z").parseUnresolved("OTHER" + parse + ":OTHER", pos);
assertEquals(pos.getIndex(), parse.length() + 5);
assertParsed(parsed, expected);
}
use of java.time.temporal.TemporalAccessor in project jdk8u_jdk by JetBrains.
the class TestZoneOffsetParser method test_parse_startStringMatch_UTC.
public void test_parse_startStringMatch_UTC() throws Exception {
ParsePosition pos = new ParsePosition(0);
TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("ZOTHER", pos);
assertEquals(pos.getIndex(), 1);
assertParsed(parsed, ZoneOffset.UTC);
}
use of java.time.temporal.TemporalAccessor in project jdk8u_jdk by JetBrains.
the class TestZoneOffsetParser method test_parse_midStringMatch_EmptyUTC.
@Test(dataProvider = "offsets")
public void test_parse_midStringMatch_EmptyUTC(String pattern, String parse, ZoneOffset expected) throws Exception {
ParsePosition pos = new ParsePosition(5);
TemporalAccessor parsed = getFormatter(pattern, "").parseUnresolved("OTHER" + parse + ":OTHER", pos);
assertEquals(pos.getIndex(), parse.length() + 5);
assertParsed(parsed, expected);
}
use of java.time.temporal.TemporalAccessor in project jdk8u_jdk by JetBrains.
the class TestZoneOffsetParser method test_parse_exactMatch_UTC_EmptyUTC.
//-----------------------------------------------------------------------
public void test_parse_exactMatch_UTC_EmptyUTC() throws Exception {
ParsePosition pos = new ParsePosition(0);
TemporalAccessor parsed = getFormatter("+HH:MM:ss", "").parseUnresolved("", pos);
assertEquals(pos.getIndex(), 0);
assertParsed(parsed, ZoneOffset.UTC);
}
use of java.time.temporal.TemporalAccessor in project jdk8u_jdk by JetBrains.
the class TestZoneOffsetParser method test_parse_startStringMatch.
@Test(dataProvider = "offsets")
public void test_parse_startStringMatch(String pattern, String parse, ZoneOffset expected) throws Exception {
ParsePosition pos = new ParsePosition(0);
TemporalAccessor parsed = getFormatter(pattern, "Z").parseUnresolved(parse + ":OTHER", pos);
assertEquals(pos.getIndex(), parse.length());
assertParsed(parsed, expected);
}
Aggregations