Package org.apache.sling.commons.testing.integration

Examples of org.apache.sling.commons.testing.integration.HttpAnyMethod


    public static final String WWW_Authenticate = "WWW-Authenticate";

    /** OPTIONS request at given path must return a WWW-Authenticate header */
    private void doTestOnPath(String path) throws Exception {
        final HttpClient noCredentialsClient = new HttpClient();
        final HttpAnyMethod opt = new HttpAnyMethod("OPTIONS", HTTP_BASE_URL + path);
        final int status = noCredentialsClient.executeMethod(opt);
        assertEquals("Expecting matching status on OPTIONS request at " + path, 401, status);
        final Header h = opt.getResponseHeader(WWW_Authenticate);
        assertNotNull("Expecting " + WWW_Authenticate + " header in response at " + path, h);
    }
View Full Code Here


        testClient.delete(testDirUrl);
    }

    public void testServiceRunning() throws IOException {
        final String url = getHandlerUrl(HANDLER_1);
        final HttpAnyMethod propfind = new HttpAnyMethod("PROPFIND",url);
        int status = httpClient.executeMethod(propfind);
        assertEquals("PROPFIND " + url + " must return status 207", 207, status);
        final String content = propfind.getResponseBodyAsString();
        assertContains(content, HANDLER);
    }
View Full Code Here

     * @param handlerName
     * @param identifier The expected handler identifier to be returned as a property.
     * @throws IOException
     */
    private void checkHandler(String handlerName, String identifier) throws IOException {
        final HttpAnyMethod propfind = new HttpAnyMethod("PROPFIND",handlerName);
        int status = httpClient.executeMethod(propfind);
        assertEquals("PROPFIND " + handlerName + " must return status 207", 207, status);
        final String content = propfind.getResponseBodyAsString();
        assertContains(content, identifier);
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.commons.testing.integration.HttpAnyMethod

Copyright © 2018 www.massapicom. 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.