Package org.auraframework.clientlibrary

Examples of org.auraframework.clientlibrary.ClientLibraryResolverRegistry


    public ClientLibraryResolverRegistryImplTest(String name) {
        super(name);
    }

    public void testRegister() {
        ClientLibraryResolverRegistry reg = ClientLibraryResolverRegistryImpl.INSTANCE;
        reg.register(null);

        ClientLibraryResolver nullValues = new ClientLibraryResolver() {
            @Override
            public String getName() {
                return null;
            }

            @Override
            public Type getType() {
                return null;
            }

            @Override
            public String getLocation() {
                return null;
            }

            @Override
            public String getUrl() {
                return null;
            }

            @Override
            public boolean canCombine() {
                return false;
            }
        };
        reg.register(nullValues);
        assertNull(reg.get(null, null));

        ClientLibraryResolver customResolver = new ClientLibraryResolver() {
            @Override
            public String getName() {
                return "Kangaroo";
            }

            @Override
            public Type getType() {
                return Type.JS;
            }

            @Override
            public String getLocation() {
                return null;
            }

            @Override
            public String getUrl() {
                return null;
            }

            @Override
            public boolean canCombine() {
                return false;
            }
        };
        assertNull(reg.get("Kangaroo", Type.JS));
        reg.register(customResolver);
        assertEquals("Could not register and look up custom resolver.", customResolver, reg.get("Kangaroo", Type.JS));

        ClientLibraryResolver overrideCustomResolver = new ClientLibraryResolver() {
            @Override
            public String getName() {
                return "Kangaroo";
            }

            @Override
            public Type getType() {
                return Type.JS;
            }

            @Override
            public String getLocation() {
                return null;
            }

            @Override
            public String getUrl() {
                return null;
            }

            @Override
            public boolean canCombine() {
                return false;
            }
        };
        reg.register(overrideCustomResolver);
        assertEquals("Could not override a ClientLibraryResolver", overrideCustomResolver, reg.get("Kangaroo", Type.JS));

    }
View Full Code Here


        assertResolvers("UIPerfUi", Type.JS, AuraResourceResolver.class);
        assertResolvers("CkEditor", Type.JS, AuraResourceResolver.class);
    }
   
    private void assertResolvers(String name, Type type, Class<?> expectedResolver){
        ClientLibraryResolverRegistry reg = ClientLibraryResolverRegistryImpl.INSTANCE;
        ClientLibraryResolver resolver = reg.get(name, type);
        assertNotNull("Failed to find resolver for "+name+" of type "+type.toString(), resolver);
        assertTrue(expectedResolver.isInstance(resolver));
    }
View Full Code Here

TOP

Related Classes of org.auraframework.clientlibrary.ClientLibraryResolverRegistry

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.