Package org.joda.time

Examples of org.joda.time.LocalDate.toDateTimeAtStartOfDay()


    @Test
    public void canDeserializeLocalDate() {
        LocalDate localDate = new LocalDate();

        Object value = converter.fromDbValue(localDate.toDateTimeAtStartOfDay().getMillis());

        assertThat(value, notNullValue());
        assertThat((LocalDate) value, is(localDate));
    }
View Full Code Here


        fakeEntity.setDateOfDay(now);
        BasicDBObject basicDBObject = new BasicDBObject();

        mapper.save(fakeEntity, basicDBObject);

        assertThat(basicDBObject.get("dateOfDay"), is((Object) now.toDateTimeAtStartOfDay().getMillis()));
    }

    @Test
    public void canPopulateLocalDateType() throws NoSuchMethodException {
        BasicDBObject object = new BasicDBObject();
View Full Code Here

    @Test
    public void canPopulateLocalDateType() throws NoSuchMethodException {
        BasicDBObject object = new BasicDBObject();
        LocalDate localDate = new LocalDate();
        object.put("dateOfDay", localDate.toDateTimeAtStartOfDay().getMillis());
        PropertyMapper propertyMapper = propertyMapperForLocalDate();
        FakeEntity instance = new FakeEntity();

        propertyMapper.populate(instance, object);
View Full Code Here

    @Test
    public void testLocalDateConverter() throws ConverterException {
        LocalDate lc = LocalDate.now();

        DATE oracleDate = new DATE(new java.sql.Date(lc.toDateTimeAtStartOfDay().getMillis()));

        LocalDate convertedDate = Convert.getConverterIfExists(LocalDate.class).convert(oracleDate);

        assertEquals(lc, convertedDate);
    }
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.