use of org.geotoolkit.sld.xml.v100.FeatureTypeStyle in project geotoolkit by Geomatys.
the class SEforSLD100Test method testFTS.
@Test
public void testFTS() throws JAXBException {
final Unmarshaller UNMARSHALLER = POOL.acquireUnmarshaller();
final Marshaller MARSHALLER = POOL.acquireMarshaller();
// Read test
Object obj = UNMARSHALLER.unmarshal(FILE_SE_FTS);
assertNotNull(obj);
FeatureTypeStyle jax = (FeatureTypeStyle) obj;
MutableFeatureTypeStyle fts = TRANSFORMER_GT.visitFTS(jax);
assertNotNull(fts);
assertEquals(fts.getName(), valueName);
assertEquals(fts.getDescription().getTitle().toString(), valueTitle);
assertEquals(fts.getDescription().getAbstract().toString(), valueAbstract);
assertEquals(fts.featureTypeNames().iterator().next().toString(), valueFTN);
assertEquals(fts.rules().size(), 3);
assertEquals(fts.semanticTypeIdentifiers().size(), 6);
Iterator<SemanticType> ite = fts.semanticTypeIdentifiers().iterator();
assertEquals(ite.next(), SemanticType.ANY);
assertEquals(ite.next(), SemanticType.POINT);
assertEquals(ite.next(), SemanticType.LINE);
assertEquals(ite.next(), SemanticType.POLYGON);
assertEquals(ite.next(), SemanticType.TEXT);
assertEquals(ite.next(), SemanticType.RASTER);
// Write test
FeatureTypeStyle pvt = TRANSFORMER_OGC.visit(fts, null);
assertNotNull(pvt);
assertEquals(pvt.getName(), valueName);
assertEquals(pvt.getTitle(), valueTitle);
assertEquals(pvt.getAbstract(), valueAbstract);
assertEquals(pvt.getFeatureTypeName(), valueFTN);
assertEquals(pvt.getRule().size(), 3);
assertEquals(pvt.getSemanticTypeIdentifier().size(), 6);
assertEquals(pvt.getSemanticTypeIdentifier().get(0), "generic:any");
assertEquals(pvt.getSemanticTypeIdentifier().get(1), "generic:point");
assertEquals(pvt.getSemanticTypeIdentifier().get(2), "generic:line");
assertEquals(pvt.getSemanticTypeIdentifier().get(3), "generic:polygon");
assertEquals(pvt.getSemanticTypeIdentifier().get(4), "generic:text");
assertEquals(pvt.getSemanticTypeIdentifier().get(5), "generic:raster");
MARSHALLER.marshal(pvt, TEST_FILE_SE_FTS);
POOL.recycle(MARSHALLER);
POOL.recycle(UNMARSHALLER);
}
Aggregations