Examples of FractionPrinterParser


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

        return value;
    }

    @Test(dataProvider="Seconds")
    public void test_reverseParse_seconds(int minWidth, int maxWidth, int value, String result) throws Exception {
        FractionPrinterParser pp = new FractionPrinterParser(SECOND_OF_MINUTE, minWidth, maxWidth, true);
        int newPos = pp.parse(parseContext, result, 0);
        assertEquals(newPos, result.length());
        assertParsed(parseContext, SECOND_OF_MINUTE, value == 0 && minWidth == 0 ? null : (long) value);
    }
View Full Code Here

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

    //-----------------------------------------------------------------------
    @DataProvider(name="ParseNothing")
    Object[][] provider_parseNothing() {
        return new Object[][] {
            {new FractionPrinterParser(NANO_OF_SECOND, 3, 6, true), "", 0, ~0},
            {new FractionPrinterParser(NANO_OF_SECOND, 3, 6, true), "A", 0, ~0},
            {new FractionPrinterParser(NANO_OF_SECOND, 3, 6, true), ".", 0, ~1},
            {new FractionPrinterParser(NANO_OF_SECOND, 3, 6, true), ".5", 0, ~1},
            {new FractionPrinterParser(NANO_OF_SECOND, 3, 6, true), ".51", 0, ~1},
            {new FractionPrinterParser(NANO_OF_SECOND, 3, 6, true), ".A23456", 0, ~1},
            {new FractionPrinterParser(NANO_OF_SECOND, 3, 6, true), ".1A3456", 0, ~1},
        };
    }
View Full Code Here

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

        assertEquals(parseContext.getParsed(NANO_OF_SECOND), null);
    }

    //-----------------------------------------------------------------------
    public void test_toString() throws Exception {
        FractionPrinterParser pp = new FractionPrinterParser(NANO_OF_SECOND, 3, 6, true);
        assertEquals(pp.toString(), "Fraction(NanoOfSecond,3,6,DecimalPoint)");
    }
View Full Code Here

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

        FractionPrinterParser pp = new FractionPrinterParser(NANO_OF_SECOND, 3, 6, true);
        assertEquals(pp.toString(), "Fraction(NanoOfSecond,3,6,DecimalPoint)");
    }

    public void test_toString_noDecimalPoint() throws Exception {
        FractionPrinterParser pp = new FractionPrinterParser(NANO_OF_SECOND, 3, 6, false);
        assertEquals(pp.toString(), "Fraction(NanoOfSecond,3,6)");
    }
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.