Package com.volantis.shared.net.http.headers

Examples of com.volantis.shared.net.http.headers.HeaderImpl


    public void testPutContainsRetreive() {
        SimpleHTTPMessageEntities entities =
                new SimpleHTTPMessageEntities();
        String headerName = "header";

        HeaderImpl header = new HeaderImpl(headerName);

        entities.put(header);

        assertTrue("The header that was put is not contained in this entities",
                entities.containsIdentity(header.getIdentity()));


        HTTPMessageEntity retrieved [] =
                entities.retrieve(header.getIdentity());

        assertEquals("There can be only one", 1, retrieved.length);

        assertEquals("The retreived HTTPMessageEntity is not equal to the" +
                " entity that was put", header, retrieved[0]);
View Full Code Here


        String headerName = "header";

        String value1 = "value1";
        String value2 = "value2";

        HeaderImpl header1 = new HeaderImpl(headerName);
        header1.setValue(value1);

        entities.put(header1);

        HTTPMessageEntity retrieved [] = entities.retrieve(header1.getIdentity());

        assertEquals(value1, retrieved[0].getValue());

        HeaderImpl header2 = new HeaderImpl(headerName);
        header2.setValue(value2);

        entities.put(header2);

        retrieved = entities.retrieve(header1.getIdentity());
View Full Code Here

        String name1 = "name1";
        String name2 = "name2";
        String name3 = "name3";

        HeaderImpl header1 = new HeaderImpl(name1);
        HeaderImpl header2 = new HeaderImpl(name1);
        HeaderImpl header3 = new HeaderImpl(name2);
        HeaderImpl header4 = new HeaderImpl(name3);

        entities.add(header1);
        header1.setValue("value1");
        entities.add(header2);
        header2.setValue("value2");
        entities.add(header3);
        entities.add(header4);

        Header headers [] = new Header[3];
        headers[0] = new HeaderImpl(name1);
        headers[1] = new HeaderImpl(name1);
        headers[2] = new HeaderImpl(name2);

        // Putting the headers array should replace header1, header2 and
        // header3 and return these three replaced entities. In addition
        // entities should consist of the three headers in the headers array
        // and header4.
View Full Code Here

                new SimpleHTTPMessageEntities();

        String name1 = "name1";
        String name2 = "name2";

        HeaderImpl header1 = new HeaderImpl(name1);
        HeaderImpl header2 = new HeaderImpl(name1);
        HeaderImpl header3 = new HeaderImpl(name2);

        entities.add(header1);
        header1.setValue("value1");
        entities.add(header2);
        header2.setValue("value2");
View Full Code Here

                new SimpleHTTPMessageEntities();

        String name1 = "name1";
        String name2 = "name2";

        HeaderImpl header1 = new HeaderImpl(name1);
        HeaderImpl header2 = new HeaderImpl(name1);
        HeaderImpl header3 = new HeaderImpl(name2);

        entities.add(header1);
        header1.setValue("value1");
        entities.add(header2);
        header2.setValue("value2");
View Full Code Here

                new SimpleHTTPMessageEntities();

        String name1 = "name1";
        String name2 = "name2";

        HeaderImpl header1 = new HeaderImpl(name1);
        HeaderImpl header2 = new HeaderImpl(name1);
        HeaderImpl header3 = new HeaderImpl(name2);

        entities.put(header1);
        entities.put(header2);
        entities.put(header3);

        assertTrue("Expected a name1 entity to be contained in entities",
                entities.containsIdentity(header1.getIdentity()));

        assertFalse("Did not expect an entity named bibble to be contained " +
                "in entities",
                entities.containsIdentity(new HeaderImpl("bibble").getIdentity()));
    }
View Full Code Here

                new SimpleHTTPMessageEntities();

        String name1 = "name1";
        String name2 = "name2";

        HeaderImpl header1 = new HeaderImpl(name1);
        header1.setValue("value1");
        HeaderImpl header2 = new HeaderImpl(name1);
        header2.setValue("value2");
        HeaderImpl header3 = new HeaderImpl(name2);

        entities.add(header1);
        entities.add(header2);
        entities.add(header3);
View Full Code Here

                new SimpleHTTPMessageEntities();

        String name1 = "name1";
        String name2 = "name2";

        HeaderImpl header1 = new HeaderImpl(name1);
        header1.setValue("value1");
        HeaderImpl header2 = new HeaderImpl(name1);
        header2.setValue("value2");
        HeaderImpl header3 = new HeaderImpl(name1);
        header3.setValue("value2");
        HeaderImpl header4 = new HeaderImpl(name2);

        entities.add(header1);
        entities.add(header2);
        entities.add(header3);
        entities.add(header4);
View Full Code Here

            entity.setValue("test");
            checkEquality(entity);
        }
        {
            // test WebRequestHeader
            HeaderImpl entity = new WebRequestHeader();
            entity.setName("TEST");
            entity.setValue("test");
            checkEquality(entity);
        }
        {
            // test WebRequestParameter
            RequestParameterImpl entity = new WebRequestParameter();
            entity.setName("TEST");
            entity.setValue("test");
            checkEquality(entity);
        }

    }
View Full Code Here

        Object args [] = {header, responseHeader, Boolean.valueOf(list)};
        PrivateAccessor.invoke(manager, method, paramTypes, args);

        Iterator headers = responseHeader.iterator();
        while (headers.hasNext()) {
            HeaderImpl headerImpl = (HeaderImpl) headers.next();
            assertEquals("Unexpected header name.",
                         headerName, headerImpl.getName());
            assertEquals("Unexpected header value.",
                         headerValue, headerImpl.getValue());
        }
    }
View Full Code Here

TOP

Related Classes of com.volantis.shared.net.http.headers.HeaderImpl

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.