SpatialDatasetAssembler extends AssemblerBase implements Assembler { @Override public Dataset open(Assembler a, Resource root, Mode mode) { Resource dataset = GraphUtils.getResourceValue(root, pDataset) ; Resource index = GraphUtils.getResourceValue(root, pIndex) ; Dataset ds = (Dataset)a.open(dataset) ; SpatialIndex textIndex = (SpatialIndex)a.open(index) ; Dataset dst = SpatialDatasetFactory.create(ds, textIndex) ; return dst ; }  @Override Dataset open(Assembler a, Resource root, Mode mode);  }
@Test public void testErrorOnNoDataset() { try { Assembler.general.open(noDatasetPropertySpec); fail("should have thrown an exception"); } catch (Exception e) {} }
@Test public void testErrorOnNoIndex() { try { Assembler.general.open(noIndexPropertySpec); fail("should have thrown an exception"); } catch (Exception e) {} }
@Test public void testSimpleDatasetAssembler() { Dataset dataset = (Dataset) Assembler.general.open(spec1); assertTrue(dataset.getContext().get(SpatialQuery.spatialIndex) instanceof SpatialIndexLucene); }