Search in sources :

Example 1 with ReferencedEnvelopeValues

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);
}
Also used : ReferencedEnvelopeValues(com.sldeditor.rendertransformation.types.ReferencedEnvelopeValues) ReferencedEnvelope(org.geotools.geometry.jts.ReferencedEnvelope) FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase) Expression(org.opengis.filter.expression.Expression) FieldConfigBoundingBox(com.sldeditor.ui.detail.config.FieldConfigBoundingBox) BoundingBox(org.opengis.geometry.BoundingBox) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) CoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem) ReferencedEnvelope(org.geotools.geometry.jts.ReferencedEnvelope) Envelope(org.opengis.geometry.Envelope) Test(org.junit.jupiter.api.Test)

Aggregations

ReferencedEnvelopeValues (com.sldeditor.rendertransformation.types.ReferencedEnvelopeValues)1 FieldConfigBase (com.sldeditor.ui.detail.config.FieldConfigBase)1 FieldConfigBoundingBox (com.sldeditor.ui.detail.config.FieldConfigBoundingBox)1 FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)1 ReferencedEnvelope (org.geotools.geometry.jts.ReferencedEnvelope)1 Test (org.junit.jupiter.api.Test)1 Expression (org.opengis.filter.expression.Expression)1 BoundingBox (org.opengis.geometry.BoundingBox)1 Envelope (org.opengis.geometry.Envelope)1 CoordinateReferenceSystem (org.opengis.referencing.crs.CoordinateReferenceSystem)1