protected void onSetUp(org.geoserver.data.test.SystemTestData testData) throws Exception {
    Catalog catalog = getCatalog();

    // add layers
    testData.addVectorLayer(LAKES, catalog);
    testData.addVectorLayer(BRIDGES, catalog);
    testData.addVectorLayer(FORESTS, catalog);
    testData.addVectorLayer(BUILDINGS, catalog);

    setupExtras(testData, catalog);
  }
Ejemplo n.º 2
0
 @Override
 protected void setUpTestData(SystemTestData testData) throws Exception {
   testData.setUpSecurity();
   testData.setUpDefaultRasterLayers();
   if (SpatioTemporalRasterTests) {
     testData.setUpRasterLayer(WATTEMP, "watertemp.zip", null, null, TestData.class);
     //            dataDirectory.addCoverage(WATTEMP, TestData.class.getResource("watertemp.zip"),
     //                    null, styleName);
   }
   testData.setUpWcs10RasterLayers();
   // dataDirectory.addWcs10Coverages();
 }
  void addLayerAndStyle(SystemTestData testData, QName name) throws IOException {
    testData.addVectorLayer(
        name, null, name.getLocalPart() + ".properties", getClass(), this.catalog);

    final String styleName = name.getLocalPart();
    testData.addStyle(styleName, getClass(), this.catalog);

    StyleInfo defaultStyle = this.catalog.getStyleByName(styleName);

    String layerId = getLayerId(name);
    LayerInfo layerInfo = this.catalog.getLayerByName(layerId);
    layerInfo.setDefaultStyle(defaultStyle);
    this.catalog.save(layerInfo);
  }
  void setupExtras(org.geoserver.data.test.SystemTestData testData, Catalog catalog)
      throws IOException {
    // associate Lakes to Buildings as an extra style
    LayerInfo buildings = catalog.getLayerByName(getLayerId(BUILDINGS));
    buildings.getStyles().add(catalog.getStyleByName(LAKES.getLocalPart()));
    catalog.save(buildings);

    // add a layer group
    CatalogFactory factory = catalog.getFactory();
    LayerGroupInfo globalGroup = factory.createLayerGroup();
    globalGroup.setName(LAKES_GROUP);
    globalGroup.getLayers().add(catalog.getLayerByName(getLayerId(LAKES)));
    globalGroup.getLayers().add(catalog.getLayerByName(getLayerId(FORESTS)));
    globalGroup.getLayers().add(catalog.getLayerByName(getLayerId(BRIDGES)));
    catalog.add(globalGroup);

    // add a layer group containing a layer group
    LayerGroupInfo nestGroup = factory.createLayerGroup();
    nestGroup.setName(NEST_GROUP);
    nestGroup.getLayers().add(catalog.getLayerByName(getLayerId(LAKES)));
    nestGroup.getLayers().add(globalGroup);
    catalog.add(nestGroup);

    // add a workspace specific style
    WorkspaceInfo ws = catalog.getWorkspaceByName(CITE_PREFIX);
    testData.addStyle(ws, WS_STYLE, "Streams.sld", SystemTestData.class, catalog);
  };
Ejemplo n.º 5
0
  @Override
  protected void onSetUp(SystemTestData testData) throws Exception {
    super.onSetUp(testData);

    addWcs11Coverages(testData);
    testData.addRasterLayer(DEM, "sfdem.tiff", TIFF, null, getClass(), getCatalog());

    Map<LayerProperty, Object> props = new HashMap<SystemTestData.LayerProperty, Object>();
    props.put(
        LayerProperty.ENVELOPE,
        new ReferencedEnvelope(
            181985.7630, 818014.2370, 1973809.4640, 8894102.4298, CRS.decode("EPSG:26713", true)));

    testData.addVectorLayer(RESTRICTED, props, "restricted.properties", getClass(), getCatalog());
    testData.addVectorLayer(
        TASMANIA_BM_ZONES, props, "tazdem_zones.properties", getClass(), getCatalog());
  }
Ejemplo n.º 6
0
  @Override
  protected void setUpInternal(SystemTestData data) throws Exception {
    WFSInfo wfs = getWFS();
    wfs.setFeatureBounding(true);
    getGeoServer().save(wfs);

    data.addVectorLayer(NULL_GEOMETRIES, Collections.EMPTY_MAP, getClass(), getCatalog());
  }
