Package org.apache.isis.applib.value

Examples of org.apache.isis.applib.value.Time


                will(returnValue(null));
            }
        });

        TestClock.initialize();
        time = new Time(8, 13);
        holder = new FacetHolderImpl();
        setValue(adapter = new TimeValueSemanticsProvider(holder, mockConfiguration, mockContext));
    }
View Full Code Here


    }

    @Test
    public void testParseEntryOfHoursMinutesText() throws Exception {
        final Object parsed = adapter.parseTextEntry(null, "8:30", null);
        assertEquals(new Time(8, 30), parsed);
    }
View Full Code Here

    @Test
    @Ignore
    public void testParseEntryOfHoursMinutesSecondsText() throws Exception {
        final Object parsed = adapter.parseTextEntry(null, "8:30:45", null);
        // I can't get the text parser to parse HH:mm:ss before HH:mm!!
        final Time expected = new Time(8, 30, 45);
        assertEquals(expected, parsed);
    }
View Full Code Here

    }

    @Test
    public void testParseEntryOfHoursAfterTime() throws Exception {
        final Object parsed = adapter.parseTextEntry(time, "+5H", null);
        assertEquals(new Time(13, 13), parsed);
    }
View Full Code Here

    }

    @Test
    public void testParseEntryOfHoursAfterNow() throws Exception {
        final Object parsed = adapter.parseTextEntry(null, "+5H", null);
        assertEquals(new Time(2, 30, 25), parsed);
    }
View Full Code Here

    }

    @Test
    public void testParseEntryOfHoursBeforeTime() throws Exception {
        final Object parsed = adapter.parseTextEntry(time, "-7H", null);
        assertEquals(new Time(1, 13), parsed);
    }
View Full Code Here

    }

    @Test
    public void testParseEntryOfHoursBeforeToNow() throws Exception {
        final Object parsed = adapter.parseTextEntry(null, "-5H", null);
        assertEquals(new Time(16, 30, 25), parsed);
    }
View Full Code Here

    }

    @Test
    public void testParseEntryOfKeywordNow() throws Exception {
        final Object parsed = adapter.parseTextEntry(time, "now", null);
        assertEquals(new Time(), parsed);
    }
View Full Code Here

        assertEquals(new Time(), parsed);
    }

    @Test
    public void testRestoreTime() throws Exception {
        final Time expected = new Time(21, 30);
        final Object parsed = adapter.fromEncodedString("213000000");
        assertEquals(expected, parsed);
    }
View Full Code Here

        return true;
    }

    @Override
    protected Time add(final Time original, final int years, final int months, final int days, final int hours, final int minutes) {
        Time time = original;
        time = time.add(hours, minutes);
        return time;
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.applib.value.Time

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.