⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cas20proxyhandlertests.java

📁 CAS在Tomcat中实现单点登录项目,单点登录(Single Sign On , 简称 SSO )是目前比较流行的服务于企业业务整合的解决方案之一
💻 JAVA
字号:
/* * Copyright 2004 The JA-SIG Collaborative. All rights reserved. See license * distributed with this file and available online at * http://www.ja-sig.org/products/cas/overview/license/ */package org.jasig.cas.ticket.proxy.support;import java.net.URL;import org.jasig.cas.authentication.principal.HttpBasedServiceCredentials;import org.jasig.cas.util.DefaultUniqueTicketIdGenerator;import org.jasig.cas.util.HttpClient;import junit.framework.TestCase;/** * @author Scott Battaglia * @version $Revision: 41982 $ $Date: 2007-05-30 15:35:47 -0400 (Wed, 30 May 2007) $ * @since 3.0 */public class Cas20ProxyHandlerTests extends TestCase {    private Cas20ProxyHandler handler;    protected void setUp() throws Exception {        this.handler = new Cas20ProxyHandler();        this.handler.setHttpClient(new HttpClient());        this.handler.setUniqueTicketIdGenerator(new DefaultUniqueTicketIdGenerator());    }    public void testValidProxyTicketWithoutQueryString() throws Exception {        assertNotNull(this.handler.handle(new HttpBasedServiceCredentials(            new URL("http://www.rutgers.edu/")), "proxyGrantingTicketId"));    }    public void testValidProxyTicketWithQueryString() throws Exception {        assertNotNull(this.handler.handle(new HttpBasedServiceCredentials(            new URL("http://www.rutgers.edu/?test=test")),            "proxyGrantingTicketId"));    }    public void testNonValidProxyTicket() throws Exception {        final HttpClient httpClient = new HttpClient();        httpClient.setAcceptableCodes(new int[] {900});        this.handler.setHttpClient(httpClient);        assertNull(this.handler.handle(new HttpBasedServiceCredentials(new URL(            "http://www.rutgers.edu")), "proxyGrantingTicketId"));    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -