use of com.sldeditor.rendertransformation.types.ReferencedEnvelopeValues in project sldeditor by robward-scisys.
the class ReferencedEnvlopeValuesTest method testReferencedEnvelopeValues.
/**
* Test method for {@link
* com.sldeditor.rendertransformation.types.ReferencedEnvelopeValues#ReferencedEnvelopeValues()}.
*/
@Test
void testReferencedEnvelopeValues() {
ReferencedEnvelopeValues testObj = new ReferencedEnvelopeValues();
testObj.createInstance();
assertEquals(Arrays.asList(ReferencedEnvelope.class, Envelope.class, BoundingBox.class), testObj.getType());
CoordinateReferenceSystem crs = null;
ReferencedEnvelope envelope = new ReferencedEnvelope(-1.0, 1.0, -1.0, 1.0, crs);
testObj.setDefaultValue(envelope);
assertNull(testObj.getExpression());
// ReferencedEnvelope value
testObj.setValue((Envelope) crs);
assertNull(testObj.getExpression());
// Literal expression
Expression expectedExpression = ff.literal(crs);
testObj.setValue(expectedExpression);
assertEquals(expectedExpression, testObj.getExpression());
// Attribute expression
expectedExpression = ff.property("test");
testObj.setValue(expectedExpression);
assertEquals(expectedExpression, testObj.getExpression());
// Not set
testObj.setValue("");
assertNull(testObj.getExpression());
FieldConfigBase field = testObj.getField(new FieldConfigCommonData(ReferencedEnvelopeValues.class, FieldIdEnum.INITIAL_GAP, "label", true, false, false));
assertEquals(FieldConfigBoundingBox.class, field.getClass());
// Increase code coverage
TestReferencedEnvelopeValues testObj2 = new TestReferencedEnvelopeValues();
testObj2.populateSymbolType(null);
}
Aggregations