Package org.apache.isis.applib.value

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


    }

    @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

        return time;
    }

    @Override
    protected Date dateValue(final Object object) {
        final Time time = (Time) object;
        return time == null ? null : time.asJavaDate();
    }
View Full Code Here

        return time == null ? null : time.asJavaDate();
    }

    @Override
    protected Time now() {
        return new Time();
    }
View Full Code Here

        return new Time();
    }

    @Override
    protected Time setDate(final Date date) {
        return new Time(date.getTime());
    }
View Full Code Here

            }
        });

        TestClock.initialize();
        setupSpecification(Time.class);
        time = new Time(8, 13);
        holder = new FacetHolderImpl();
        setValue(adapter = new TimeValueSemanticsProvider(holder, mockConfiguration, mockContext));
    }
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.