Package org.apache.cactus

Examples of org.apache.cactus.WebRequest


            resource = webConfig.getRedirectorURL(theRequest);

            HttpClientConnectionHelper helper =
                new HttpClientConnectionHelper(resource);

            WebRequest request = getDummyRequest(webConfig);
            request.addCookie(this.jsessionCookie);

            // Make the connection using a default web request.
            connection = helper.connect(request, theConfiguration);
        }
        catch (Throwable e)
View Full Code Here


     * @param theWebConfiguration the <code>WebConfiguration</code> value
     * @return WebReuest instance
     */
    private WebRequest getDummyRequest(WebConfiguration theWebConfiguration)
    {
        WebRequest request = new WebRequestImpl(theWebConfiguration);
        request.addParameter(HttpServiceDefinition.SERVICE_NAME_PARAM,
            ServiceEnumeration.RUN_TEST_SERVICE.toString());
        return request;
    }
View Full Code Here

            resource = webConfig.getRedirectorURL(theRequest);

            HttpClientConnectionHelper helper =
                new HttpClientConnectionHelper(resource);

            WebRequest request = getDummyRequest(webConfig);

            // Make the connection using a default web request.
            connection = helper.connect(request, theConfiguration);

            checkPreAuthResponse(connection);
View Full Code Here

                new HttpClientConnectionHelper(
                    getSecurityCheckURL(theConfiguration).toString());

            // Configure a web request with the JSESSIONID cookie,
            // the username and the password.
            WebRequest request = getSecurityRequest();
            ((WebRequestImpl) request).setConfiguration(theConfiguration);
            request.addCookie(this.jsessionCookie);
            request.addParameter("j_username", getName(),
                WebRequest.POST_METHOD);
            request.addParameter("j_password", getPassword(),
                WebRequest.POST_METHOD);

            // Make the connection using the configured web request.
            HttpURLConnection connection = helper.connect(request,
                theConfiguration);
View Full Code Here

     */
    private WebTestResult callGetResult(
        AbstractAuthentication theAuthentication) throws Throwable
    {
        // Add authentication details
        WebRequest resultsRequest = new WebRequest();
        resultsRequest.addParameter(ServiceDefinition.SERVICE_NAME_PARAM,
            ServiceEnumeration.GET_RESULTS_SERVICE.toString(),
            WebRequest.GET_METHOD);
        resultsRequest.setAuthentication(theAuthentication);

        // Open the second connection to get the test results
        HttpClientHelper helper =
            new HttpClientHelper(getRedirectorURL(resultsRequest));

View Full Code Here

            new HttpProtocolHandler(new DefaultServletConfiguration()));

        try
        {
            // Call the begin method
            WebRequest request =
                new WebRequestImpl(new DefaultServletConfiguration());

            delegator.callBeginMethod(request);

            // Create a mock HttpURLConnection as it is needed by HttpUnit
View Full Code Here

     * @exception Exception on error
     */
    public void testCreateHttpStateWhenNoCactusCookieDefined()
        throws Exception
    {
        WebRequest request = new WebRequestImpl();
        HttpState state = new HttpState();
        state.addCookies(CookieUtil.createHttpClientCookies(request,
            new URL("http://jakarta.apache.org")));
        assertEquals(0, state.getCookies().length);
    }
View Full Code Here

     * @exception Exception on error
     */
    public void testCreateHttpStateWhenSeveralCactusCookieExist()
        throws Exception
    {
        WebRequest request = new WebRequestImpl();
        request.addCookie(new Cookie("domain1", "name1", "value1"));
        request.addCookie(new Cookie("domain2", "name2", "value2"));
       
        HttpState state = new HttpState();
        state.addCookies(CookieUtil.createHttpClientCookies(request,
            new URL("http://jakarta.apache.org")));

View Full Code Here

     * @see ProtocolHandler#runTest(Test, Test, Request)
     */
    public ProtocolState runTest(Test theDelegatedTest, Test theWrappedTest,
        Request theRequest) throws Throwable
    {
        WebRequest request = (WebRequest) theRequest;

        // Run the web test
        HttpURLConnection connection = runWebTest(theDelegatedTest,
            theWrappedTest, request);

View Full Code Here

     *            redirector servlet.
     */
    private WebTestResult callGetResult(WebRequest theOriginalRequest)
        throws Throwable
    {
        WebRequest resultsRequest = new WebRequestImpl(this.configuration);
        RequestDirectives directives = new RequestDirectives(resultsRequest);
        directives.setService(ServiceEnumeration.GET_RESULTS_SERVICE);

        // Use the same redirector as was used by the original request
        resultsRequest.setRedirectorName(
            theOriginalRequest.getRedirectorName());
       
        // Add authentication details
        if (theOriginalRequest.getAuthentication() != null)
        {
            resultsRequest.setAuthentication(
                theOriginalRequest.getAuthentication());
        }

        // Open the second connection to get the test results
        HttpClientConnectionHelper helper =
View Full Code Here

TOP

Related Classes of org.apache.cactus.WebRequest

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.