Search in sources :

Example 6 with ListTypeShapefileExporter

use of net.geoprism.registry.shapefile.ListTypeShapefileExporter in project geoprism-registry by terraframe.

the class ListTypeGeoObjectShapefileExporterTest method testExport.

@Test
@Request
public void testExport() throws IOException {
    ListTypeShapefileExporter exporter = new ListTypeShapefileExporter(version, mdBusiness, mdAttributes, new JsonObject());
    InputStream export = exporter.export();
    Assert.assertNotNull(export);
    IOUtils.copy(export, NullOutputStream.NULL_OUTPUT_STREAM);
}
Also used : ListTypeShapefileExporter(net.geoprism.registry.shapefile.ListTypeShapefileExporter) InputStream(java.io.InputStream) JsonObject(com.google.gson.JsonObject) ListTypeTest(net.geoprism.registry.service.ListTypeTest) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Example 7 with ListTypeShapefileExporter

use of net.geoprism.registry.shapefile.ListTypeShapefileExporter in project geoprism-registry by terraframe.

the class ListTypeGeoObjectShapefileExporterTest method testCreateFeatureType.

@Test
@Request
public void testCreateFeatureType() {
    ListTypeShapefileExporter exporter = new ListTypeShapefileExporter(version, mdBusiness, mdAttributes, null);
    SimpleFeatureType featureType = exporter.createFeatureType();
    Assert.assertNotNull(featureType);
    Assert.assertEquals(ListTypeShapefileExporter.GEOM, featureType.getGeometryDescriptor().getLocalName());
    List<AttributeDescriptor> attributes = featureType.getAttributeDescriptors();
    Assert.assertEquals(6, attributes.size());
}
Also used : SimpleFeatureType(org.opengis.feature.simple.SimpleFeatureType) ListTypeShapefileExporter(net.geoprism.registry.shapefile.ListTypeShapefileExporter) AttributeDescriptor(org.opengis.feature.type.AttributeDescriptor) ListTypeTest(net.geoprism.registry.service.ListTypeTest) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Aggregations

ListTypeShapefileExporter (net.geoprism.registry.shapefile.ListTypeShapefileExporter)7 JsonObject (com.google.gson.JsonObject)5 Request (com.runwaysdk.session.Request)5 ListTypeTest (net.geoprism.registry.service.ListTypeTest)5 Test (org.junit.Test)5 InputStream (java.io.InputStream)3 JsonParser (com.google.gson.JsonParser)2 Authenticate (com.runwaysdk.business.rbac.Authenticate)2 MdAttributeConcreteDAOIF (com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF)2 MdBusinessDAOIF (com.runwaysdk.dataaccess.MdBusinessDAOIF)2 ProgrammingErrorException (com.runwaysdk.dataaccess.ProgrammingErrorException)2 MdBusinessDAO (com.runwaysdk.dataaccess.metadata.MdBusinessDAO)2 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)2 File (java.io.File)2 IOException (java.io.IOException)2 ParseException (java.text.ParseException)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2