@SuppressWarnings("rawtypes")
@Test
public void testPutWithCalculation() throws Exception {
DataStoreInfo dataStoreInfo = getCatalog().getDataStoreByName("sf","sf");
String dataStoreId = dataStoreInfo.getId();
DataAccess dataAccessBefore = dataStoreInfo.getDataStore(null);
assertSame("ResourcePool DataStoreCache", dataAccessBefore, getCatalog().getResourcePool().getDataStoreCache().get( dataStoreId ));
String clearLatLonBoundingBox =
"<featureType>"
+ "<nativeBoundingBox>"
+ "<minx>-180.0</minx>" + "<maxx>180.0</maxx>"
+ "<miny>-90.0</miny>" + "<maxy>90.0</maxy>"
+ "<crs>EPSG:4326</crs>"
+ "</nativeBoundingBox>"
+ "<latLonBoundingBox/>"
+ "</featureType>";
String path = "/rest/workspaces/sf/datastores/sf/featuretypes/PrimitiveGeoFeature";
MockHttpServletResponse response =
putAsServletResponse(path, clearLatLonBoundingBox, "text/xml");
assertEquals("Couldn't remove lat/lon bounding box:\n" + response.getOutputStreamContent(),
200, response.getStatusCode());
Document dom = getAsDOM(path + ".xml");
assertXpathEvaluatesTo("0.0", "/featureType/latLonBoundingBox/minx", dom);
// confirm ResourcePoool cache of DataStore is unchanged
DataAccess dataAccessAfter = getCatalog().getDataStoreByName("sf","sf").getDataStore(null);
assertSame( "ResourcePool DataStoreCache check 1", dataAccessBefore, dataAccessAfter );
assertSame("ResourcePool DataStoreCache", dataAccessBefore, getCatalog().getResourcePool().getDataStoreCache().get( dataStoreId ));
String updateNativeBounds =
"<featureType>"