Package org.auraframework.def

Examples of org.auraframework.def.ComponentDef.validateDefinition()


        StringSource<ComponentDef> source = new StringSource<>(descriptor,
                "<aura:component><aura:attribute name=\"implNumber\" type=\"String\"/>"
                        + "<aura:attribute name=\"implNumber\" type=\"String\"/></aura:component>", "myID", Format.XML);
        ComponentDef cd = parser.parse(descriptor, source);
        try {
            cd.validateDefinition();
            fail("Should have thrown Exception. Two attributes with the same name cannot exist");
        } catch (InvalidDefinitionException expected) {
        }
    }
View Full Code Here


        StringSource<ComponentDef> source = new StringSource<>(descriptor,
                "<aura:component extends='test:fakeAbstract' extends='test:fakeAbstractParent'></aura:component>",
                "myID", Format.XML);
        ComponentDef cd = parser.parse(descriptor, source);
        try {
            cd.validateDefinition();
            fail("Should have thrown Exception. Same attribute specified twice on aura:component tag.");
        } catch (InvalidDefinitionException expected) {
        }
    }
View Full Code Here

        DefDescriptor<ComponentDef> descriptor = DefDescriptorImpl.getInstance("test:fakeparser", ComponentDef.class);
        StringSource<ComponentDef> source = new StringSource<>(descriptor,
                "<aura:component extends=''></aura:component>", "myID", Format.XML);
        ComponentDef cd = parser.parse(descriptor, source);
        try {
            cd.validateDefinition();
            fail("Should have thrown Exception. Attribute value cannot be blank.");
        } catch (InvalidDefinitionException expected) {
        }
    }
View Full Code Here

        XMLParser parser = XMLParser.getInstance();
        descriptor = DefDescriptorImpl.getInstance("test:parserInvalid", ComponentDef.class);
        Source<?> source = getSource(descriptor);
        ComponentDef cd = parser.parse(descriptor, source);
        try {
            cd.validateDefinition();
            fail("Parsing invalid source should throw exception");
        } catch (InvalidDefinitionException e) {
            Location location = e.getLocation();
            assertTrue("Wrong filename.", location.getFileName().endsWith("parserInvalid.cmp"));
            assertEquals(19, location.getLine());
View Full Code Here

        XMLParser parser = XMLParser.getInstance();
        descriptor = DefDescriptorImpl.getInstance("test:parserFragment", ComponentDef.class);
        Source<?> source = getSource(descriptor);
        ComponentDef cd = parser.parse(descriptor, source);
        try {
            cd.validateDefinition();
            fail("Parsing invalid source should throw exception");
        } catch (AuraException e) {
            Location location = e.getLocation();
            assertTrue("Wrong filename.", location.getFileName().endsWith("parserFragment.cmp"));
            checkExceptionContains(e, InvalidDefinitionException.class,
View Full Code Here

        DefDescriptor<ComponentDef> desc = DefDescriptorImpl.getInstance("test:fakeComponent", ComponentDef.class);
        builder.extendsDescriptor = desc;
        ComponentDef cmp = builder.build();

        try {
            cmp.validateDefinition();
        } catch (AuraRuntimeException e) {
            fail("Should not have thrown AuraRuntimeException on abstract component extending component.");
        }
    }
View Full Code Here

        DefDescriptor<ComponentDef> desc = DefDescriptorImpl.getInstance("test:fakeAbstractParent", ComponentDef.class);
        builder.extendsDescriptor = desc;
        ComponentDef cmp = builder.build();

        try {
            cmp.validateDefinition();
        } catch (AuraRuntimeException e) {
            fail("Should not have thrown AuraRuntimeException on abstract component extending abstract component.");
        }
    }
View Full Code Here

        builder.interfaces = interfaces;

        ComponentDef cmp = builder.build();

        try {
            cmp.validateDefinition();
        } catch (AuraRuntimeException e) {
            fail("Should not have thrown AuraRuntimeException on abstract component implementing interface.");
        }
    }
View Full Code Here

        ComponentDefImpl.Builder builder = createAbstractBuilder();
        builder.events = eventDefs;
        ComponentDef cmp = builder.build();

        try {
            cmp.validateDefinition();
        } catch (AuraRuntimeException e) {
            fail("Should not have thrown AuraRuntimeException on abstract component containing events.");
        }
    }
View Full Code Here

        DefDescriptor<ComponentDef> desc = DefDescriptorImpl.getInstance("test:text", ComponentDef.class);
        builder.extendsDescriptor = desc;
        ComponentDef cmp = builder.build();

        try {
            cmp.validateDefinition();
        } catch (AuraRuntimeException e) {
            fail("Should not have thrown AuraRuntimeException on abstract component extending text component.");
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.