Package org.jasig.portal.security.provider

Examples of org.jasig.portal.security.provider.PersonImpl


    /**
     * Creates an empty <code>IPerson</code> implementation.
     * @return an empty <code>IPerson</code> implementation
     */
    public static IPerson createPerson() {
        return new PersonImpl();
    }
View Full Code Here


public class ParenTest extends TestCase {

    public void testIsApplicable() {
       
        IPerson p = new PersonImpl();
       
        // Paren.Type.OR...
        Paren orParen = new Paren(Paren.Type.OR);
        orParen.addEvaluator(new AllUsersEvaluatorFactory());
        assertTrue("true should make true", orParen.isApplicable(p));
View Full Code Here

        this.cacheManager = cacheManager;
    }

    public void testBatchStore() throws Exception {
        for (int runCount = 0; runCount < 10; runCount++) {
            final PersonImpl adminPerson = new PersonImpl();
            adminPerson.setAttribute(IPerson.USERNAME, "admin");
            this.jpaPortalEventStore.addPersonGroups(adminPerson, new HashSet<String>(Arrays.asList("admin")));
           
            final PersonImpl studentPerson = new PersonImpl();
            studentPerson.setAttribute(IPerson.USERNAME, "student");
            this.jpaPortalEventStore.addPersonGroups(studentPerson, new HashSet<String>(Arrays.asList("student")));
           
            final PersonImpl facStaffPerson = new PersonImpl();
            facStaffPerson.setAttribute(IPerson.USERNAME, "facStaff");
            this.jpaPortalEventStore.addPersonGroups(facStaffPerson, new HashSet<String>(Arrays.asList("faculty", "staff", "admin")));
           
            UserLoggedInPortalEvent loggedInPortalEvent;
            UserLoggedOutPortalEvent loggedOutPortalEvent;
            final Queue<PortalEvent> eventQueue = new LinkedList<PortalEvent>();
View Full Code Here

     * Test that when no ICasSecurityContext is present,
     * the CasConnectionContext does not modify descriptors.
     */
    public void testNoCasSecurityContextPresent() {
       
        PersonImpl person = new PersonImpl();
        // not a CAS security context
        BrokenSecurityContext brokenContext = new BrokenSecurityContext();
       
        person.setSecurityContext(brokenContext);
       
        ChannelStaticData staticData = new ChannelStaticData();
        staticData.setPerson(person);
       
        CasConnectionContext connectionContext = new CasConnectionContext();
View Full Code Here

    /**
     * When an ICasSecurityContext is present but unauthenticated,
     * CasConnectionContext will ignore it.
     */
    public void testUnauthenticatedCasSecurityContext() {
        PersonImpl person = new PersonImpl();
        // a CAS security context
        CasSecurityContextMock mockCasContext = new CasSecurityContextMock();
        mockCasContext.setAuthenticated(false);
       
        person.setSecurityContext(mockCasContext);
       
        ChannelStaticData staticData = new ChannelStaticData();
        staticData.setPerson(person);
       
        CasConnectionContext connectionContext = new CasConnectionContext();
View Full Code Here

    /**
     * When an ICasSecurityContext is present, CasConnectionContext will
     * use the ICasSecurityContext as a source of proxy tickets
     */
    public void testCasSecurityContext() {
        PersonImpl person = new PersonImpl();
        // a CAS security context
        CasSecurityContextMock mockCasContext = new CasSecurityContextMock();
        mockCasContext.setAuthenticated(true);
       
        List proxyTickets = new ArrayList();
        proxyTickets.add("proxyTicket1");
        proxyTickets.add("proxyTicket2");
        proxyTickets.add("proxyTicket3");
       
        mockCasContext.setServiceTokensToVend(proxyTickets);
       
        person.setSecurityContext(mockCasContext);
       
        ChannelStaticData staticData = new ChannelStaticData();
        staticData.setPerson(person);
       
        CasConnectionContext connectionContext = new CasConnectionContext();
View Full Code Here

    /**
     * When the Http request method is post,
     * CasConnectionContext returns the descriptor unaltered.
     */
    public void testPostCasSecurityContext() {
        PersonImpl person = new PersonImpl();
        // a CAS security context
        CasSecurityContextMock mockCasContext = new CasSecurityContextMock();
        mockCasContext.setAuthenticated(true);
       
        List proxyTickets = new ArrayList();
        proxyTickets.add("proxyTicket1");
        proxyTickets.add("proxyTicket2");
        proxyTickets.add("proxyTicket3");
       
        mockCasContext.setServiceTokensToVend(proxyTickets);
       
        person.setSecurityContext(mockCasContext);
       
        ChannelStaticData staticData = new ChannelStaticData();
        staticData.setPerson(person);
       
        CasConnectionContext connectionContext = new CasConnectionContext();
View Full Code Here

     * CasConnectionContext passes to the ICasSecurityContext for acquisition
     * of a proxy ticket, but it *does not* change the descriptor the
     * CasConnectionContext uses to compose the modified descriptor it returns.
     */
    public void testStaticData() {
        PersonImpl person = new PersonImpl();
        // a CAS security context
        CasSecurityContextMock mockCasContext = new CasSecurityContextMock();
        mockCasContext.setAuthenticated(true);
       
        List proxyTickets = new ArrayList();
        proxyTickets.add("proxyTicket1");
        proxyTickets.add("proxyTicket2");
        proxyTickets.add("proxyTicket3");
        proxyTickets.add("proxyTicket4");
       
        mockCasContext.setServiceTokensToVend(proxyTickets);
       
        person.setSecurityContext(mockCasContext);
       
        ChannelStaticData staticData = new ChannelStaticData();
        staticData.setPerson(person);
        String staticallyDefinedUri = "https://statically.defined.uri.com/";
        staticData.setParameter("upc_cas_service_uri", staticallyDefinedUri);
View Full Code Here

     * When neither are present, it attempts to acquire a proxy ticket targetted
     * at the null service.
     */
    public void testGetPostData() {
       
        PersonImpl person = new PersonImpl();
        // a CAS security context
        CasSecurityContextMock mockCasContext = new CasSecurityContextMock();
        mockCasContext.setAuthenticated(true);
       
        List proxyTickets = new ArrayList();
        proxyTickets.add("proxyTicket1");
        proxyTickets.add("proxyTicket2");
        proxyTickets.add("proxyTicket3");
        proxyTickets.add("proxyTicket4");
       
        mockCasContext.setServiceTokensToVend(proxyTickets);
       
        person.setSecurityContext(mockCasContext);
       
        ChannelStaticData staticData = new ChannelStaticData();
        staticData.setPerson(person);
       
        CasConnectionContext connectionContext = new CasConnectionContext();
View Full Code Here

        this.jpaPortalEventStore = dao;
    }
   
   
    public void testStoreAllEvents() throws Exception {
        PersonImpl person = new PersonImpl();
        person.setID(1);
        person.setAttribute(IPerson.USERNAME, "admin");
        final Set<String> groups = Collections.emptySet();
        this.jpaPortalEventStore.addPersonGroups(person, groups);
       
       
        PortalEvent portalEvent;
View Full Code Here

TOP

Related Classes of org.jasig.portal.security.provider.PersonImpl

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.