use of org.n52.shetland.ogc.gml.time.TimePosition in project arctic-sea by 52North.
the class TimeTest method missingFormat.
@Test
public void missingFormat() {
TimePosition timePosition = new TimePosition(DateTime.now(), null);
TimePosition timePositionWithDefaultFormat = new TimePosition(DateTime.now());
assertThat("provided nullable time format will return default time format", timePosition.getTimeFormat(), is(equalTo(timePositionWithDefaultFormat.getTimeFormat())));
}
use of org.n52.shetland.ogc.gml.time.TimePosition in project arctic-sea by 52North.
the class TimeTest method inteterminate.
@Test
public void inteterminate() {
TimePosition timePosition = new TimePosition(IndeterminateValue.NOW);
assertThat("time position is not set", timePosition.isSetTime(), is(false));
assertThat("indeterminate value is set", timePosition.isSetIndeterminateValue(), is(true));
assertThat("indeterminate value is 'now'", timePosition.getIndeterminateValue(), is(IndeterminateValue.NOW));
assertThat("format is not set", timePosition.isSetTimeFormat(), is(false));
}
use of org.n52.shetland.ogc.gml.time.TimePosition in project arctic-sea by 52North.
the class TimeTest method defaultFormat.
@Test
public void defaultFormat() {
TimePosition timePosition = new TimePosition(DateTime.now());
assertThat("format is set to default", timePosition.getTimeFormat(), is(Time.TimeFormat.ISO8601));
}
use of org.n52.shetland.ogc.gml.time.TimePosition in project arctic-sea by 52North.
the class TimeTest method missingTime.
@Test(expected = NoSuchElementException.class)
public void missingTime() {
TimePosition timePosition = new TimePosition(IndeterminateValue.UNKNOWN);
timePosition.getTime();
}
use of org.n52.shetland.ogc.gml.time.TimePosition in project arctic-sea by 52North.
the class TimeTest method nullFormat.
@Test
public void nullFormat() {
TimePosition timePosition = new TimePosition(DateTime.now(), null);
assertThat("time position is set", timePosition.isSetTime(), is(true));
assertThat("time format is set", timePosition.isSetTimeFormat(), is(false));
}
Aggregations