Examples of WMSInfo


Examples of org.geoserver.wms.WMSInfo

        NamespaceContext ctx = new SimpleNamespaceContext(namespaces);
        XMLUnit.setXpathNamespaceContext(ctx);

        Logging.getLogger("org.geoserver.ows").setLevel(Level.OFF);
        WMSInfo wmsInfo = getGeoServer().getService(WMSInfo.class);
        wmsInfo.setMaxBuffer(50);
        getGeoServer().save(wmsInfo);

        Catalog catalog = getCatalog();
       
        testData.addStyle("thickStroke","thickStroke.sld",CapabilitiesTest.class,catalog);
View Full Code Here

Examples of org.geoserver.wms.WMSInfo

    }
   
    @Test
    public void testAllowedMimeTypes() throws Exception {
       
        WMSInfo wms = getWMS().getServiceInfo();
        GetFeatureInfoOutputFormat format = new TextFeatureInfoOutputFormat(getWMS());       
        wms.getGetFeatureInfoMimeTypes().add(format.getContentType());
        wms.setGetFeatureInfoMimeTypeCheckingEnabled(true);
        getGeoServer().save(wms);

        // check mime type allowed
        String layer = getLayerId(MockData.FORESTS);
        String request = "wms?version=1.3.0&bbox=-0.002,-0.002,0.002,0.002&styles=&format=jpeg&info_format=text/plain&request=GetFeatureInfo&layers="
                + layer + "&query_layers=" + layer + "&width=20&height=20&i=10&j=10";
        String result = getAsString(request);
        // System.out.println(result);
        assertNotNull(result);
        assertTrue(result.indexOf("Green Forest") > 0);
       
        // check mime type not allowed       
        request = "wms?version=1.3.0&bbox=-0.002,-0.002,0.002,0.002&styles=&format=jpeg&info_format="+GML3FeatureInfoOutputFormat.FORMAT+"&request=GetFeatureInfo&layers="
                + layer + "&query_layers=" + layer + "&width=20&height=20&i=10&j=10";
        result = getAsString(request);
        assertTrue(result.indexOf("ForbiddenFormat") > 0);       
       
        wms.getGetFeatureInfoMimeTypes().clear();
        wms.setGetFeatureInfoMimeTypeCheckingEnabled(false);
        getGeoServer().save(wms);
       
        request = "wms?version=1.3.0&bbox=-0.002,-0.002,0.002,0.002&styles=&format=jpeg&info_format="+GML3FeatureInfoOutputFormat.FORMAT+"&request=GetFeatureInfo&layers="
                + layer + "&query_layers=" + layer + "&width=20&height=20&i=10&j=10";
        result = getAsString(request);
View Full Code Here

Examples of org.geoserver.wms.WMSInfo

        assertTrue(href.contains("style=point"));
    }

    @org.junit.Test
    public void testServiceMetadata() throws Exception {
        final WMSInfo service = getGeoServer().getService(WMSInfo.class);
        service.setTitle("test title");
        service.setAbstract("test abstract");
        service.setAccessConstraints("test accessConstraints");
        service.setFees("test fees");
        service.getKeywords().clear();
        service.getKeywords().add(new Keyword("test keyword 1"));
        service.getKeywords().add(new Keyword("test keyword 2"));
        service.setMaintainer("test maintainer");
        service.setOnlineResource("http://example.com/geoserver");
        GeoServerInfo global = getGeoServer().getGlobal();
        ContactInfo contact = global.getContact();
        contact.setAddress("__address");
        contact.setAddressCity("__city");
        contact.setAddressCountry("__country");
View Full Code Here

Examples of org.geoserver.wms.WMSInfo

        assertXpathEvaluatesTo("e@mail", cinfo + "wms:ContactElectronicMailAddress", doc);
    }
   
    @Test
    public void testNoFeesOrContraints() throws Exception {
        final WMSInfo service = getGeoServer().getService(WMSInfo.class);
        service.setAccessConstraints(null);
        service.setFees(null);
        getGeoServer().save(service);

        Document doc = getAsDOM("wms?service=WMS&request=getCapabilities&version=1.3.0", true);
        print(doc);
View Full Code Here

Examples of org.geoserver.wms.WMSInfo

        kw.setVocabulary("bar");
        lines.getKeywords().add(kw);
       
        getCatalog().save(lines);

        WMSInfo wms = getGeoServer().getService(WMSInfo.class);
       
        kw = new Keyword("baz");
        kw.setVocabulary("bar");
        wms.getKeywords().add(kw);
        getGeoServer().save(wms);
       
        String linesName = MockData.LINES.getPrefix() + ":" + MockData.LINES.getLocalPart();
        Document doc = getAsDOM("wms?service=WMS&request=getCapabilities&version=1.3.0", true);
View Full Code Here

Examples of org.geoserver.wms.WMSInfo

        namespaces.put("ows", "http://www.opengis.net/ows");
    }
   
    @Test
    public void testRootLayer() throws Exception {
        WMSInfo serviceInfo = getWMS().getServiceInfo();
        addAuthUrl("rootAuth1", "http://geoserver/wms/auth1", serviceInfo.getAuthorityURLs());
        addAuthUrl("rootAuth2", "http://geoserver/wms/auth2", serviceInfo.getAuthorityURLs());
        addIdentifier("rootAuth1", "rootId1", serviceInfo.getIdentifiers());
        addIdentifier("rootAuth2", "rootId2", serviceInfo.getIdentifiers());
        getGeoServer().save(serviceInfo);

        Document doc = getAsDOM("/wms?service=WMS&request=getCapabilities&version=1.3.0", true);

        assertXpathExists(
View Full Code Here

Examples of org.geoserver.wms.WMSInfo

        namespaces.put("wms", "http://www.opengis.net/wms");
        namespaces.put("ows", "http://www.opengis.net/ows");
    }

    void addSRSAndSetFlag() {
        WMSInfo wms = getWMS().getServiceInfo();
        wms.getSRS().add("4326");
        wms.getSRS().add("3005");
        wms.setBBOXForEachCRS(true);
        getGeoServer().save(wms);
    }
View Full Code Here

Examples of org.geoserver.wms.WMSInfo

        getGeoServer().save(wms);
    }
   
    @After
    public void removeSRS() {
        WMSInfo wms = getWMS().getServiceInfo();
        wms.getSRS().remove("4326");
        wms.getSRS().remove("3005");
        wms.setBBOXForEachCRS(false);
        getGeoServer().save(wms);
    }
View Full Code Here

Examples of org.geoserver.wms.WMSInfo

   
   
    void addMimeTypes() {
        getMapFormat = new RenderedImageMapOutputFormat(getWMS());
        getInfoFormat = new TextFeatureInfoOutputFormat(getWMS());
        WMSInfo wms = getWMS().getServiceInfo();
        wms.getGetMapMimeTypes().add(getMapFormat.getMimeType());
        wms.getGetFeatureInfoMimeTypes().add(getInfoFormat.getContentType());
        wms.setGetMapMimeTypeCheckingEnabled(true);
        wms.setGetFeatureInfoMimeTypeCheckingEnabled(true);
        getGeoServer().save(wms);
    }
View Full Code Here

Examples of org.geoserver.wms.WMSInfo

    }

   
    @After
    public void removeMimeTypes () {
        WMSInfo wms = getWMS().getServiceInfo();
        wms.getGetMapMimeTypes().clear();
        wms.getGetFeatureInfoMimeTypes().clear();
        wms.setGetMapMimeTypeCheckingEnabled(false);
        wms.setGetFeatureInfoMimeTypeCheckingEnabled(false);
        getGeoServer().save(wms);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.