Package org.apache.sling.resourceresolver.impl.tree

Examples of org.apache.sling.resourceresolver.impl.tree.ResourceProviderHandler


        final AdaptableResourceProviderImpl rp3 = new AdaptableResourceProviderImpl(new String[] {"/hello"}, 3L);
        final ResourceProviderImpl rp4 = new ResourceProviderImpl(new String[] {"/you"}, 4L);

        final SortedProviderList<Adaptable> spl = new SortedProviderList<Adaptable>(Adaptable.class);
        check(spl, null);
        spl.add(new ResourceProviderHandler(rp1, rp1.getProperties()));
        check(spl, null);
        spl.add(new ResourceProviderHandler(rp2, rp2.getProperties()));
        check(spl, null, rp2);
        spl.add(new ResourceProviderHandler(rp3, rp3.getProperties()));
        check(spl, null, rp2, rp3);
        spl.add(new ResourceProviderHandler(rp4, rp4.getProperties()));
        check(spl, null, rp2, rp3);

        spl.remove(new ResourceProviderHandler(rp1, rp1.getProperties()));
        check(spl, null, rp2, rp3);
        spl.remove(new ResourceProviderHandler(rp1, rp1.getProperties()));
        check(spl, null, rp2, rp3);
        spl.remove(new ResourceProviderHandler(rp4, rp4.getProperties()));
        check(spl, null, rp2, rp3);
        spl.remove(new ResourceProviderHandler(rp2, rp2.getProperties()));
        check(spl, null, rp3);
        spl.remove(new ResourceProviderHandler(rp3, rp3.getProperties()));
        check(spl, null);
    }
View Full Code Here


        final AdaptableResourceProviderImpl rp4 = new AdaptableResourceProviderImpl(new String[] {"/a/a"}, 4L);
        final AdaptableResourceProviderImpl rp5 = new AdaptableResourceProviderImpl(new String[] {"/all/or/nothing"}, 5L);

        final SortedProviderList<Adaptable> spl = new SortedProviderList<Adaptable>(Adaptable.class);
        check(spl, null);
        spl.add(new ResourceProviderHandler(rp1, rp1.getProperties()));
        check(spl, null, rp1);
        spl.add(new ResourceProviderHandler(rp2, rp2.getProperties()));
        check(spl, null, rp2, rp1);
        spl.add(new ResourceProviderHandler(rp3, rp3.getProperties()));
        check(spl, null, rp2, rp1, rp3);
        spl.add(new ResourceProviderHandler(rp4, rp4.getProperties()));
        check(spl, null, rp2, rp1, rp4, rp3);
        spl.add(new ResourceProviderHandler(rp5, rp5.getProperties()));
        check(spl, null, rp2, rp1, rp4, rp5, rp3);
    }
View Full Code Here

    @Test public void checkExceptions() {
        final AdaptableResourceProviderImpl rp2 = new AdaptableResourceProviderImpl(null, 2L);

        final SortedProviderList<Adaptable> spl = new SortedProviderList<Adaptable>(Adaptable.class);
        spl.add(new ResourceProviderHandler(rp2, rp2.getProperties()));

        final Iterator<Adaptable> i = spl.getProviders(null, null);
        assertTrue(i.hasNext());
        i.next(); // one entry
        assertFalse(i.hasNext());
View Full Code Here

TOP

Related Classes of org.apache.sling.resourceresolver.impl.tree.ResourceProviderHandler

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.