Examples of validateDefinition()


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

                "<aura:application><aura:attribute name=\"implNumber\" type=\"String\"/>"
                        + "<aura:attribute name=\"implNumber\" type=\"String\"/></aura:application>", "myID",
                Format.XML);
        ApplicationDef ad = parser.parse(descriptor, source);
        try {
            ad.validateDefinition();
            fail("Should have thrown Exception. Two attributes with the same name cannot exist");
        } catch (Exception e) {
            checkExceptionContains(e, InvalidDefinitionException.class,
                    "Duplicate definitions for attribute implNumber");
        }
View Full Code Here

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

        Set<AuraContext.Mode> modes = Collections.emptySet();

        try {
            def = vendor.makeClientLibraryDef(null, null, ClientLibraryDef.Type.JS, modes, false,
                    vendor.makeComponentDefDescriptor("comp"), vendor.makeLocation("f1", 5, 5, 0));
            def.validateDefinition();
            fail("Should have thrown InvalidDefinitionException for no name");
        } catch (Exception e) {
            checkExceptionFull(e, InvalidDefinitionException.class, "Must have either a name or url");
        }
View Full Code Here

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

        }

        try {
            def = vendor.makeClientLibraryDef("", null, ClientLibraryDef.Type.JS, modes, false,
                    vendor.makeComponentDefDescriptor("comp"), vendor.makeLocation("f1", 5, 5, 0));
            def.validateDefinition();
            fail("Should have thrown InvalidDefinitionException for Empty name");
        } catch (Exception e) {
            checkExceptionFull(e, InvalidDefinitionException.class, "Must have either a name or url");
        }
View Full Code Here

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

        }

        try {
            def = vendor.makeClientLibraryDef("hello", null, null, modes, false,
                    vendor.makeComponentDefDescriptor("comp"), vendor.makeLocation("f1", 5, 5, 0));
            def.validateDefinition();
            fail("Should have thrown InvalidDefinitionException for no type");
        } catch (Exception e) {
            checkExceptionFull(e, InvalidDefinitionException.class, "Missing required type");
        }
View Full Code Here

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

        }

        try {
            def = vendor.makeClientLibraryDef("hello", null, ClientLibraryDef.Type.JS, modes, false,
                    null, vendor.makeLocation("f1", 5, 5, 0));
            def.validateDefinition();
            fail("Should have thrown InvalidDefinitionException for no parent descriptor");
        } catch (Exception e) {
            checkExceptionFull(e, InvalidDefinitionException.class, "No parent for ClientLibraryDef");
        }
View Full Code Here

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

        }

        try {
            def = vendor.makeClientLibraryDef("hello", "somewhere/somefile.css", ClientLibraryDef.Type.JS, modes, false,
                    vendor.makeComponentDefDescriptor("comp"), vendor.makeLocation("f1", 5, 5, 0));
            def.validateDefinition();
            fail("Should have thrown InvalidDefinitionException for invalid file extension ");
        } catch (Exception e) {
            checkExceptionFull(e, InvalidDefinitionException.class, "Url file extension must match type");
        }
View Full Code Here

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

        String markup = "<aura:clientLibrary name='urlAndTypeMismatch' url='js://clientLibraryTest.clientLibraryTest' type='CSS'/>";
        DefDescriptor<ComponentDef> cmp = addSourceAutoCleanup(ComponentDef.class,
                String.format(baseComponentTag, "", markup));
        try {
            ComponentDef def = cmp.getDef();
            def.validateDefinition();
            fail("Should flag an error when resource type and specified type attribute do not match.");
        } catch (InvalidDefinitionException e) {
            assertEquals("ResourceDef type must match library type", e.getMessage());
        }
    }
View Full Code Here

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

                descriptor,
                "<aura:component><aura:registerevent name='aura:click' description='The Description' access='fakeAccessLevel'/></aura:component>",
                "myID", Format.XML);
        ComponentDef cd = parser.parse(descriptor, source);
        try {
            cd.validateDefinition();
            fail("Should have thrown AuraException because access level isn't public or global");
        } catch (InvalidDefinitionException e) {

        }
    }
View Full Code Here

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

                descriptor,
                "<aura:component><aura:registerevent name='aura:click' description='The Description' access='global'>invalidtext</aura:registerevent></aura:component>",
                "myID", Format.XML);
        ComponentDef cd = parser.parse(descriptor, source);
        try {
            cd.validateDefinition();
            fail("Should have thrown AuraException because text is between aura:registerevent tags");
        } catch (InvalidDefinitionException e) {

        }
    }
View Full Code Here

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

        StringSource<ComponentDef> source = new StringSource<>(
                descriptor,"<aura:component><aura:registerevent name='wheresthetype'/></aura:component>",
                "myID", Format.XML);
      ComponentDef def = parser.parse(descriptor, source);
        try {
          def.validateDefinition();
            fail("Missing type for event should be flagged");
        } catch (Exception e) {
          assertExceptionMessageEndsWith(e, InvalidDefinitionException.class, "type attribute is required on registerevent");
        }
    }
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.