Package org.cfeclipse.cfmledit.dictionary

Examples of org.cfeclipse.cfmledit.dictionary.Grammar


public class GrammarTest {

  @Test
  public void testLoadLocation() throws IOException, JDOMException {
   
    Grammar g = new Grammar("railo3.xml");
   
    assertEquals(0, g.getTagCount());
    assertEquals(0, g.getFunctionCount());
    assertEquals(0, g.getScopeCount());
    assertEquals(0, g.getCFScopeCount());
   
    g.loadLocation();
   
    assertTrue("There should be more than 0 tags loaded now", g.getTagCount() > 0);
    assertTrue("There should be more than 0 functions loaded now", g.getFunctionCount() > 0);
    assertTrue("There should be more than 0 scopes loaded now", g.getScopeCount() > 0);
    assertTrue("There should be more than 0 CFScopes loaded now", g.getCFScopeCount() > 0);
   

  }
View Full Code Here


   * I have added some tests but as bugs are found with tags, we should split this out to individual tag tests
   * TODO: Create language/tag/function scope tests for each language version
   */
  @Test
  public void testGetTag() throws IOException, JDOMException {
    Grammar g = new Grammar("railo3.xml");
    Tag tag = g.getTag("cfabort");
    assertEquals(tag.getName(), "cfabort");
    assertTrue(tag.getHelp().length()>0);
    assertTrue(tag.isSingle());
    assertFalse(tag.isXMLStyle());
   
    Tag tag1 = g.getTag("cfif");
    assertFalse("CFFIF should allow any tag", tag1.isCanHaveAttributeCollection());
    assertFalse("CFFIF needs a closing CFIF", tag1.isSingle());
   
   
  }
View Full Code Here

   
  }
 
  @Test
  public void testGetFunction() throws IOException, JDOMException {
    Grammar g = new Grammar("railo3.xml");
    Function function = g.getFunction("imageDrawRect");
    assertEquals(function.getName(), "imageDrawRect");
    assertEquals(function.getReturns(), "void");
    assertTrue(function.getHelp().length()>0);
   
  }
View Full Code Here

   
  }
 
  @Test
  public void testGetScope() throws IOException, JDOMException {
    Grammar g = new Grammar("railo3.xml");
    //type="String" value="Server.ColdFusion.ProductName">
    Scope scope= g.getScope("Server.ColdFusion.ProductName");
    assertEquals(scope.getValue(), "Server.ColdFusion.ProductName");
    assertEquals(scope.getType(), "String");
    assertTrue(scope.getHelp().length()>0);
  }
View Full Code Here

    assertTrue(scope.getHelp().length()>0);
  }
 
  @Test
  public void testGetCFScope() throws IOException, JDOMException {
    Grammar g = new Grammar("railo3.xml");
    //type="String" value="Server.ColdFusion.ProductName">
    CFScope cfscope= g.getCFScope("Client");
    assertEquals(cfscope.getName(), "Client");
    assertTrue(cfscope.getHelp().length()>0);
  }
View Full Code Here

TOP

Related Classes of org.cfeclipse.cfmledit.dictionary.Grammar

Copyright © 2018 www.massapicom. 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.