Search in sources :

Example 1 with TimePosition

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())));
}
Also used : TimePosition(org.n52.shetland.ogc.gml.time.TimePosition) Test(org.junit.Test)

Example 2 with TimePosition

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));
}
Also used : TimePosition(org.n52.shetland.ogc.gml.time.TimePosition) Test(org.junit.Test)

Example 3 with TimePosition

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));
}
Also used : TimePosition(org.n52.shetland.ogc.gml.time.TimePosition) Test(org.junit.Test)

Example 4 with TimePosition

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();
}
Also used : TimePosition(org.n52.shetland.ogc.gml.time.TimePosition) Test(org.junit.Test)

Example 5 with TimePosition

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));
}
Also used : TimePosition(org.n52.shetland.ogc.gml.time.TimePosition) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)8 TimePosition (org.n52.shetland.ogc.gml.time.TimePosition)8