Package org.jasig.portal.security.provider

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


     *
     * @throws IOException
     */
    public void testBasicAuth() throws IOException{
       
        BasicLocalConnectionContext context = new BasicLocalConnectionContext();
       
        // create static data
        ChannelStaticData sd = new ChannelStaticData();
        sd.setParameter("remote.username",USERNAME);
        sd.setParameter("remote.password",PASSWORD);
       
        // init context with static data
        context.init(sd);

        // create Http Connection
        HttpURLConnection conn =  new MockHttpConn();
       
        // create runtime data
        ChannelRuntimeData rd = new ChannelRuntimeData();
       
        // call method to test
        context.sendLocalData(conn,rd);

        // verify that request property was set right
        String authHeader = conn.getRequestProperty("Authorization");
        assertEquals("Basic "+ENCODED_USER_PASS,authHeader);
    }
View Full Code Here


     *
     * @throws IOException
     */
    public void testBasicAuth() throws IOException{
       
        BasicLocalConnectionContext context = new BasicLocalConnectionContext();
       
        // create static data
        ChannelStaticData sd = new ChannelStaticData();
        sd.setParameter("remote.username",USERNAME);
        sd.setParameter("remote.password",PASSWORD);
       
        // init context with static data
        context.init(sd);

        // create Http Connection
        HttpURLConnection conn =  new MockHttpConn();
       
        // create runtime data
        ChannelRuntimeData rd = new ChannelRuntimeData();
       
        // call method to test
        context.sendLocalData(conn,rd);

        // verify that request property was set right
        String authHeader = conn.getRequestProperty("Authorization");
        assertEquals("Basic "+ENCODED_USER_PASS,authHeader);
    }
View Full Code Here

TOP

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

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.