Package com.volantis.shared.net.http

Examples of com.volantis.shared.net.http.HTTPMessageEntities.retrieve()


        // sleep for 1.2 seconds. This should give an age of 1 second due to
        // the conservative nature of the age calculation. This will be added
        // to the age header in the response
        Thread.sleep(1200);
        HTTPMessageEntities headers = resp.getHeaders();
        HTTPMessageEntity[] ages = headers.retrieve(AGE_HEADER);

        assertNotNull("There should be an age header", ages);
        // check that we have calcualted the age to the page to be 1 second
        // (its always rounded down)
        assertEquals("Age should be 3 second", 3,
View Full Code Here


        // sleep for 1.2 seconds. This should give an age of 1 second due to
        // the conservative nature of the age calculation.
        Thread.sleep(1200);
        HTTPMessageEntities headers = resp.getHeaders();
        HTTPMessageEntity[] ages = headers.retrieve(AGE_HEADER);

        // check that we have calcualted the age to the page to be about 1
        // second (its always rounded down)
        int age = Integer.parseInt(ages[0].getValue());
        assertTrue("Age should be greater then 0 and less then 2",
View Full Code Here

        HTTPMessageEntities headers = response.getHeaders();
        Header expected =
                HTTPFactory.getDefaultInstance().createHeader(expectedName);

        Header[] headerArray = (Header[]) headers.retrieve(
                expected.getIdentity());

        assertNotNull("Should be a " + expectedName + " header", headerArray);
        assertEquals("Should only be a single " + expectedName + " header",
                     1,
View Full Code Here

        HTTPMessageEntities headers = response.getHeaders();
        int expectedCount = expectedValues.size();

        Header expected = HTTPFactory.getDefaultInstance().createHeader(
                expectedName);
        Header[] headerArray = (Header[]) headers.retrieve(
                expected.getIdentity());

        assertNotNull("Should be " + expectedName + " headers", headerArray);
        assertEquals("Should only be " + expectedCount + " " + expectedName +
                     " headers",
View Full Code Here

    private void assertSingleCookie(
            WebDriverResponse response,
                                    Cookie expected) {

        HTTPMessageEntities cookies = response.getCookies();
        Cookie[] cookieArray = (Cookie[]) cookies.retrieve(
                expected.getIdentity());

        assertNotNull("Should be a " + expected.getName() + " cookie",
                      cookieArray);
        assertEquals("Should only be a single " + expected.getName() +
View Full Code Here

        // the multiple cookies should have the same identity
        Cookie cookie = (Cookie) expectedCookies.get(0);
        CookieIdentity expectedIdentity = (CookieIdentity) cookie.getIdentity();

        int expectedCount = expectedCookies.size();
        Cookie[] cookieArray = (Cookie[]) cookies.retrieve(expectedIdentity);

        assertNotNull("Should be " + expectedName + " cookies", cookieArray);
        assertEquals("Should only be " + expectedCount + " " + expectedName +
                     " cookies",
                     expectedCount,
View Full Code Here

        assertEquals("There should be 3 cookies", 3, cookieJar.size());

        assertEquals("Checking cookie 1",
                     cookie1,
                     cookieJar.retrieve(cookie1.getIdentity())[0]);
        assertEquals("Checking cookie 2",
                     cookie2,
                     cookieJar.retrieve(cookie2.getIdentity())[1]);
        assertEquals("Checking cookie 3",
                     cookie3,
View Full Code Here

        assertEquals("Checking cookie 1",
                     cookie1,
                     cookieJar.retrieve(cookie1.getIdentity())[0]);
        assertEquals("Checking cookie 2",
                     cookie2,
                     cookieJar.retrieve(cookie2.getIdentity())[1]);
        assertEquals("Checking cookie 3",
                     cookie3,
                     cookieJar.retrieve(cookie3.getIdentity())[0]);
    }
View Full Code Here

        assertEquals("Checking cookie 2",
                     cookie2,
                     cookieJar.retrieve(cookie2.getIdentity())[1]);
        assertEquals("Checking cookie 3",
                     cookie3,
                     cookieJar.retrieve(cookie3.getIdentity())[0]);
    }



    /**
 
View Full Code Here

        assertEquals("There should be 2 cookies", 2, cookieJar.size());

        assertEquals("Checking cookie 1",
                     cookie3,
                     cookieJar.retrieve(cookie3.getIdentity())[0]);
        assertEquals("Checking cookie 2",
                     cookie4,
                     cookieJar.retrieve(cookie4.getIdentity())[0]);
    }
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.