Examples of validateDefinition()


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

        DependencyDef testDependencyDef = null;

        // Invalid, no parent.
        try {
            testDependencyDef = vendor.makeDependencyDef(null, "aura", null, vendor.makeLocation("f1", 5, 5, 0));
            testDependencyDef.validateDefinition();
            fail("Should have thrown QuickFixException for null parent in DependencyDef's");
        } catch (Exception e) {
            checkExceptionFull(e, InvalidDefinitionException.class, "No parent in DependencyDef", "f1");
        }
View Full Code Here

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

    String description = "testing <code>DocumentationDef</code> &lt;ui:inputText/&gt;";
    String name = "sample Description";
    String docDefSource = "<aura:documentation><aura:description name='"+name+"'>"+description+"</aura:description></aura:documentation>";

    DocumentationDef dd = parse(docDefSource);
    dd.validateDefinition();

    List<DescriptionDef> descDefs = dd.getDescriptionDefs();
    assertEquals(1, descDefs.size());
    assertEquals(name, descDefs.get(0).getName());
    assertEquals(description, descDefs.get(0).getDescription());
View Full Code Here

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

        "<aura:description>"+descriptions[0]+"</aura:description>" +
        "<aura:description>"+descriptions[1]+"</aura:description>" +   
        "</aura:documentation>";

    DocumentationDef dd = parse(docDefSource);
    dd.validateDefinition();

    List<String> descs = dd.getDescriptions();
    assertEquals(2, descs.size());

    for(String d : descriptions){
View Full Code Here

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

    DocumentationDef dd = parse(docDefSource);
    List<DescriptionDef> descDefs = dd.getDescriptionDefs();
   
    //for now we overwrite descriptions if they have same name
    dd.validateDefinition();
    assertEquals(1, descDefs.size());
   
    /* We want to make this a validation error in future 
    try{
      dd.validateDefinition();
View Full Code Here

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

    for(String[] invalidMarkupWithExpectedErrorMessage : invalidMarkupsWithExpectedErrorMessages){
      DocumentationDef dd = parse(invalidMarkupWithExpectedErrorMessage[0]);

      try{
        dd.validateDefinition();
        fail("Validation should have failed as markup is not valid");
      }
      catch(QuickFixException qfe){
        String actualMessage = qfe.getMessage();
        assertNotNull(actualMessage);
View Full Code Here

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

    String exampleDesc = "example description";
    String example = "<aura:example name='"+exampleName+"' ref='"+exampleRef+"' label='"+exampleLabel+"'>"+exampleDesc+"</aura:example>";
    String docDefSource = "<aura:documentation><aura:description>"+description+"</aura:description>"+example+"</aura:documentation>";

    DocumentationDef dd = parse(docDefSource);
    dd.validateDefinition();

    List<ExampleDef> descDefs = dd.getExampleDefs();
    assertEquals(1, descDefs.size());
    ExampleDef ed = descDefs.get(0);
    assertEquals(exampleLabel, ed.getLabel());
View Full Code Here

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

    DocumentationDef dd = parse(docDefSource);
    List<ExampleDef> exDefs = dd.getExampleDefs();
   
    //for now we overwrite examples if they have same name
    dd.validateDefinition();
    assertEquals(1, exDefs.size());
   
    /* We want to make this a validation error in future   
    try{
      dd.validateDefinition();
View Full Code Here

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

        "<aura:example name='"+examples[0]+"' ref='foo:bar1' label='"+examples[0]+"'>"+examples[0]+"</aura:example>" +
        "<aura:example name='"+examples[1]+"' ref='foo:bar2' label='"+examples[1]+"'>"+examples[1]+"</aura:example>" +     
        "</aura:documentation>";

    DocumentationDef dd = parse(docDefSource);
    dd.validateDefinition();

    Map<String, ExampleDef> exDefs = dd.getExampleDefsAsMap();
    assertEquals(2, exDefs.size());

    for(String d : examples){ 
View Full Code Here

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

        DefDescriptor<EventDef> descriptor = DefDescriptorImpl.getInstance("aura:testevent", EventDef.class);
        StringSource<EventDef> source = new StringSource<>(descriptor,
                "<aura:event type='component' abstract='true'></aura:event>", "myID", Format.XML);
        EventDef ed = parser.parse(descriptor, source);
        try {
            ed.validateDefinition();
            fail("Should have thrown AuraRuntimeException for creating an abstract event");
        } catch (Exception e) {
            checkExceptionContains(e, InvalidDefinitionException.class,
                    "Invalid attribute \"abstract\"");
        }
View Full Code Here

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

    public void testEmpty() throws Exception {
        String code = "";
        StringSource<IncludeDef> source = new StringSource<>(descriptor, code, null, null);
        JavascriptIncludeDefHandler handler = new JavascriptIncludeDefHandler(descriptor, source);
        IncludeDef def = handler.getDefinition();
        def.validateDefinition();
        assertEquals(code, def.getCode().trim());
    }

    public void testFunction() throws Exception {
        String code = "function(){return 'anything'}";
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.