Package org.apache.tiles.request.attribute

Examples of org.apache.tiles.request.attribute.EnumeratedValuesExtractor



    /** {@inheritDoc} */
    @Override
    public boolean equals(Object o) {
        EnumeratedValuesExtractor otherRequest = ((HeaderValuesMap) o).request;
        boolean retValue = true;
        for (Enumeration<String> attribs = request.getKeys(); attribs
                .hasMoreElements()
                && retValue;) {
            String parameterName = attribs.nextElement();
            Set<String> valueSet = enumeration2set(otherRequest.getValues(parameterName));
            retValue = compareHeaders(parameterName, valueSet);
        }

        return retValue;
    }
View Full Code Here


    @Test
    public void testEqualsObject() {
        Enumeration<String> keys = createMock(Enumeration.class);
        Enumeration<String> values1 = createMock(Enumeration.class);
        Enumeration<String> values2 = createMock(Enumeration.class);
        EnumeratedValuesExtractor otherExtractor = createMock(EnumeratedValuesExtractor.class);
        Enumeration<String> otherValues1 = createMock(Enumeration.class);
        Enumeration<String> otherValues2 = createMock(Enumeration.class);

        expect(extractor.getKeys()).andReturn(keys);
        expect(keys.hasMoreElements()).andReturn(true);
        expect(keys.nextElement()).andReturn("one");
        expect(keys.hasMoreElements()).andReturn(true);
        expect(keys.nextElement()).andReturn("two");
        expect(keys.hasMoreElements()).andReturn(false);

        expect(extractor.getValues("one")).andReturn(values1);
        expect(values1.hasMoreElements()).andReturn(true);
        expect(values1.nextElement()).andReturn("value1");
        expect(values1.hasMoreElements()).andReturn(false);

        expect(extractor.getValues("two")).andReturn(values2);
        expect(values2.hasMoreElements()).andReturn(true);
        expect(values2.nextElement()).andReturn("value2");
        expect(values2.hasMoreElements()).andReturn(true);
        expect(values2.nextElement()).andReturn("value3");
        expect(values2.hasMoreElements()).andReturn(false);

        expect(otherExtractor.getValues("one")).andReturn(otherValues1);
        expect(otherValues1.hasMoreElements()).andReturn(true);
        expect(otherValues1.nextElement()).andReturn("value1");
        expect(otherValues1.hasMoreElements()).andReturn(false);

        expect(otherExtractor.getValues("two")).andReturn(otherValues2);
        expect(otherValues2.hasMoreElements()).andReturn(true);
        expect(otherValues2.nextElement()).andReturn("value2");
        expect(otherValues2.hasMoreElements()).andReturn(true);
        expect(otherValues2.nextElement()).andReturn("value3");
        expect(otherValues2.hasMoreElements()).andReturn(false);
View Full Code Here

    @Test
    public void testEqualsObject() {
        Enumeration<String> keys = createMock(Enumeration.class);
        Enumeration<String> values1 = createMock(Enumeration.class);
        Enumeration<String> values2 = createMock(Enumeration.class);
        EnumeratedValuesExtractor otherExtractor = createMock(EnumeratedValuesExtractor.class);
        Enumeration<String> otherValues1 = createMock(Enumeration.class);
        Enumeration<String> otherValues2 = createMock(Enumeration.class);

        expect(extractor.getKeys()).andReturn(keys);
        expect(keys.hasMoreElements()).andReturn(true);
        expect(keys.nextElement()).andReturn("one");
        expect(keys.hasMoreElements()).andReturn(true);
        expect(keys.nextElement()).andReturn("two");
        expect(keys.hasMoreElements()).andReturn(false);

        expect(extractor.getValues("one")).andReturn(values1);
        expect(values1.hasMoreElements()).andReturn(true);
        expect(values1.nextElement()).andReturn("value1");
        expect(values1.hasMoreElements()).andReturn(false);

        expect(extractor.getValues("two")).andReturn(values2);
        expect(values2.hasMoreElements()).andReturn(true);
        expect(values2.nextElement()).andReturn("value2");
        expect(values2.hasMoreElements()).andReturn(true);
        expect(values2.nextElement()).andReturn("value3");
        expect(values2.hasMoreElements()).andReturn(false);

        expect(otherExtractor.getValues("one")).andReturn(otherValues1);
        expect(otherValues1.hasMoreElements()).andReturn(true);
        expect(otherValues1.nextElement()).andReturn("value1");
        expect(otherValues1.hasMoreElements()).andReturn(false);

        expect(otherExtractor.getValues("two")).andReturn(otherValues2);
        expect(otherValues2.hasMoreElements()).andReturn(true);
        expect(otherValues2.nextElement()).andReturn("value2");
        expect(otherValues2.hasMoreElements()).andReturn(true);
        expect(otherValues2.nextElement()).andReturn("value3");
        expect(otherValues2.hasMoreElements()).andReturn(false);
View Full Code Here


    /** {@inheritDoc} */
    @Override
    public boolean equals(Object o) {
        EnumeratedValuesExtractor otherRequest = ((HeaderValuesMap) o).request;
        boolean retValue = true;
        for (Enumeration<String> attribs = request.getKeys(); attribs
                .hasMoreElements()
                && retValue;) {
            String parameterName = attribs.nextElement();
            Set<String> valueSet = enumeration2set(otherRequest.getValues(parameterName));
            retValue = compareHeaders(parameterName, valueSet);
        }

        return retValue;
    }
View Full Code Here

TOP

Related Classes of org.apache.tiles.request.attribute.EnumeratedValuesExtractor

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.