Ejemplo n.º 7
0
 @Override
 protected void onSetUp(SystemTestData testData) throws Exception {
   super.onSetUp(testData);
   testData.addRasterLayer(MOSAIC, "raster-filter-test.zip", null, getCatalog());
   // enable dimensions on the water temperature layer
   setupRasterDimension(ResourceInfo.TIME, DimensionPresentation.LIST, null);
   setupRasterDimension(ResourceInfo.ELEVATION, DimensionPresentation.LIST, null);
 }
Ejemplo n.º 8
0
  @Override
  protected void onSetUp(SystemTestData testData) throws Exception {
    super.onSetUp(testData);

    testData.addStyle("relative", "se_relativepath.sld", ResourcePoolTest.class, getCatalog());
    StyleInfo style = getCatalog().getStyleByName("relative");
    style.setSLDVersion(new Version("1.1.0"));
    getCatalog().save(style);
    File images = new File(testData.getDataDirectoryRoot(), "styles/images");
    assertTrue(images.mkdir());
    File image = new File("./src/test/resources/org/geoserver/catalog/rockFillSymbol.png");
    assertTrue(image.exists());
    FileUtils.copyFileToDirectory(image, images);
    rockFillSymbolFile = new File(images, image.getName()).getCanonicalFile();

    testData.addRasterLayer(
        TIMERANGES, "timeranges.zip", null, null, SystemTestData.class, getCatalog());
  }
  @Override
  protected void setUpTestData(SystemTestData testData) throws Exception {
    super.setUpTestData(testData);
    testData.setUpDefaultRasterLayers();

    GeoServerExtensions extension = GeoServerExtensions.bean(GeoServerExtensions.class);
    if (extension == null) {
      GeoServerExtensionsHelper.init(this.applicationContext);
    }
  }
Ejemplo n.º 10
0
  @Override
  protected void setUpInternal(SystemTestData data) throws Exception {
    WFSInfo wfs = getWFS();
    wfs.setFeatureBounding(true);
    getGeoServer().save(wfs);

    data.addVectorLayer(
        new QName(SystemTestData.SF_URI, "WithGMLProperties", SystemTestData.SF_PREFIX),
        Collections.EMPTY_MAP,
        getClass(),
        getCatalog());
  }
  @Override
  protected void onSetUp(SystemTestData testData) throws Exception {
    super.onSetUp(testData);

    testData.addWorkspace(SystemTestData.WCS_PREFIX, SystemTestData.WCS_URI, getCatalog());

    // setup the namespace context for this test
    Map<String, String> namespaces = new HashMap<String, String>();
    namespaces.put("gml", "http://www.opengis.net/gml");
    namespaces.put("gf", "http://www.geoserver.org/rest/granules");
    namespaces.put("wfs", "http://www.opengis.net/wfs");
    XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
  }
  void addLayerGroups(SystemTestData testData) throws Exception {
    // setup basic layergroups
    testData.addStyle("Accident3_2", getClass(), this.catalog);

    CoordinateReferenceSystem nativeCrs = CRS.decode("EPSG:4326", true);
    ReferencedEnvelope nativeBounds = new ReferencedEnvelope(-180, 180, -90, 90, nativeCrs);

    LayerGroupInfo layerGroup1 = catalog.getFactory().createLayerGroup();
    layerGroup1.setName("testLayerGroup1");
    layerGroup1.setBounds(nativeBounds);

    LayerGroupInfo layerGroup2 = catalog.getFactory().createLayerGroup();
    layerGroup2.setName("testLayerGroup2");
    layerGroup2.setBounds(nativeBounds);

    LayerGroupInfo layerGroup3 = catalog.getFactory().createLayerGroup();
    layerGroup3.setName("testLayerGroup3");
    layerGroup3.setBounds(nativeBounds);

    // add layers & styles
    layerGroup1.getLayers().add(catalog.getLayerByName(getLayerId(REGIONATED)));
    layerGroup1.getStyles().add(null);
    layerGroup1.getLayers().add(catalog.getLayerByName(getLayerId(ACCIDENT3)));
    layerGroup1.getStyles().add(catalog.getStyleByName("Accident3_2"));

    layerGroup2.getLayers().add(catalog.getLayerByName(getLayerId(REGIONATED)));
    layerGroup2.getLayers().add(catalog.getLayerByName(getLayerId(ACCIDENT)));
    layerGroup2.getLayers().add(catalog.getLayerByName(getLayerId(ACCIDENT2)));

    layerGroup3.getLayers().add(layerGroup2);
    layerGroup3.getLayers().add(catalog.getLayerByName(getLayerId(ACCIDENT3)));

    catalog.add(layerGroup1);
    catalog.add(layerGroup2);
    catalog.add(layerGroup3);
  }
