Examples of validateDefinition()


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

                descriptor,
                String.format("<aura:component><aura:registerevent type='%s'/></aura:component>",eventDesc.getDescriptorName()),
                "myID", Format.XML);
      ComponentDef def = parser.parse(descriptor, source);
        try {
          def.validateDefinition();
            fail("Missing name for component event should be flagged");
        } catch (Exception e) {
          assertExceptionMessageEndsWith(e, InvalidDefinitionException.class, "name is a required attribute on tag registerevent");
        }
    }
View Full Code Here

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

                descriptor,
                String.format("<aura:component><aura:registerevent type='%s'/></aura:component>",eventDesc.getDescriptorName()),
                "myID", Format.XML);
      ComponentDef def = parser.parse(descriptor, source);
        try {
          def.validateDefinition();
            fail("Missing name for application event should be flagged");
        } catch (Exception e) {
          assertExceptionMessageEndsWith(e, InvalidDefinitionException.class, "name is a required attribute on tag registerevent");
        }
    }
View Full Code Here

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

                "<aura:component><aura:clientLibrary name='HTML5Shiv' type='fooBar' /></aura:component>", "myID",
                Format.XML);

        ComponentDef cd = parser.parse(descriptor, source);
        try {
            cd.validateDefinition();
            fail("Should have failed on encountering bad type attribute");
        } catch (Exception e) {
            checkExceptionFull(e, InvalidDefinitionException.class, "Missing valid type");
        }
    }
View Full Code Here

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

        StringSource<ComponentDef> source = new StringSource<>(descriptor,
                "<aura:component><aura:clientLibrary name='HTML5Shiv' type='JS, CSS' /></aura:component>", "myID",
                Format.XML);
        ComponentDef cd = parser.parse(descriptor, source);
        try {
            cd.validateDefinition();
            fail("Should accept only valid types for type attribute.");
        } catch (Exception e) {
            checkExceptionFull(e, InvalidDefinitionException.class, "Missing valid type");
        }
    }
View Full Code Here

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

                        "<aura:clientLibrary name='HTML5Shiv' type='JS' modes='fooBar'/>" +
                        "</aura:component>", "myID",
                Format.XML);
        ComponentDef cd = parser.parse(descriptor, source);
        try {
          cd.validateDefinition();
            fail("Should not accept invalid mode specification.");
        } catch (Exception e) {
            checkExceptionFull(e, InvalidDefinitionException.class, "Invalid mode specified");
        }
    }
View Full Code Here

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

        StringSource<ComponentDef> source = new StringSource<>(descriptor, "<aura:component>"
                + "<aura:registerevent name='dupName' type='aura:click'/>"
                + "<aura:registerevent name='dupName' type='aura:click'/>" + "</aura:component>", "myID", Format.XML);
        ComponentDef cd = parser.parse(descriptor, source);
        try {
            cd.validateDefinition();
            fail("Should have thrown AuraRuntimeException for registering two events with the same name");
        } catch (Exception e) {
            checkExceptionContains(e, InvalidDefinitionException.class,
                    "Multiple events registered with name");
        }
View Full Code Here

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

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

        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

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

        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

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

        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
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.