Examples of RedirectStrategy


Examples of org.apache.http.client.RedirectStrategy

        DefaultHttpClient client = new DefaultHttpClient();
        HttpGet get = new HttpGet(originalUrl.toString());
        get.setHeader("User-Agent", "Mozilla");
        get.setHeader("Connection", "close");

        client.setRedirectStrategy(new RedirectStrategy() {

          @Override
          public boolean isRedirected(HttpRequest hr, HttpResponse hr1, HttpContext hc) throws ProtocolException {
            return false;
          }
View Full Code Here

Examples of org.apache.http.client.RedirectStrategy

                routePlannerCopy = new DefaultRoutePlanner(schemePortResolverCopy);
            }
        }
        // Add redirect executor, if not disabled
        if (!redirectHandlingDisabled) {
            RedirectStrategy redirectStrategyCopy = this.redirectStrategy;
            if (redirectStrategyCopy == null) {
                redirectStrategyCopy = DefaultRedirectStrategy.INSTANCE;
            }
            execChain = new RedirectExec(execChain, routePlannerCopy, redirectStrategyCopy);
        }
View Full Code Here

Examples of org.apache.http.client.RedirectStrategy

        String contents = null;
       
        HttpClient httpClient = new DefaultHttpClient();

        // Set no redirect
        ((DefaultHttpClient)httpClient).setRedirectStrategy(new RedirectStrategy() {
            @Override
            public boolean isRedirected(HttpRequest httpRequest, HttpResponse httpResponse, HttpContext httpContext) {
                return false;
            }
View Full Code Here

Examples of org.apache.http.client.RedirectStrategy

                .setBufferSize(clientPolicy.getChunkLength() > 0 ? clientPolicy.getChunkLength() : 16332)
                .build();

        connectionManager.setDefaultConnectionConfig(connectionConfig);

        RedirectStrategy redirectStrategy = new RedirectStrategy() {

            public boolean isRedirected(HttpRequest request, HttpResponse response, HttpContext context)
                throws ProtocolException {
                return false;
            }
View Full Code Here

Examples of org.apache.http.client.RedirectStrategy

                routePlanner = new DefaultRoutePlanner(schemePortResolver);
            }
        }
        // Add redirect executor, if not disabled
        if (!redirectHandlingDisabled) {
            RedirectStrategy redirectStrategy = this.redirectStrategy;
            if (redirectStrategy == null) {
                redirectStrategy = DefaultRedirectStrategy.INSTANCE;
            }
            execChain = new RedirectExec(execChain, routePlanner, redirectStrategy);
        }
View Full Code Here

Examples of org.apache.http.client.RedirectStrategy

            } else {
                routePlanner = new DefaultRoutePlanner(schemePortResolver);
            }
        }
        if (!redirectHandlingDisabled) {
            RedirectStrategy redirectStrategy = this.redirectStrategy;
            if (redirectStrategy == null) {
                redirectStrategy = DefaultRedirectStrategy.INSTANCE;
            }
            execChain = new RedirectExec(execChain, routePlanner, redirectStrategy);
        }
View Full Code Here

Examples of org.springframework.security.web.RedirectStrategy

    }

    @Test
    public void onAuthenticationSuccessHasSavedRequest() throws Exception {
        String redirectUrl = "http://localhost/appcontext/page";
        RedirectStrategy redirectStrategy = mock(RedirectStrategy.class);
        RequestCache requestCache = mock(RequestCache.class);
        SavedRequest savedRequest = mock(SavedRequest.class);
        MockHttpServletRequest request = new MockHttpServletRequest();
        MockHttpServletResponse response = new MockHttpServletResponse();
        when(savedRequest.getRedirectUrl()).thenReturn(redirectUrl);
View Full Code Here

Examples of org.springframework.security.web.RedirectStrategy

public class SimpleUrlAuthenticationFailureHandlerTests {

    @Test
    public void error401IsReturnedIfNoUrlIsSet() throws Exception {
        SimpleUrlAuthenticationFailureHandler afh = new SimpleUrlAuthenticationFailureHandler();
        RedirectStrategy rs = mock(RedirectStrategy.class);
        afh.setRedirectStrategy(rs);
        assertSame(rs, afh.getRedirectStrategy());
        MockHttpServletRequest request = new MockHttpServletRequest();
        MockHttpServletResponse response = new MockHttpServletResponse();
View Full Code Here

Examples of org.springframework.security.web.RedirectStrategy

    public void testGettersSetters() {
        RetryWithHttpEntryPoint ep = new RetryWithHttpEntryPoint();
        PortMapper portMapper = mock(PortMapper.class);
        PortResolver portResolver = mock(PortResolver.class);
        RedirectStrategy redirector = mock(RedirectStrategy.class);
        ep.setPortMapper(portMapper);
        ep.setPortResolver(portResolver);
        ep.setRedirectStrategy(redirector);
        assertSame(portMapper, ep.getPortMapper());
        assertSame(portResolver, ep.getPortResolver());
View Full Code Here

Examples of org.springframework.security.web.RedirectStrategy

  public void testAuthenticationSuccess() throws Exception {

    UserAuthorizationSuccessfulAuthenticationHandler handler = new UserAuthorizationSuccessfulAuthenticationHandler();
    HttpServletRequest request = mock(HttpServletRequest.class);
    HttpServletResponse response = mock(HttpServletResponse.class);
    RedirectStrategy redirectStrategy = mock(RedirectStrategy.class);
    handler.setRedirectStrategy(redirectStrategy);

    when(request.getAttribute(UserAuthorizationProcessingFilter.CALLBACK_ATTRIBUTE)).thenReturn(
        "http://my.host.com/my/context");
    when(request.getAttribute(UserAuthorizationProcessingFilter.VERIFIER_ATTRIBUTE)).thenReturn("myver");
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.