use of org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeatureComplex in project arctic-sea by 52North.
the class SamplingFeatureTest method isSetRelatedSamplingFeatures_should_return_false_if_not_set.
@Test
public final void isSetRelatedSamplingFeatures_should_return_false_if_not_set() {
final SamplingFeature feature = new SamplingFeature(null);
assertThat(feature.isSetRelatedSamplingFeatures(), is(FALSE));
feature.addRelatedSamplingFeature(new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature"))));
assertThat(feature.isSetRelatedSamplingFeatures(), is(TRUE));
feature.setRelatedSamplingFeatures(null);
assertThat(feature.isSetRelatedSamplingFeatures(), is(FALSE));
feature.setRelatedSamplingFeatures(Lists.<SamplingFeatureComplex>newArrayList());
assertThat(feature.isSetRelatedSamplingFeatures(), is(FALSE));
}
use of org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeatureComplex in project arctic-sea by 52North.
the class SamplingFeatureTest method setRelatedSamplingFeatures_should_set_all_elements_and_reset_if_set_before.
@Test
public final void setRelatedSamplingFeatures_should_set_all_elements_and_reset_if_set_before() {
final SamplingFeature feature = new SamplingFeature(null);
final SamplingFeatureComplex relatedSamplingFeature = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature")));
final SamplingFeatureComplex relatedSamplingFeature2 = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature-2")));
List<SamplingFeatureComplex> list = Lists.newArrayList(relatedSamplingFeature, relatedSamplingFeature2);
feature.setRelatedSamplingFeatures(list);
validate(feature, relatedSamplingFeature, relatedSamplingFeature2);
final SamplingFeatureComplex relatedSamplingFeature3 = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature-3")));
final SamplingFeatureComplex relatedSamplingFeature4 = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature-4")));
list = Lists.newArrayList(relatedSamplingFeature3, relatedSamplingFeature4);
feature.setRelatedSamplingFeatures(list);
validate(feature, relatedSamplingFeature3, relatedSamplingFeature4);
}
Aggregations