Examples of DocumentationDef


Examples of org.auraframework.def.DocumentationDef

     * @return The documentation def, which explains the spirit and usage of this application or component.
     * @throws QuickFixException
     */
    @Override
    public DocumentationDef getDocumentationDef() throws QuickFixException {
        DocumentationDef def = null;
        if (documentationDescriptor != null) {
            def = documentationDescriptor.getDef();
        }
        return def;
    }
View Full Code Here

Examples of org.auraframework.def.DocumentationDef

  }
 
  private <T extends Definition> void testLoadDocumentationDefViaRootDef(String qualifiedName, Class<T> defType, int noOfDescs)
      throws DefinitionNotFoundException, QuickFixException {
    RootDefinition c = (RootDefinition) Aura.getDefinitionService().getDefinition(qualifiedName, defType);
    DocumentationDef docDef = c.getDocumentationDef();
    assertNotNull("DocumentationDef not found!", docDef);
    assertEquals("Number DescriptionDefs don't match the expected value!", noOfDescs, docDef.getDescriptionDefs().size());
  }
View Full Code Here

Examples of org.auraframework.def.DocumentationDef

                if (ReferenceTreeModel.hasAccess(attribute)) {
                    attributes.add(new AttributeModel(attribute));
                }
            }

            DocumentationDef docDef = rootDef.getDocumentationDef();
            doc = docDef != null ? new DocumentationDefModel(docDef) : null;

            if (definition instanceof BaseComponentDef) {
                BaseComponentDef cmpDef = (BaseComponentDef) definition;
                for (RegisterEventDef reg : cmpDef.getRegisterEventDefs().values()) {
View Full Code Here

Examples of org.auraframework.def.DocumentationDef

  public void testDocDefWithDescription() throws Exception {
    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

    String docDefSource = "<aura:documentation>" +
        "<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){
      assertTrue(descs.contains(d));
    }
View Full Code Here

Examples of org.auraframework.def.DocumentationDef

    String docDefSource = "<aura:documentation>" +
        "<aura:description name='sameName'>foo</aura:description>" +
        "<aura:description name='sameName'>bar</aura:description>" +   
        "</aura:documentation>";

    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

        {"<aura:documentation><aura:description/><aura:example ref='he:er' name='eName'/></aura:documentation>",
        "Attribute 'label' is required on <aura:example>"}
    };

    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

    String exampleRef= "hello:world";
    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());
    assertEquals(exampleName, ed.getName());
    assertEquals(exampleRef, ed.getRef().getNamespace()+":"+ed.getRef().getName());
View Full Code Here

Examples of org.auraframework.def.DocumentationDef

        "<aura:description>random description</aura:description>" +
        "<aura:example name='sameName' ref='foo:bar1' label='label1'>random example</aura:example>" +
        "<aura:example name='sameName' ref='foo:bar2' label='label2'>random example</aura:example>"
        "</aura:documentation>";

    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

        "<aura:description>random description</aura:description>" +
        "<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){ 
      ExampleDef ex = exDefs.get(d);
      assertNotNull(ex);
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.