Package org.auraframework.def

Examples of org.auraframework.def.ResourceDef


        } else if (StringUtils.startsWithIgnoreCase(url, DefDescriptor.CSS_PREFIX + "://") ||
                StringUtils.startsWithIgnoreCase(url, DefDescriptor.JAVASCRIPT_PREFIX + "://")) {
            // if url is qualified name of DefDescriptor<ResourceDef>
            DefDescriptor<ResourceDef> descriptor = DefDescriptorImpl.getInstance(url, ResourceDef.class);
            if (descriptor.exists()) {
                ResourceDef def = descriptor.getDef();
                if (def != null) {
                    combinable = (Combinable) def;
                }
            }
        }
View Full Code Here


    }
   
    public void testGetComponentJSResourceDef()throws Exception{
        DefDescriptor<ResourceDef> jsResourceDef = Aura.getDefinitionService().getDefDescriptor("js://clientLibraryTest.clientLibraryTest", ResourceDef.class);
        assertNotNull(jsResourceDef);
        ResourceDef def = jsResourceDef.getDef();
        assertNotNull("Unable to locate Javascript resource def", def);
        assertTrue("Component resources should be combinable.", ((ResourceDefImpl)def).canCombine());
    }
View Full Code Here

    }
   
    public void testGetComponentCSSResourceDef()throws Exception{
        DefDescriptor<ResourceDef> cssResourceDef = Aura.getDefinitionService().getDefDescriptor("css://clientLibraryTest.clientLibraryTest", ResourceDef.class);
        assertNotNull(cssResourceDef);
        ResourceDef def = cssResourceDef.getDef();
        assertNotNull("Unable to locate css resource def", def);
        assertTrue("Component resources should be combinable.", ((ResourceDefImpl)def).canCombine());
        assertTrue("Failed to load style resource", ((ResourceDefImpl)def).getContents().contains(".clientLibraryTestStyle"));
    }
View Full Code Here

        ApplicationDef def = cmpDesc.getDef();

        Set<ResourceDef> resourceDefs = def.getResourceDefs();

        DefDescriptor<ResourceDef> jsResourceDefDesc = Aura.getDefinitionService().getDefDescriptor("js://clientLibraryTest.clientLibraryTest", ResourceDef.class);
        ResourceDef jsResourceDef = jsResourceDefDesc.getDef();
        DefDescriptor<ResourceDef> cssResourceDefDesc = Aura.getDefinitionService().getDefDescriptor("css://clientLibraryTest.clientLibraryTest", ResourceDef.class);
        ResourceDef cssResourceDef = cssResourceDefDesc.getDef();

        assertTrue("JS resource should be in component", resourceDefs.contains(jsResourceDef));
        assertTrue("CSS resource should be in component", resourceDefs.contains(cssResourceDef));

        ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
        Json json = Json.createJsonStream(baos, false, false, false);
        jsResourceDef.serialize(json);
        cssResourceDef.serialize(json);
        json.close();
        assertEquals("ResourceDefs are not serialized.", "", new String(baos.toByteArray(), Charsets.UTF_8));
    }
View Full Code Here

TOP

Related Classes of org.auraframework.def.ResourceDef

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.