Ejemplo n.º 13
0
  @Override
  protected void setUpTestData(SystemTestData testData) throws Exception {
    Map<LayerProperty, Object> props = new HashMap<LayerProperty, Object>();
    props.put(LayerProperty.PROJECTION_POLICY, ProjectionPolicy.FORCE_DECLARED);
    props.put(LayerProperty.SRS, 4269);
    testData.setUpVectorLayer(SystemTestData.BASIC_POLYGONS, props);

    props.put(LayerProperty.PROJECTION_POLICY, ProjectionPolicy.REPROJECT_TO_DECLARED);
    props.put(LayerProperty.SRS, 4326);
    testData.setUpVectorLayer(MockData.POLYGONS, props);

    props.put(LayerProperty.PROJECTION_POLICY, ProjectionPolicy.NONE);
    props.put(LayerProperty.SRS, 3004);
    testData.setUpVectorLayer(MockData.LINES, props);

    props.put(LayerProperty.PROJECTION_POLICY, ProjectionPolicy.REPROJECT_TO_DECLARED);
    props.put(LayerProperty.SRS, 4326);
    props.put(LayerProperty.NAME, "MyPoints");
    testData.setUpVectorLayer(MockData.POINTS, props);

    testData.setUpDefaultRasterLayers();
    testData.setUpWcs10RasterLayers();
  }
 @Override
 protected void setUpTestData(SystemTestData testData) throws Exception {
   // all the data we need is registered in this test
   testData.setUpSecurity();
 }
 @Override
 protected void setUpTestData(SystemTestData testData) throws Exception {
   testData.setUpDefaultRasterLayers();
   testData.setUpWcs10RasterLayers();
   // dataDirectory.addWcs10Coverages();
 }
 @Override
 protected void setUpTestData(SystemTestData testData) throws Exception {
   // nothing to do
   testData.setUpSecurity();
 }
Ejemplo n.º 17
0
 @Override
 protected void setUpTestData(SystemTestData testData) throws Exception {
   super.setUpTestData(testData);
   testData.setUpWcs11RasterLayers();
 }
Ejemplo n.º 18
0
 @Override
 protected void setUpTestData(SystemTestData testData) throws Exception {
   // oevrride to avoid creating all the default feature types but call testData.setUp() only
   // instead
   testData.setUp();
 }
Ejemplo n.º 19
0
 @Override
 protected void onSetUp(SystemTestData testData) throws Exception {
   super.onSetUp(testData);
   Catalog catalog = getCatalog();
   testData.addStyle("Bridge", "bridge.sld", getClass(), catalog);
   testData.addStyle("allsymbolizers", "allsymbolizers.sld", getClass(), catalog);
   testData.addStyle("labels", "labels.sld", getClass(), catalog);
   testData.addStyle("SingleFeature", "singlefeature.sld", getClass(), catalog);
   testData.addStyle("BridgeSubdir", "bridgesubdir.sld", getClass(), catalog);
   testData.addStyle("dynamicsymbolizer", "dynamicsymbolizer.sld", getClass(), catalog);
   testData.addStyle("relativeds", "relativeds.sld", getClass(), catalog);
   testData.addStyle("big-local-image", "big-local-image.sld", getClass(), catalog);
   testData.addStyle("big-mark", "big-mark.sld", getClass(), catalog);
   testData.copyTo(getClass().getResourceAsStream("bridge.png"), "styles/bridge.png");
   testData.copyTo(getClass().getResourceAsStream("planet-42.png"), "styles/planet-42.png");
   File stylesDir = new File(testData.getDataDirectoryRoot(), "styles");
   new File(stylesDir, "graphics").mkdir();
   testData.copyTo(
       getClass().getResourceAsStream("bridge.png"), "styles/graphics/bridgesubdir.png");
 }