dataStore.setDescription("store description");
dataStore.setEnabled(true);
dataStore.setWorkspace(ws);
catalog.add(dataStore);
FeatureTypeInfo refFeatureType = catalog.getFactory().createFeatureType();
refFeatureType.setName("featureType");
refFeatureType.setNativeName("nativefeatureType");
refFeatureType.setTitle("featureType title");
refFeatureType.setDescription("featureType description");
refFeatureType.setAbstract("featureType abstract");
refFeatureType.setSRS("EPSG:4326");
refFeatureType.setNamespace(namespace);
FilterFactory factory = CommonFactoryFinder.getFilterFactory(null);
Filter filter = factory.id(Collections.EMPTY_SET);
refFeatureType.setFilter(filter);
CoordinateReferenceSystem crsNative = CRS
.parseWKT("PROJCS[\"NAD83 / BC Albers\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],PROJECTION[\"Albers_Conic_Equal_Area\"],PARAMETER[\"standard_parallel_1\",50],PARAMETER[\"standard_parallel_2\",58.5],PARAMETER[\"latitude_of_center\",45],PARAMETER[\"longitude_of_center\",-126],PARAMETER[\"false_easting\",1000000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AUTHORITY[\"EPSG\",\"3005\"]]");
BoundingBox nativeBoundingBox = new ReferencedEnvelope(0, 0, 0, 0, crsNative);
BoundingBox latLonBoundingBox = new ReferencedEnvelope(-180, 180, -90, 90,
DefaultGeographicCRS.WGS84);
refFeatureType.setNativeBoundingBox((ReferencedEnvelope) nativeBoundingBox);
refFeatureType.setLatLonBoundingBox((ReferencedEnvelope) latLonBoundingBox);
refFeatureType.setStore(dataStore);
catalog.add(refFeatureType);
endTransaction();
startNewTransaction();
FeatureTypeInfo loadedFeatureType = catalog.getFeatureType(refFeatureType.getId());
assertNotNull(loadedFeatureType);
assertFalse(refFeatureType == loadedFeatureType);
refFeatureType = loadedFeatureType;