Package org.apache.sling.api.wrappers

Examples of org.apache.sling.api.wrappers.ValueMapDecorator


    @Test
    public void testTransform_onlyBrightness() throws Exception {
        final Integer brightness = 100;

        map.put("brightness", brightness.toString());
        ValueMap properties = new ValueMapDecorator(map);

        transformer.transform(layer, properties);

        verify(layer, times(1)).adjust(brightness, 1F);
        verifyNoMoreInteractions(layer);
View Full Code Here


    @Test
    public void testTransform_onlyContrast() throws Exception {
        final Float contrast = 0.05F;

        map.put("contrast", contrast.toString());
        ValueMap properties = new ValueMapDecorator(map);

        transformer.transform(layer, properties);

        verify(layer, times(1)).adjust(0, contrast);
        verifyNoMoreInteractions(layer);
View Full Code Here

    @Test
    public void testTransform() throws Exception {
        final int degrees = 50;

        map.put("degrees", degrees);
        ValueMap properties = new ValueMapDecorator(map);

        transformer.transform(layer, properties);

        verify(layer, times(1)).rotate(degrees);
        verifyNoMoreInteractions(layer);
View Full Code Here

    @Test
    public void testTransform_mod() throws Exception {
        final int degrees = 5;

        map.put("degrees", 360 + degrees);
        ValueMap properties = new ValueMapDecorator(map);

        transformer.transform(layer, properties);

        verify(layer, times(1)).rotate(degrees);
        verifyNoMoreInteractions(layer);
View Full Code Here

    @Test
    public void testTransform_neg() throws Exception {
        final int degrees = -15;

        map.put("degrees", -360 + degrees);
        ValueMap properties = new ValueMapDecorator(map);

        transformer.transform(layer, properties);

        verify(layer, times(1)).rotate(degrees);
        verifyNoMoreInteractions(layer);
View Full Code Here

        verifyNoMoreInteractions(layer);
    }

    @Test
    public void testTransform_emptyParams() throws Exception {
        ValueMap properties = new ValueMapDecorator(map);

        transformer.transform(layer, properties);

        verifyZeroInteractions(layer);
    }
View Full Code Here

        when(agent.getConfiguration()).thenReturn(agentConfig);

        Map<String, Object> tmp = new HashMap<String, Object>();
        tmp.put(AgentConfig.PROTOCOL_HTTP_HEADERS, new String[] {"CQ-Action:{action}", "CQ-Handle:{path}",
                "CQ-Path: {path}"});
        hierarchicalProperties = new ValueMapDecorator(tmp);

        tmp = new HashMap<String, Object>();
        tmp.put(AgentConfig.PROTOCOL_HTTP_HEADERS, new String[] {"CQ-Action:{action}", "CQ-Handle:{path}",
                "CQ-Path: {path}", "CQ-Action-Scope: ResourceOnly"});
        resourceOnlyProperties = new ValueMapDecorator(tmp);

        tmp = new HashMap<String, Object>();
        tmp.put(AgentConfig.PROTOCOL_HTTP_HEADERS, new String[] {"Foo-Action:{action}", "Foo-Handle:{path}",
                "Foo-Path: {path}"});
        invalidProperties = new ValueMapDecorator(tmp);
    }
View Full Code Here

    public void testTransform_Landscape_only_width() throws Exception {
        prepareLandscape();

        map.put("width", 200);

        ValueMap properties = new ValueMapDecorator(map);

        transformer.transform(layer, properties);

        verify(layer, times(1)).resize(200, 131);
    }
View Full Code Here

        prepareLandscape();

        map.put("width", 200);
        map.put("height", 10);

        ValueMap properties = new ValueMapDecorator(map);

        transformer.transform(layer, properties);

        verify(layer, times(1)).resize(15, 10);
    }
View Full Code Here

        prepareLandscape();

        map.put("width", 10);
        map.put("height", 200);

        ValueMap properties = new ValueMapDecorator(map);

        transformer.transform(layer, properties);

        verify(layer, times(1)).resize(10, 7);
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.api.wrappers.ValueMapDecorator

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.