Geometry geometry;
login("marino");
oldFeatures = new ArrayList<InternalFeature>();
newFeatures = new ArrayList<InternalFeature>();
feature = converterService.toInternal(new Feature());
feature.setId("4");
feature.setLayer(beanLayer);
// feature needs a geometry or exceptions all over
geometry = geometryFactory.createPoint(new Coordinate(1.5, 1.5));
feature.setGeometry(geometry);
newFeatures.add(feature);
try {
layerService.saveOrUpdate(LAYER_ID, crs, oldFeatures, newFeatures);
Assert.fail("create should have failed");
} catch (GeomajasSecurityException gse) {
Assert.assertEquals(ExceptionCode.FEATURE_CREATE_PROHIBITED, gse.getExceptionCode());
}
filter = filterService.createFidFilter(new String[]{"4"});
oldFeatures = layerService.getFeatures(LAYER_ID,
crs, filter, null, VectorLayerService.FEATURE_INCLUDE_ATTRIBUTES);
Assert.assertEquals(0, oldFeatures.size());
login("luc");
oldFeatures = new ArrayList<InternalFeature>();
newFeatures = new ArrayList<InternalFeature>();
feature = converterService.toInternal(new Feature());
feature.setId("4");
feature.setLayer(beanLayer);
// feature needs a geometry or exceptions all over
geometry = geometryFactory.createPoint(new Coordinate(1.5, 1.5));
feature.setGeometry(geometry);