Package org.auraframework.def

Examples of org.auraframework.def.AttributeDef


        EventDefImpl def = vendor.makeEventDef(desc, EventType.COMPONENT, atts, null, null);
        def.validateDefinition();
        assertEquals(EventType.COMPONENT, def.getEventType());
        Map<DefDescriptor<AttributeDef>, AttributeDef> map = def.getDeclaredAttributeDefs();
        assertEquals(2, map.size());
        AttributeDef testString = map.get(DefDescriptorImpl.getInstance("testString", AttributeDef.class));
        assertNotNull(testString);
        AttributeDef testInt = map.get(DefDescriptorImpl.getInstance("testInt", AttributeDef.class));
        assertNotNull(testInt);
    }
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

    }

    public void testSerializeDefaultValue() throws Exception {
      this.defaultValue = new AttributeDefRefImpl.Builder().setValue("Hello").build();
        Json json = Mockito.mock(Json.class);
        AttributeDef def = buildDefinition();
    def.serialize(json);
        InOrder inOrder = Mockito.inOrder(json);
        inOrder.verify(json).writeMapBegin();
        inOrder.verify(json).writeMapEntry("default", "Hello");
        inOrder.verify(json).writeMapEnd();
    }
View Full Code Here

    }

    public void testValidateReferencesDefaultValue() throws Exception {
        TypeDef typeDef = Mockito.mock(TypeDef.class);
        Mockito.doReturn(typeDef).when(this.typeDefDescriptor).getDef();
        AttributeDef attributeDef = buildDefinition();
        Mockito.verifyZeroInteractions(this.defaultValue);
        attributeDef.validateReferences();
        Mockito.verify(this.defaultValue).parseValue(typeDef);
        Mockito.verify(this.defaultValue).validateReferences();
    }
View Full Code Here

TOP

Related Classes of org.auraframework.def.AttributeDef

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.