Examples of BasicSecureHandler


Examples of org.apache.http.impl.cookie.BasicSecureHandler

        }
    }
   
    public void testBasicSecureParse() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieAttributeHandler h = new BasicSecureHandler();
        h.parse(cookie, "whatever");
        assertTrue(cookie.isSecure());
        h.parse(cookie, null);
        assertTrue(cookie.isSecure());
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicSecureHandler

        assertTrue(cookie.isSecure());
    }

    public void testBasicSecureMatch() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieAttributeHandler h = new BasicSecureHandler();

        CookieOrigin origin1 = new CookieOrigin("somehost", 80, "/stuff", false);
        cookie.setSecure(false);
        assertTrue(h.match(cookie, origin1));
        cookie.setSecure(true);
        assertFalse(h.match(cookie, origin1));

        CookieOrigin origin2 = new CookieOrigin("somehost", 80, "/stuff", true);
        cookie.setSecure(false);
        assertTrue(h.match(cookie, origin2));
        cookie.setSecure(true);
        assertTrue(h.match(cookie, origin2));
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicSecureHandler

        cookie.setSecure(true);
        assertTrue(h.match(cookie, origin2));
    }

    public void testBasicSecureInvalidInput() throws Exception {
        CookieAttributeHandler h = new BasicSecureHandler();
        try {
            h.parse(null, null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            h.match(null, null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            h.match(new BasicClientCookie("name", "value"), null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicSecureHandler

        }
    }
   
    public void testBasicSecureParse() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieAttributeHandler h = new BasicSecureHandler();
        h.parse(cookie, "whatever");
        assertTrue(cookie.isSecure());
        h.parse(cookie, null);
        assertTrue(cookie.isSecure());
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicSecureHandler

        assertTrue(cookie.isSecure());
    }

    public void testBasicSecureMatch() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieAttributeHandler h = new BasicSecureHandler();

        CookieOrigin origin1 = new CookieOrigin("somehost", 80, "/stuff", false);
        cookie.setSecure(false);
        assertTrue(h.match(cookie, origin1));
        cookie.setSecure(true);
        assertFalse(h.match(cookie, origin1));

        CookieOrigin origin2 = new CookieOrigin("somehost", 80, "/stuff", true);
        cookie.setSecure(false);
        assertTrue(h.match(cookie, origin2));
        cookie.setSecure(true);
        assertTrue(h.match(cookie, origin2));
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicSecureHandler

        cookie.setSecure(true);
        assertTrue(h.match(cookie, origin2));
    }

    public void testBasicSecureInvalidInput() throws Exception {
        CookieAttributeHandler h = new BasicSecureHandler();
        try {
            h.parse(null, null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            h.match(null, null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            h.match(new BasicClientCookie("name", "value"), null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicSecureHandler

        }
    }
   
    public void testBasicSecureParse() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieAttributeHandler h = new BasicSecureHandler();
        h.parse(cookie, "whatever");
        assertTrue(cookie.isSecure());
        h.parse(cookie, null);
        assertTrue(cookie.isSecure());
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicSecureHandler

        assertTrue(cookie.isSecure());
    }

    public void testBasicSecureMatch() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieAttributeHandler h = new BasicSecureHandler();

        CookieOrigin origin1 = new CookieOrigin("somehost", 80, "/stuff", false);
        cookie.setSecure(false);
        assertTrue(h.match(cookie, origin1));
        cookie.setSecure(true);
        assertFalse(h.match(cookie, origin1));

        CookieOrigin origin2 = new CookieOrigin("somehost", 80, "/stuff", true);
        cookie.setSecure(false);
        assertTrue(h.match(cookie, origin2));
        cookie.setSecure(true);
        assertTrue(h.match(cookie, origin2));
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicSecureHandler

        cookie.setSecure(true);
        assertTrue(h.match(cookie, origin2));
    }

    public void testBasicSecureInvalidInput() throws Exception {
        CookieAttributeHandler h = new BasicSecureHandler();
        try {
            h.parse(null, null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            h.match(null, null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
            h.match(new BasicClientCookie("name", "value"), null);
            fail("IllegalArgumentException must have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicSecureHandler

    }

    @Test
    public void testBasicSecureParse() throws Exception {
        BasicClientCookie cookie = new BasicClientCookie("name", "value");
        CookieAttributeHandler h = new BasicSecureHandler();
        h.parse(cookie, "whatever");
        Assert.assertTrue(cookie.isSecure());
        h.parse(cookie, null);
        Assert.assertTrue(cookie.isSecure());
    }
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.