Package org.auraframework.def

Examples of org.auraframework.def.DesignDef


            assertFalse("DesignDef for 'test:thisDesignDoesNotExist' should not exist.", desc.exists());
        }
    }

    public void testLoadFakeDesignWithAttributes() throws Exception {
        DesignDef c = Aura.getDefinitionService().getDefinition("test:fakeDesign", DesignDef.class);
        assertNotNull("DesignDef not found!", c);
        assertTrue("DesignDef not found!", c.getDescriptor().exists());
        Map<DefDescriptor<AttributeDesignDef>, AttributeDesignDef> attrs = c.getAttributeDesignDefs();
        assertFalse("Unable to parse AttributeDesignDefs on DesignDef!", attrs == null || attrs.size() == 0);
        AttributeDesignDef attr = c.getAttributeDesignDef("something");
        assertNotNull("AttributeDesignDef something not found!", attr);
    }
View Full Code Here


        AttributeDesignDef attr = c.getAttributeDesignDef("something");
        assertNotNull("AttributeDesignDef something not found!", attr);
    }

    public void testAttributeDesignProperties() throws Exception {
        DesignDef c = Aura.getDefinitionService().getDefinition("test:fakeDesign", DesignDef.class);
        assertNotNull("DesignDef not found!", c);
        assertTrue("DesignDef not found!", c.getDescriptor().exists());
        Map<DefDescriptor<AttributeDesignDef>, AttributeDesignDef> attrs = c.getAttributeDesignDefs();
        assertFalse("Unable to parse AttributeDesignDefs on DesignDef!", attrs == null || attrs.size() == 0);
        AttributeDesignDef attr = c.getAttributeDesignDef("something");
        assertNotNull("AttributeDesignDef 'something' not found!", attr);
        assertEquals("AttributeDesignDef 'something' name is incorrect.", "something", attr.getName());
        assertEquals("AttributeDesignDef 'something' label is incorrect.", "some label", attr.getLabel());
        assertEquals("AttributeDesignDef 'something' placeholder is incorrect.", "Leave blank for default value",
                attr.getPlaceholderText());
        assertEquals("AttributeDesignDef 'something' min is incorrect.", "-100", attr.getMin());
        assertEquals("AttributeDesignDef 'something' max is incorrect.", "100", attr.getMax());

        AttributeDesignDef attr2 = c.getAttributeDesignDef("entities");
        assertNotNull("AttributeDesignDef 'entities' not found!", attr2);
        assertEquals("AttributeDesignDef 'entities' type is incorrect.", "EntityName", attr2.getType());
        assertEquals("AttributeDesignDef 'entities' datasource is incorrect or has wrong format.", "Account,Contact",
                attr2.getDataSource());
        assertTrue("AttributeDesignDef 'entities' required is incorrect.", attr2.isRequired());
View Full Code Here

        assertTrue("AttributeDesignDef 'entities' required is incorrect.", attr2.isRequired());
        assertFalse("AttributeDesignDef 'entities' readonly is incorrect.", attr2.isReadOnly());
    }

    public void testAttributeDesignDataSource() throws Exception {
        DesignDef c = Aura.getDefinitionService().getDefinition("test:fakeDesign", DesignDef.class);
        assertNotNull("DesignDef not found!", c);
        assertTrue("DesignDef not found!", c.getDescriptor().exists());
        Map<DefDescriptor<AttributeDesignDef>, AttributeDesignDef> attrs = c.getAttributeDesignDefs();
        assertFalse("Unable to parse AttributeDesignDefs on DesignDef!", attrs == null || attrs.size() == 0);
        AttributeDesignDef attr = c.getAttributeDesignDef("else");
        assertNotNull("AttributeDesignDef 'else' not found!", attr);
        assertEquals("AttributeDesignDef 'else' datasource is incorrect or has wrong format", "one,two,three",
                attr.getDataSource());
    }
View Full Code Here

                attr.getDataSource());
    }

    public void testDesignTemplateWithRegions() throws Exception {
        ComponentDef cmp = Aura.getDefinitionService().getDefinition("test:fakeDesign", ComponentDef.class);
        DesignDef c = cmp.getDesignDefDescriptor().getDef();
        assertNotNull("DesignDef not found!", c);
        DesignTemplateDef template = c.getDesignTemplateDef();
        assertNotNull("DesignTemplateDef not found!", template);

        DesignTemplateRegionDef regionOne = template.getDesignTemplateRegionDef("regionOne");
        assertNotNull("DesignTemplateRegionDef regionOne not found!", regionOne);
        assertTrue("DesignTemplateRegionDef regionOne should have one allowed interface.", regionOne
View Full Code Here

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

    public void testGetElement() throws Exception {
        DesignDef element = setupSimpleDesignDef("<design:component label=\"some label\" />").getDef();
        assertEquals("some label", element.getLabel());
    }
View Full Code Here

        DesignDef element = setupSimpleDesignDef("<design:component label=\"some label\" />").getDef();
        assertEquals("some label", element.getLabel());
    }

    public void testRetrieveSingleAttributeDesign() throws Exception {
        DesignDef element = setupSimpleDesignDef(
                "<design:component><design:attribute name=\"mystring\" required=\"true\"/></design:component>")
                .getDef();
        AttributeDesignDef child = element.getAttributeDesignDef("mystring");
        assertNotNull("Expected one AttributeDesignDef", child);
        assertTrue(child.isRequired());
    }
View Full Code Here

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

    public void testLoadFakeDesignDefinition() throws Exception {
        DesignDef c = Aura.getDefinitionService().getDefinition("test:fakeComponent", DesignDef.class);
        assertNotNull("DesignDef not found!", c);
        assertTrue("DesignDef not found!", c.getDescriptor().exists());
    }
View Full Code Here

        assertNotNull("DesignDef not found!", c);
        assertTrue("DesignDef not found!", c.getDescriptor().exists());
    }

    public void testVerifyDesignDefLabel() throws Exception {
        DesignDef c = Aura.getDefinitionService().getDefinition("test:fakeDesign", DesignDef.class);
        assertNotNull("DesignDef not found!", c);
        assertTrue("DesignDef not found!", c.getDescriptor().exists());
        assertEquals("DesignDef label is incorrect.", "some label", c.getLabel());
    }
View Full Code Here

TOP

Related Classes of org.auraframework.def.DesignDef

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.