Examples of MockHttpClient


Examples of org.geoserver.test.http.MockHttpClient

        setupWMS110NfiLayer();
    }

    private void setupWMS130Layer() throws MalformedURLException, IOException {
        // prepare the WMS 1.3 mock client
        wms13Client = new MockHttpClient();
        wms13BaseURL = new URL(TestHttpClientProvider.MOCKSERVER + "/wms13");
        URL capsDocument = WMSTestSupport.class.getResource("caps130.xml");
        wms13Client.expectGet(new URL(wms13BaseURL + "?service=WMS&request=GetCapabilities&version=1.3.0"), new MockHttpResponse(capsDocument, "text/xml"));
        URL pngImage = WMSTestSupport.class.getResource("world.png");
        // we expect a getmap request with flipped coordinates
View Full Code Here

Examples of org.geoserver.test.http.MockHttpClient

        getCatalog().add(gsLayer);
    }
   
    private void setupWMS110Layer() throws MalformedURLException, IOException {
        // prepare the WMS 1.1 mock client
        wms11Client = new MockHttpClient();
        wms11BaseURL = new URL(TestHttpClientProvider.MOCKSERVER + "/wms11");
        URL capsDocument = WMSTestSupport.class.getResource("caps111.xml");
        wms11Client.expectGet(new URL(wms11BaseURL + "?service=WMS&request=GetCapabilities&version=1.1.1"), new MockHttpResponse(capsDocument, "text/xml"));
        URL pngImage = WMSTestSupport.class.getResource("world.png");
        // we expect a getmap request with flipped coordinates
View Full Code Here

Examples of org.geoserver.test.http.MockHttpClient

        getCatalog().add(gsLayer);
    }
   
    private void setupWMS110NfiLayer() throws MalformedURLException, IOException {
        // prepare the WMS 1.1 mock client
        wms11ClientNfi = new MockHttpClient();
        wms11BaseNfiURL = new URL(TestHttpClientProvider.MOCKSERVER + "/wms11_nfi");
        URL capsDocument = WMSTestSupport.class.getResource("caps111_no_feature_info.xml");
        wms11ClientNfi.expectGet(new URL(wms11BaseNfiURL + "?service=WMS&request=GetCapabilities&version=1.1.1"), new MockHttpResponse(capsDocument, "text/xml"));

        String caps = wms11BaseNfiURL + "?service=WMS&request=GetCapabilities&version=1.1.1";
View Full Code Here

Examples of org.geoserver.test.http.MockHttpClient

    @Test
    public void testWMSLayer111() throws Exception {
        TestHttpClientProvider.startTest();
        try {
            String baseURL = TestHttpClientProvider.MOCKSERVER + "/wms11";
            MockHttpClient client = new MockHttpClient();
            URL capsURL = new URL(baseURL + "?service=WMS&request=GetCapabilities&version=1.1.0");
            client.expectGet(capsURL,
                    new MockHttpResponse(getClass().getResource("caps111.xml"), "text/xml"));
            TestHttpClientProvider.bind(client, capsURL);
           
            CatalogBuilder cb = new CatalogBuilder(getCatalog());
            WMSStoreInfo store = cb.buildWMSStore("test-store");
View Full Code Here

Examples of org.geoserver.test.http.MockHttpClient

    @Test
    public void testWMSLayer130() throws Exception {
        TestHttpClientProvider.startTest();
        try {
            String baseURL = TestHttpClientProvider.MOCKSERVER + "/wms13";
            MockHttpClient client = new MockHttpClient();
            URL capsURL = new URL(baseURL + "?service=WMS&request=GetCapabilities&version=1.3.0");
            client.expectGet(capsURL,
                    new MockHttpResponse(getClass().getResource("caps130.xml"), "text/xml"));
            TestHttpClientProvider.bind(client, capsURL);
           
            CatalogBuilder cb = new CatalogBuilder(getCatalog());
            WMSStoreInfo store = cb.buildWMSStore("test-store");
View Full Code Here

Examples of org.geoserver.test.http.MockHttpClient

    @Test
    public void testWMSLayer130crs84() throws Exception {
        TestHttpClientProvider.startTest();
        try {
            String baseURL = TestHttpClientProvider.MOCKSERVER + "/wms13";
            MockHttpClient client = new MockHttpClient();
            URL capsURL = new URL(baseURL + "?service=WMS&request=GetCapabilities&version=1.3.0");
            client.expectGet(capsURL,
                    new MockHttpResponse(getClass().getResource("caps130_crs84.xml"), "text/xml"));
            TestHttpClientProvider.bind(client, capsURL);
           
            CatalogBuilder cb = new CatalogBuilder(getCatalog());
            WMSStoreInfo store = cb.buildWMSStore("test-store");
View Full Code Here

Examples of org.geotools.data.ows.MockHttpClient

     
      CoordinateReferenceSystem epsg26591 = CRS.decode("EPSG:26591");
      CoordinateReferenceSystem epsg4326 = CRS.decode("EPSG:4326");
     
        // prepare the responses
        MockHttpClient client = new MockHttpClient() {

            public HTTPResponse get(URL url) throws IOException {
                if (url.getQuery().contains("GetCapabilities")) {
                    URL caps = TestData.getResource(this, "geot553capabilities.xml");
                    return new MockHttpResponse(caps, "text/xml");
View Full Code Here

Examples of org.geotools.data.ows.MockHttpClient

    }

    private WMSCoverageReader getReader4326wms13() throws IOException, ServiceException,
            MalformedURLException {
        // prepare the responses
        MockHttpClient client = new MockHttpClient() {

            public HTTPResponse get(URL url) throws IOException {
                if (url.getQuery().contains("GetCapabilities")) {
                    URL caps130 = WMSCoverageReaderTest.class.getResource("caps130.xml");
                    return new MockHttpResponse(caps130, "text/xml");
View Full Code Here

Examples of org.geotools.data.ows.MockHttpClient

   
    private WMSCoverageReader getReader4326wms11() throws IOException, ServiceException,
            MalformedURLException {
        // prepare the responses
        MockHttpClient client = new MockHttpClient() {

            public HTTPResponse get(URL url) throws IOException {
                if (url.getQuery().contains("GetCapabilities")) {
                    URL caps130 = WMSCoverageReaderTest.class.getResource("caps110.xml");
                    return new MockHttpResponse(caps130, "text/xml");
View Full Code Here

Examples of org.geotools.data.ows.MockHttpClient

    }

    @Test
    public void testCrs84wms13() throws Exception {
        // prepare the responses
        MockHttpClient client = new MockHttpClient() {

            public HTTPResponse get(URL url) throws IOException {
                if (url.getQuery().contains("GetCapabilities")) {
                    URL caps130 = WMSCoverageReaderTest.class.getResource("caps130_crs84.xml");
                    return new MockHttpResponse(caps130, "text/xml");
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.