Search in sources :

Example 11 with QuantityDataEntity

use of org.n52.series.db.beans.QuantityDataEntity in project SOS by 52North.

the class AbstractObservationDAOTest method add_resultTime_from_phenomenonTime_timeIndeterminatePosition_now.

@Test
public void add_resultTime_from_phenomenonTime_timeIndeterminatePosition_now() throws CodedException {
    DataEntity<?> observation = new QuantityDataEntity();
    TimeInstant resultTime = new TimeInstant();
    resultTime.setGmlId(PHENOMENON_TIME);
    TimeInstant phenomeonTime = new TimeInstant(IndeterminateValue.NOW);
    dao.addResultTimeToObservation(observation, resultTime, phenomeonTime);
    Assert.assertTrue(observation.getResultTime() != null);
}
Also used : QuantityDataEntity(org.n52.series.db.beans.QuantityDataEntity) TimeInstant(org.n52.shetland.ogc.gml.time.TimeInstant) Test(org.junit.Test)

Example 12 with QuantityDataEntity

use of org.n52.series.db.beans.QuantityDataEntity in project SOS by 52North.

the class AbstractObservationDAOTest method add_resultTime_timeIndeterminatePosition_now.

@Test
public void add_resultTime_timeIndeterminatePosition_now() throws CodedException {
    DataEntity<?> observation = new QuantityDataEntity();
    TimeInstant resultTime = new TimeInstant(IndeterminateValue.NOW);
    dao.addResultTimeToObservation(observation, resultTime, null);
    Assert.assertTrue(observation.getResultTime() != null);
}
Also used : QuantityDataEntity(org.n52.series.db.beans.QuantityDataEntity) TimeInstant(org.n52.shetland.ogc.gml.time.TimeInstant) Test(org.junit.Test)

Example 13 with QuantityDataEntity

use of org.n52.series.db.beans.QuantityDataEntity in project SOS by 52North.

the class AbstractObservationDAOTest method add_resultTime_value_from_phenomenonTime.

@Test
public void add_resultTime_value_from_phenomenonTime() throws CodedException {
    DataEntity<?> observation = new QuantityDataEntity();
    TimeInstant resultTime = new TimeInstant();
    resultTime.setGmlId(PHENOMENON_TIME);
    TimeInstant phenomeonTime = new TimeInstant(new DateTime());
    dao.addResultTimeToObservation(observation, resultTime, phenomeonTime);
    Assert.assertTrue(observation.getResultTime() != null);
}
Also used : QuantityDataEntity(org.n52.series.db.beans.QuantityDataEntity) TimeInstant(org.n52.shetland.ogc.gml.time.TimeInstant) DateTime(org.joda.time.DateTime) Test(org.junit.Test)

Example 14 with QuantityDataEntity

use of org.n52.series.db.beans.QuantityDataEntity in project SOS by 52North.

the class AbstractObservationDAOTest method add_phenomenonTime_instant_timeIndeterminatePosition_now.

@Test
public void add_phenomenonTime_instant_timeIndeterminatePosition_now() throws OwsExceptionReport {
    DataEntity<?> observation = new QuantityDataEntity();
    TimeInstant phenomenonTime = new TimeInstant(IndeterminateValue.NOW);
    dao.addPhenomenonTimeToObservation(observation, phenomenonTime);
    Assert.assertTrue(observation.getSamplingTimeStart() != null);
    Assert.assertTrue(observation.getSamplingTimeEnd() != null);
}
Also used : QuantityDataEntity(org.n52.series.db.beans.QuantityDataEntity) TimeInstant(org.n52.shetland.ogc.gml.time.TimeInstant) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)13 QuantityDataEntity (org.n52.series.db.beans.QuantityDataEntity)13 TimeInstant (org.n52.shetland.ogc.gml.time.TimeInstant)12 DateTime (org.joda.time.DateTime)3 DatasetEntity (org.n52.series.db.beans.DatasetEntity)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 Set (java.util.Set)1 Session (org.hibernate.Session)1 Transaction (org.hibernate.Transaction)1 BindingRepository (org.n52.iceland.binding.BindingRepository)1 CategoryEntity (org.n52.series.db.beans.CategoryEntity)1 CodespaceEntity (org.n52.series.db.beans.CodespaceEntity)1 DataEntity (org.n52.series.db.beans.DataEntity)1 FeatureEntity (org.n52.series.db.beans.FeatureEntity)1 FormatEntity (org.n52.series.db.beans.FormatEntity)1 OfferingEntity (org.n52.series.db.beans.OfferingEntity)1 PhenomenonEntity (org.n52.series.db.beans.PhenomenonEntity)1 PlatformEntity (org.n52.series.db.beans.PlatformEntity)1