use of eu.esdihumboldt.hale.common.core.io.report.IOReport in project hale by halestudio.
the class StreamGmlWriterTest method testGeometry_2_Point.
// /**
// * Test writing a simple feature from a simple schema (Watercourses VA)
// *
// * @throws Exception if any error occurs
// */
// @Test
// public void testFillWrite_WatercourseVA() throws Exception {
// Map<List<String>, Object> values = new HashMap<List<String>, Object>();
//
// // create the geometry
// // MultiLineString mls = geomFactory.createMultiLineString(
// // new LineString[]{createLineString(0.0), createLineString(1.0),
// // createLineString(2.0)});
// //XXX for some reason the MultiLineString is converted to a LineString when set a value -> so we are using a LineString instead to allow value comparison
// LineString mls = createLineString(0.0);
//
// values.put(Arrays.asList("LENGTH"), Double.valueOf(10.2)); //$NON-NLS-1$
// values.put(Arrays.asList("NAME"), "Test"); //$NON-NLS-1$ //$NON-NLS-2$
// values.put(Arrays.asList("the_geom"), mls); //$NON-NLS-1$
//
// Report report = fillFeatureTest("Watercourses_VA", //$NON-NLS-1$
// getClass().getResource("/data/sample_wva/wfs_va.xsd").toURI(), //$NON-NLS-1$
// values, "fillWrite_WVA", "EPSG:31251"); //$NON-NLS-1$ //$NON-NLS-2$
//
// assertTrue("Expected GML output to be valid", report.isValid()); //$NON-NLS-1$
// }
/**
* Test writing a {@link Point} to a GML 2 geometry type
*
* @throws Exception if an error occurs
*/
@Ignore
// GML 2 stuff currently not working (because of unrelated schemas)
@Test
public void testGeometry_2_Point() throws Exception {
// create the geometry
Point point = createPoint(10.0);
Map<List<QName>, Object> values = new HashMap<List<QName>, Object>();
// $NON-NLS-1$
values.put(GEOMETRY_PROPERTY, point);
IOReport report = fillFeatureTest(// $NON-NLS-1$
"Test", // $NON-NLS-1$
getClass().getResource("/data/geom_schema/geom-gml2.xsd").toURI(), values, "geometry_2_Point", // $NON-NLS-1$
DEF_SRS_NAME);
// $NON-NLS-1$
assertTrue("Expected GML output to be valid", report.isSuccess());
}
use of eu.esdihumboldt.hale.common.core.io.report.IOReport in project hale by halestudio.
the class StreamGmlWriterTest method testGeometryPrimitive_3_Polygon.
/**
* Test writing a {@link Polygon} to a GML 3.0 geometry primitive type
*
* @throws Exception if an error occurs
*/
@Ignore
// deactivated test because schema is invalid (according to xerces)
@Test
public void testGeometryPrimitive_3_Polygon() throws Exception {
// create the geometry
Polygon polygon = createPolygon(0.0);
Map<List<QName>, Object> values = new HashMap<List<QName>, Object>();
values.put(GEOMETRY_PROPERTY, polygon);
IOReport report = fillFeatureTest("PrimitiveTest", getClass().getResource("/data/geom_schema/geom-gml3.xsd").toURI(), values, "geometryPrimitive_3_Polygon", DEF_SRS_NAME);
assertTrue("Expected GML output to be valid", report.isSuccess());
}
use of eu.esdihumboldt.hale.common.core.io.report.IOReport in project hale by halestudio.
the class StreamGmlWriterTest method testGeometryPrimitive_32_MultiPolygon.
/**
* Test writing a {@link MultiPolygon} to a GML 3.2 geometry primitive type
*
* @throws Exception if an error occurs
*/
@Test
public void testGeometryPrimitive_32_MultiPolygon() throws Exception {
// create the geometry
MultiPolygon mp = geomFactory.createMultiPolygon(new Polygon[] { createPolygon(0.0), createPolygon(1.0), createPolygon(-1.0) });
Map<List<QName>, Object> values = new HashMap<List<QName>, Object>();
// $NON-NLS-1$
values.put(GEOMETRY_PROPERTY, mp);
IOReport report = fillFeatureTest(// $NON-NLS-1$
"PrimitiveTest", // $NON-NLS-1$
getClass().getResource("/data/geom_schema/geom-gml32.xsd").toURI(), // $NON-NLS-1$
values, // $NON-NLS-1$
"geometryPrimitive_32_MultiPolygon", // $NON-NLS-1$
DEF_SRS_NAME, true, false);
// $NON-NLS-1$
assertTrue("Expected GML output to be valid", report.isSuccess());
}
use of eu.esdihumboldt.hale.common.core.io.report.IOReport in project hale by halestudio.
the class StreamGmlWriterTest method testGeometry_2_Polygon.
/**
* Test writing a {@link Polygon} to a GML 2 geometry type
*
* @throws Exception if an error occurs
*/
@Ignore
// GML 2 stuff currently not working (because of unrelated schemas)
@Test
public void testGeometry_2_Polygon() throws Exception {
// create the geometry
Polygon polygon = createPolygon(0.0);
Map<List<QName>, Object> values = new HashMap<List<QName>, Object>();
// $NON-NLS-1$
values.put(GEOMETRY_PROPERTY, polygon);
IOReport report = fillFeatureTest(// $NON-NLS-1$
"Test", // $NON-NLS-1$
getClass().getResource("/data/geom_schema/geom-gml2.xsd").toURI(), values, "geometry_2_Polygon", // $NON-NLS-1$
DEF_SRS_NAME);
// $NON-NLS-1$
assertTrue("Expected GML output to be valid", report.isSuccess());
}
use of eu.esdihumboldt.hale.common.core.io.report.IOReport in project hale by halestudio.
the class SpatiaLiteTestSuite method readSchema.
/**
* Reads a schema from a SpatiaLite database file.
*
* @param sourceFilePath the path to the source database file
* @return the schema
* @throws Exception any exception thrown by {@link SpatiaLiteSchemaReader}
*/
public Schema readSchema(String sourceFilePath) throws Exception {
SpatiaLiteSchemaReader schemaReader = new SpatiaLiteSchemaReader();
schemaReader.setSource(new FileIOSupplier(new File(sourceFilePath)));
IOReport report = schemaReader.execute(new LogProgressIndicator());
assertTrue(report.isSuccess());
return schemaReader.getSchema();
}
Aggregations