Package org.auraframework.impl.root

Examples of org.auraframework.impl.root.AttributeDefImpl


        AttributeDefImpl ad = getElement("<aura:attribute name='vis' type='String' visibility='invisible'/>");
        assertEquals(Visibility.INVALID, ad.getVisibility());
    }

    public void testVisibilityEmptyString() throws Exception {
        AttributeDefImpl ad = getElement("<aura:attribute name='vis' type='String' visibility=''/>");
        assertEquals(Visibility.INVALID, ad.getVisibility());
    }
View Full Code Here


    }

    public void testValidateDefinitionPrivateAttribute() throws Exception {
        Map<DefDescriptor<AttributeDef>, AttributeDef> atts = new HashMap<>();
        atts.put(DefDescriptorImpl.getInstance("testInt", AttributeDef.class),
                new AttributeDefImpl(DefDescriptorImpl.getInstance("testInt", AttributeDef.class), null,
                        DefDescriptorImpl.getInstance("Integer", TypeDef.class), null,
                        false, null, null, Visibility.PRIVATE));
        InterfaceDefImpl inter = vendor.makeInterfaceDef(null, atts, null, null, null);
        try {
            inter.validateDefinition();
View Full Code Here

    public void testValidateValidDefinition() throws Exception {
        DefDescriptor<EventDef> eventDescriptor = DefDescriptorImpl.getInstance("aura:testevent", EventDef.class);
        RegisterEventDefImpl red = vendor.makeRegisterEventDefWithNulls(eventDescriptor, true, null);
        Map<String, RegisterEventDef> eventDefs = new HashMap<>();
        eventDefs.put("buckfutter", red);
        AttributeDefImpl testAttributeDef = new AttributeDefImpl(DefDescriptorImpl.getInstance("testattribute",
                AttributeDef.class), null, vendor.getTypeDef().getDescriptor(), null, false,
                AttributeDef.SerializeToType.BOTH, null, Visibility.PUBLIC);
        Map<DefDescriptor<AttributeDef>, AttributeDef> attDefs = new HashMap<>();
        attDefs.put(DefDescriptorImpl.getInstance("nullAttribute", AttributeDef.class), testAttributeDef);
        InterfaceDefImpl def = vendor.makeInterfaceDefWithNulls(
View Full Code Here

        assertEquals(eventDefs, intDef2.getRegisterEventDefs());
    }

    public void testGetAttributeDefsWithoutExtensions() throws Exception {
        Map<DefDescriptor<AttributeDef>, AttributeDef> attributes = new HashMap<>();
        AttributeDef attDef = new AttributeDefImpl(DefDescriptorImpl.getInstance("Fake Attribute", AttributeDef.class),
                null, null, null, false, AttributeDef.SerializeToType.BOTH, null, Visibility.PUBLIC);
        attributes.put(attDef.getDescriptor(), attDef);
        InterfaceDefImpl intDef2 = vendor.makeInterfaceDefWithNulls(
                vendor.makeInterfaceDefDescriptor("aura:testinterfacechild"), attributes, null, null, null, null);
        Map<DefDescriptor<AttributeDef>, AttributeDef> returnedAttributes = intDef2.getAttributeDefs();
        assertEquals(1, returnedAttributes.size());
        assertEquals(attDef,
View Full Code Here

    public void testSerialize() throws Exception {
        Set<DefDescriptor<InterfaceDef>> extensions = new HashSet<>();
        extensions.add(vendor.makeInterfaceDefDescriptor("aura:testinterfaceparent"));
        Map<DefDescriptor<AttributeDef>, AttributeDef> attributes = new HashMap<>();
        AttributeDef attDef = new AttributeDefImpl(DefDescriptorImpl.getInstance("Fake Attribute", AttributeDef.class),
                null, null, null, false, AttributeDef.SerializeToType.BOTH, null, null);
        attributes.put(attDef.getDescriptor(), attDef);
        DefDescriptor<EventDef> eventTestDescriptor = DefDescriptorImpl.getInstance("aura:testevent", EventDef.class);
        RegisterEventDef regEventDef = vendor.makeRegisterEventDefWithNulls(eventTestDescriptor, true, null);
        Map<String, RegisterEventDef> eventDefs = new HashMap<>();
        eventDefs.put("ass", regEventDef);
        InterfaceDefImpl intDef2 = vendor.makeInterfaceDefWithNulls(
View Full Code Here

        context.addLoaded(added, "somegenerateduid");

        DefDescriptor<EventDef> eventDesc = DefDescriptorImpl.getInstance("fake:event", EventDef.class);
        Map<DefDescriptor<AttributeDef>, AttributeDef> atts = new HashMap<>();
        DefDescriptor<TypeDef> type = DefDescriptorImpl.getInstance("String", TypeDef.class);
        atts.put(DefDescriptorImpl.getInstance("testString", AttributeDef.class), new AttributeDefImpl(
                DefDescriptorImpl.getInstance("testString", AttributeDef.class), null, type, null, true,
                AttributeDef.SerializeToType.BOTH, null, null));
        EventDefImpl eventDef = vendor.makeEventDef(eventDesc, EventType.COMPONENT, atts, null, null);

        context.getDefRegistry().addLocalDef(eventDef);
View Full Code Here

            Builder builder = new ComponentDefImpl.Builder();
            builder.setDescriptor(hashedDescriptor);
            //set up attribute definitions. we don't need "whatToDo" any more, but the build still require it
            Map<DefDescriptor<AttributeDef>, AttributeDef> attributeDefs = new HashMap<>();
            DefDescriptor<TypeDef> type = DefDescriptorImpl.getInstance("String", TypeDef.class);
            attributeDefs.put(DefDescriptorImpl.getInstance("whatToDo", AttributeDef.class), new AttributeDefImpl(
                    DefDescriptorImpl.getInstance("whatToDo", AttributeDef.class), null, type, null, true,
                    AttributeDef.SerializeToType.BOTH, null, null));
      builder.attributeDefs = attributeDefs;
            ComponentDef cmpDef = builder.build();
            AuraContext context = Aura.getContextService().getCurrentContext();
View Full Code Here

TOP

Related Classes of org.auraframework.impl.root.AttributeDefImpl

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.