use of com.yahoo.elide.datastores.aggregation.timegrains.Time in project elide by yahoo.
the class TimeSerdeTest method testTimeDeserializeDate.
@Test
public void testTimeDeserializeDate() {
LocalDateTime localDate = LocalDateTime.of(2020, java.time.Month.of(01), 01, 00, 00, 00);
Time expectedDate = new Time(localDate, true, true, true, false, false, false, (unused) -> "");
Serde serde = new Time.TimeSerde();
Object actualDate = serde.deserialize(DATE);
assertEquals(expectedDate, actualDate);
assertEquals(DATE, serde.serialize(actualDate));
}
use of com.yahoo.elide.datastores.aggregation.timegrains.Time in project elide by yahoo.
the class TimeSerdeTest method testTimeDeserializeSecond.
@Test
public void testTimeDeserializeSecond() {
LocalDateTime localDate = LocalDateTime.of(2020, java.time.Month.of(01), 01, 00, 00, 00);
Time expectedDate = new Time(localDate, true, true, true, true, true, true, (unused) -> "");
Serde serde = new Time.TimeSerde();
Object actualDate = serde.deserialize(SECOND);
assertEquals(expectedDate, actualDate);
assertEquals(SECOND, serde.serialize(actualDate));
}
use of com.yahoo.elide.datastores.aggregation.timegrains.Time in project elide by yahoo.
the class TimeSerdeTest method testTimeDeserializeHour.
@Test
public void testTimeDeserializeHour() {
LocalDateTime localDate = LocalDateTime.of(2020, java.time.Month.of(01), 01, 00, 00, 00);
Time expectedDate = new Time(localDate, true, true, true, true, true, true, (unused) -> "");
Serde serde = new Time.TimeSerde();
Object actualDate = serde.deserialize(HOUR);
assertEquals(expectedDate, actualDate);
assertEquals(HOUR, serde.serialize(actualDate));
}
use of com.yahoo.elide.datastores.aggregation.timegrains.Time in project elide by yahoo.
the class TimeSerdeTest method testTimeDeserializeMinute.
@Test
public void testTimeDeserializeMinute() {
LocalDateTime localDate = LocalDateTime.of(2020, java.time.Month.of(01), 01, 00, 00, 00);
Time expectedDate = new Time(localDate, true, true, true, true, true, true, (unused) -> "");
Serde serde = new Time.TimeSerde();
Object actualDate = serde.deserialize(MINUTE);
assertEquals(expectedDate, actualDate);
assertEquals(MINUTE, serde.serialize(actualDate));
}
use of com.yahoo.elide.datastores.aggregation.timegrains.Time in project elide by yahoo.
the class TimeSerdeTest method testTimeDeserializeMonth.
@Test
public void testTimeDeserializeMonth() {
LocalDateTime localDate = LocalDateTime.of(2020, java.time.Month.of(01), 01, 00, 00, 00);
Time expectedDate = new Time(localDate, true, true, false, false, false, false, (unused) -> "");
Serde serde = new Time.TimeSerde();
Object actualDate = serde.deserialize(MONTH);
assertEquals(expectedDate, actualDate);
assertEquals(MONTH, serde.serialize(actualDate));
}
Aggregations