Search in sources :

Example 91 with NameValuePair

use of org.apache.commons.httpclient.NameValuePair in project ecf by eclipse.

the class TestCookieCompatibilitySpec method testParseAttributeBlankPath.

public void testParseAttributeBlankPath() throws Exception {
    CookieSpec cookiespec = new CookieSpecBase();
    Cookie cookie = new Cookie();
    cookiespec.parseAttribute(new NameValuePair("path", "   "), cookie);
    assertEquals("/", cookie.getPath());
}
Also used : Cookie(org.apache.commons.httpclient.Cookie) NameValuePair(org.apache.commons.httpclient.NameValuePair)

Example 92 with NameValuePair

use of org.apache.commons.httpclient.NameValuePair in project ecf by eclipse.

the class TestCookieNetscapeDraft method testParseAttributeInvalidCookieExpires.

public void testParseAttributeInvalidCookieExpires() throws Exception {
    CookieSpec cookiespec = new NetscapeDraftSpec();
    Cookie cookie = new Cookie();
    try {
        cookiespec.parseAttribute(new NameValuePair("expires", null), cookie);
        fail("MalformedCookieException must have been thrown");
    } catch (MalformedCookieException expected) {
    }
}
Also used : Cookie(org.apache.commons.httpclient.Cookie) NameValuePair(org.apache.commons.httpclient.NameValuePair)

Example 93 with NameValuePair

use of org.apache.commons.httpclient.NameValuePair in project ecf by eclipse.

the class TestCookieNetscapeDraft method testParseAttributeInvalidCookie.

public void testParseAttributeInvalidCookie() throws Exception {
    CookieSpec cookiespec = new NetscapeDraftSpec();
    try {
        cookiespec.parseAttribute(new NameValuePair("name", "value"), null);
        fail("IllegalArgumentException must have been thrown");
    } catch (IllegalArgumentException expected) {
    }
}
Also used : NameValuePair(org.apache.commons.httpclient.NameValuePair)

Example 94 with NameValuePair

use of org.apache.commons.httpclient.NameValuePair in project ecf by eclipse.

the class TestCookieRFC2109Spec method testParseAttributeNullPath.

public void testParseAttributeNullPath() throws Exception {
    CookieSpec cookiespec = new RFC2109Spec();
    try {
        Cookie cookie = new Cookie();
        cookiespec.parseAttribute(new NameValuePair("path", null), cookie);
        fail("MalformedCookieException must have been thrown");
    } catch (MalformedCookieException expected) {
    }
}
Also used : Cookie(org.apache.commons.httpclient.Cookie) NameValuePair(org.apache.commons.httpclient.NameValuePair)

Example 95 with NameValuePair

use of org.apache.commons.httpclient.NameValuePair in project ecf by eclipse.

the class TestCookieRFC2109Spec method testParseAttributeInvalidCookie.

public void testParseAttributeInvalidCookie() throws Exception {
    CookieSpec cookiespec = new RFC2109Spec();
    try {
        cookiespec.parseAttribute(new NameValuePair("name", "value"), null);
        fail("IllegalArgumentException must have been thrown");
    } catch (IllegalArgumentException expected) {
    }
}
Also used : NameValuePair(org.apache.commons.httpclient.NameValuePair)

Aggregations

NameValuePair (org.apache.commons.httpclient.NameValuePair)217 ArrayList (java.util.ArrayList)114 Credentials (org.apache.commons.httpclient.Credentials)64 UsernamePasswordCredentials (org.apache.commons.httpclient.UsernamePasswordCredentials)64 Test (org.junit.Test)61 HttpTest (org.apache.sling.commons.testing.integration.HttpTest)49 JsonObject (javax.json.JsonObject)43 PostMethod (org.apache.commons.httpclient.methods.PostMethod)41 HashMap (java.util.HashMap)28 IOException (java.io.IOException)23 Header (org.apache.commons.httpclient.Header)21 JsonArray (javax.json.JsonArray)20 HttpClient (org.apache.commons.httpclient.HttpClient)19 HashSet (java.util.HashSet)17 HttpMethod (org.apache.commons.httpclient.HttpMethod)16 GetMethod (org.apache.commons.httpclient.methods.GetMethod)16 Cookie (org.apache.commons.httpclient.Cookie)13 GetRequest (org.eclipse.ecf.internal.bulletinboard.commons.webapp.GetRequest)10 LinkedList (java.util.LinkedList)8 Map (java.util.Map)8