Package org.threeten.bp.temporal

Examples of org.threeten.bp.temporal.MockFieldValue


       };
    }

    @Test(dataProvider="Nanos")
    public void test_print_nanos(int minWidth, int maxWidth, int value, String result) throws Exception {
        printContext.setDateTime(new MockFieldValue(NANO_OF_SECOND, value));
        FractionPrinterParser pp = new FractionPrinterParser(NANO_OF_SECOND, minWidth, maxWidth, true);
        pp.print(printContext, buf);
        if (result == null) {
            fail("Expected exception");
        }
View Full Code Here


        assertEquals(buf.toString(), result);
    }

    @Test(dataProvider="Nanos")
    public void test_print_nanos_noDecimalPoint(int minWidth, int maxWidth, int value, String result) throws Exception {
        printContext.setDateTime(new MockFieldValue(NANO_OF_SECOND, value));
        FractionPrinterParser pp = new FractionPrinterParser(NANO_OF_SECOND, minWidth, maxWidth, false);
        pp.print(printContext, buf);
        if (result == null) {
            fail("Expected exception");
        }
View Full Code Here

        };
    }

    @Test(dataProvider="Seconds")
    public void test_print_seconds(int minWidth, int maxWidth, int value, String result) throws Exception {
        printContext.setDateTime(new MockFieldValue(SECOND_OF_MINUTE, value));
        FractionPrinterParser pp = new FractionPrinterParser(SECOND_OF_MINUTE, minWidth, maxWidth, true);
        pp.print(printContext, buf);
        if (result == null) {
            fail("Expected exception");
        }
View Full Code Here

        assertEquals(buf.toString(), result);
    }

    @Test(dataProvider="Seconds")
    public void test_print_seconds_noDecimalPoint(int minWidth, int maxWidth, int value, String result) throws Exception {
        printContext.setDateTime(new MockFieldValue(SECOND_OF_MINUTE, value));
        FractionPrinterParser pp = new FractionPrinterParser(SECOND_OF_MINUTE, minWidth, maxWidth, false);
        pp.print(printContext, buf);
        if (result == null) {
            fail("Expected exception");
        }
View Full Code Here

       };
    }

    @Test(dataProvider="Pivot")
    public void test_pivot(int width, int baseValue, int value, String result) throws Exception {
        printContext.setDateTime(new MockFieldValue(YEAR, value));
        ReducedPrinterParser pp = new ReducedPrinterParser(YEAR, width, width, baseValue, null);
        try {
            pp.print(printContext, buf);
            if (result == null) {
                fail("Expected exception");
View Full Code Here

       };
    }

    @Test(dataProvider="Pad")
    public void test_pad_NOT_NEGATIVE(int minPad, int maxPad, long value, String result) throws Exception {
        printContext.setDateTime(new MockFieldValue(DAY_OF_MONTH, value));
        NumberPrinterParser pp = new NumberPrinterParser(DAY_OF_MONTH, minPad, maxPad, SignStyle.NOT_NEGATIVE);
        try {
            pp.print(printContext, buf);
            if (result == null || value < 0) {
                fail("Expected exception");
View Full Code Here

        }
    }

    @Test(dataProvider="Pad")
    public void test_pad_NEVER(int minPad, int maxPad, long value, String result) throws Exception {
        printContext.setDateTime(new MockFieldValue(DAY_OF_MONTH, value));
        NumberPrinterParser pp = new NumberPrinterParser(DAY_OF_MONTH, minPad, maxPad, SignStyle.NEVER);
        try {
            pp.print(printContext, buf);
            if (result == null) {
                fail("Expected exception");
View Full Code Here

        }
    }

    @Test(dataProvider="Pad")
    public void test_pad_NORMAL(int minPad, int maxPad, long value, String result) throws Exception {
        printContext.setDateTime(new MockFieldValue(DAY_OF_MONTH, value));
        NumberPrinterParser pp = new NumberPrinterParser(DAY_OF_MONTH, minPad, maxPad, SignStyle.NORMAL);
        try {
            pp.print(printContext, buf);
            if (result == null) {
                fail("Expected exception");
View Full Code Here

        }
    }

    @Test(dataProvider="Pad")
    public void test_pad_ALWAYS(int minPad, int maxPad, long value, String result) throws Exception {
        printContext.setDateTime(new MockFieldValue(DAY_OF_MONTH, value));
        NumberPrinterParser pp = new NumberPrinterParser(DAY_OF_MONTH, minPad, maxPad, SignStyle.ALWAYS);
        try {
            pp.print(printContext, buf);
            if (result == null) {
                fail("Expected exception");
View Full Code Here

        }
    }

    @Test(dataProvider="Pad")
    public void test_pad_EXCEEDS_PAD(int minPad, int maxPad, long value, String result) throws Exception {
        printContext.setDateTime(new MockFieldValue(DAY_OF_MONTH, value));
        NumberPrinterParser pp = new NumberPrinterParser(DAY_OF_MONTH, minPad, maxPad, SignStyle.EXCEEDS_PAD);
        try {
            pp.print(printContext, buf);
            if (result == null) {
                fail("Expected exception");
View Full Code Here

TOP

Related Classes of org.threeten.bp.temporal.MockFieldValue

Copyright © 2018 www.massapicom. 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.