Package org.beangle.security.cas

Examples of org.beangle.security.cas.CasConfig


  CasConfig config;

  @BeforeMethod
  public void setUp() {
    filter = new CasPreauthFilter();
    config = new CasConfig();
    filter.setConfig(config);
    config.setLocalServer("http://localhost/demo");
  }
View Full Code Here


@Test
public class CasEntryPointTest {

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testDetectsMissingUrl() throws Exception {
    CasConfig config = new CasConfig();
    config.afterPropertiesSet();
    CasEntryPoint ep = new CasEntryPoint(config);
    ep.afterPropertiesSet();
  }
View Full Code Here

  public void testDetectsMissingConfig() throws Exception {
    new CasEntryPoint().afterPropertiesSet();
  }

  public void testGettersSetters() {
    CasConfig config = new CasConfig("https://cas", null);
    assertEquals("https://cas", config.getCasServer());

    CasEntryPoint ep = new CasEntryPoint(config);
    assertTrue(ep.getConfig() != null);
  }
View Full Code Here

    CasEntryPoint ep = new CasEntryPoint(config);
    assertTrue(ep.getConfig() != null);
  }

  public void testNormalOperationWithRenewFalse() throws Exception {
    CasConfig config = new CasConfig("https://cas", "https://mycompany.com/bigWebApp");
    config.setRenew(false);
    CasEntryPoint ep = new CasEntryPoint(config);
    MockHttpServletRequest request = new MockHttpServletRequest(null, "/some_path");
    MockHttpServletResponse response = new MockHttpServletResponse();
    ep.afterPropertiesSet();
    ep.commence(request, response, null);
View Full Code Here

        "https://cas/login?service="
            + URLEncoder.encode("https://mycompany.com/bigWebApp/some_path", "UTF-8"));
  }

  public void testNormalOperationWithRenewTrue() throws Exception {
    CasConfig config = new CasConfig("https://cas", "https://mycompany.com/bigWebApp");
    config.setRenew(true);
    CasEntryPoint ep = new CasEntryPoint(config);
    MockHttpServletRequest request = new MockHttpServletRequest(null, "/some_path");
    MockHttpServletResponse response = new MockHttpServletResponse();
    ep.afterPropertiesSet();
    ep.commence(request, response, null);
View Full Code Here

*/
@Test
public class CommonUtilsTest {

  public void testConstuctServiceUrl() {
    CasConfig config = new CasConfig();
    config.setCasServer("http://www.mycompany.com/cas");
    config.setLocalServer("localhost:8080/demo");
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setContextPath("/demo");
    request.setServletPath("/home.action");
    request.setRequestURI("/demo/home.action");
    System.out.println(request.getRequestURI());
    HttpServletResponse response = new MockHttpServletResponse();
    final String urlEncodedService = CommonUtils.constructServiceUrl(request, response, null,
        config.getLocalServer(), "ticket", config.isEncode());
    System.out.println(urlEncodedService);

    final String urlEncodedService2 = CommonUtils.constructServiceUrl(request, response, null,
        "localhost:8080", "ticket", config.isEncode());
   
    System.out.println(urlEncodedService2);
  }
View Full Code Here

*/
@Test
public class CommonUtilsTest {

  public void testConstuctServiceUrl() {
    CasConfig config = new CasConfig();
    config.setCasServer("http://www.mycompany.com/cas");
    config.setLocalServer("localhost:8080/demo");
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setContextPath("/demo");
    request.setServletPath("/home.action");
    request.setRequestURI("/demo/home.action");
    System.out.println(request.getRequestURI());
    HttpServletResponse response = new MockHttpServletResponse();
    final String urlEncodedService = CommonUtils.constructServiceUrl(request, response, null,
        config.getLocalServer(), "ticket", config.isEncode());
    System.out.println(urlEncodedService);
  }
View Full Code Here

TOP

Related Classes of org.beangle.security.cas.CasConfig

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.