Package org.apache.sling.api.wrappers

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


        // 1600 x 900
        Rectangle expected = new Rectangle();
        expected.setBounds(0, 0, 400, 900);

        map.put("bounds", "0,0,8000,18000");
        ValueMap properties = new ValueMapDecorator(map);

        transformer.transform(layer, properties);

        verify(layer, times(1)).crop(expected);
    }
View Full Code Here


        verify(layer, times(1)).crop(expected);
    }

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

        transformer.transform(layer, properties);

        verifyZeroInteractions(layer);
    }
View Full Code Here

        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}"});

        when(agentConfig1.getProperties()).thenReturn(new ValueMapDecorator(tmp));
        when(agentConfig2.getProperties()).thenReturn(new ValueMapDecorator(tmp));


        final Agent[] actual = dispatcherFlusher.getFlushAgents();

        assertEquals(1, actual.length);
View Full Code Here

    @Before
    public void setUp() throws Exception {
        Map<String, Object> map = new HashMap<String, Object>();
        String path = "/content/geometrixx/en";
        map.put("path", path);
        ValueMap vm = new ValueMapDecorator(map);
        when(resource.adaptTo(ValueMap.class)).thenReturn(vm);
        when(resource.getResourceResolver()).thenReturn(resolver);
        when(resolver.adaptTo(PageManager.class)).thenReturn(manager);
        when(manager.getContainingPage(path)).thenReturn(referredpage);
        when(referredpage.getPath()).thenReturn(path);
View Full Code Here

    @Test
    public void testNoReferenceToAnyPage() throws Exception {
        Map<String, Object> map = new HashMap<String, Object>();
        String path = "/content/ge1ometrixx/en";
        map.put("path", path);
        ValueMap vm = new ValueMapDecorator(map);
        when(resource.adaptTo(ValueMap.class)).thenReturn(vm);
        when(resource.getResourceResolver()).thenReturn(resolver);
        when(resolver.getResource(path)).thenReturn(res);
        when(res.adaptTo(Page.class)).thenReturn(null);
        when(referredpage.getName()).thenReturn("geometrixx");
View Full Code Here

        Map<String, Object> map = new HashMap<String, Object>();
        String path = "/content/geometrixx/en";
        String path1 = "/content/geometrixx/en/toolbar";
        map.put("path", path);
        map.put("path1", path1);
        ValueMap vm = new ValueMapDecorator(map);
        when(resource.adaptTo(ValueMap.class)).thenReturn(vm);
        when(resource.getResourceResolver()).thenReturn(resolver);
        when(resolver.getResource(path)).thenReturn(res);
        when(resolver.getResource(path1)).thenReturn(res1);
        when(res.adaptTo(Page.class)).thenReturn(referredpage);
View Full Code Here

        Map<String, Object> map = new HashMap<String, Object>();
        String path = "/content/geometrixx/en";
        String path1 = "/content/geometrixx/en";
        map.put("path", path);
        map.put("path1", path1);
        ValueMap vm = new ValueMapDecorator(map);
        when(resource.adaptTo(ValueMap.class)).thenReturn(vm);
        when(resource.getResourceResolver()).thenReturn(resolver);
        when(resolver.getResource(path)).thenReturn(res);
        when(resolver.getResource(path1)).thenReturn(res1);
        when(res.adaptTo(Page.class)).thenReturn(referredpage);
View Full Code Here

        Map<String, Object> map = new HashMap<String, Object>();
        String path = "\"/content/geometrixx/en\",\"/content/geometrixx/en/toolbar\"";
        String path1 = "/content/geometrixx/en/toolbar";
        map.put("path", path);
        // map.put("path1", path1);
        ValueMap vm = new ValueMapDecorator(map);
        when(resource.adaptTo(ValueMap.class)).thenReturn(vm);
        when(resource.getResourceResolver()).thenReturn(resolver);
        when(resolver.getResource(path)).thenReturn(res);
        when(resolver.getResource(path1)).thenReturn(res1);
        when(res.adaptTo(Page.class)).thenReturn(referredpage);
View Full Code Here

        final int width = 100;
        final int height = 200;

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

        transformer.transform(layer, properties);

        verify(layer, times(1)).resize(width, height);
        verifyNoMoreInteractions(layer);
View Full Code Here

    @Test
    public void testTransform_onlyWidth() throws Exception {
        final int width = 160;

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

        transformer.transform(layer, properties);

        verify(layer, times(1)).resize(width, 90);
    }
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.