Package org.apache.sling.superimposing

Examples of org.apache.sling.superimposing.SuperimposingResourceProvider


        initialize(true);

        // ensure the superimposed resource is detected and registered
        List<SuperimposingResourceProvider> providers = IteratorUtils.toList(underTest.getRegisteredProviders());
        assertEquals(1, providers.size());
        SuperimposingResourceProvider provider = providers.iterator().next();
        assertEquals(SUPERIMPOSED_PATH, provider.getRootPath());
        assertEquals(ORIGINAL_PATH, provider.getSourcePath());
        assertFalse(provider.isOverlayable());
        verify(bundleContext).registerService(anyString(), same(provider), any(Dictionary.class));
    }
View Full Code Here


        underTest.onEvent(prepareNodeCreateEvent(superimposedResource));

        // ensure the superimposed resource is detected and registered
        List<SuperimposingResourceProvider> providers = IteratorUtils.toList(underTest.getRegisteredProviders());
        assertEquals(1, providers.size());
        SuperimposingResourceProvider provider = providers.iterator().next();
        assertEquals(SUPERIMPOSED_PATH, provider.getRootPath());
        assertEquals(ORIGINAL_PATH, provider.getSourcePath());
        assertFalse(provider.isOverlayable());
        verify(bundleContext).registerService(anyString(), same(provider), any(Dictionary.class));

        // simulate a change in the original path
        superimposedResource.adaptTo(ValueMap.class).put(PROP_SUPERIMPOSE_SOURCE_PATH, "/other/path");
        underTest.onEvent(prepareNodeChangeEvent(superimposedResource));

        // ensure the superimposed resource update is detected and a new provider instance is registered
        providers = IteratorUtils.toList(underTest.getRegisteredProviders());
        assertEquals(1, providers.size());
        SuperimposingResourceProvider provider2 = providers.iterator().next();
        assertEquals(SUPERIMPOSED_PATH, provider2.getRootPath());
        assertEquals("/other/path", provider2.getSourcePath());
        assertFalse(provider2.isOverlayable());
        verify(bundleContext).registerService(anyString(), same(provider2), any(Dictionary.class));

        // simulate node removal
        underTest.onEvent(prepareNodeRemoveEvent(superimposedResource));
View Full Code Here

        underTest.onEvent(prepareNodeMoveEvent(superimposedResource, oldPath));

        // ensure the superimposed resource update is detected and a new provider instance is registered
        List<SuperimposingResourceProvider> providers = IteratorUtils.toList(underTest.getRegisteredProviders());
        assertEquals(1, providers.size());
        SuperimposingResourceProvider provider = providers.iterator().next();
        assertEquals("/new/path", provider.getRootPath());
        assertEquals(ORIGINAL_PATH, provider.getSourcePath());
        assertFalse(provider.isOverlayable());
        verify(bundleContext).registerService(anyString(), same(provider), any(Dictionary.class));
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.superimposing.SuperimposingResourceProvider

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.