Package com.google.collide.client.util.collections

Examples of com.google.collide.client.util.collections.SimpleStringBag


  /**
   * Tests that used attributes are excluded.
   */
  public void testExclusion() {
    HtmlTagsAndAttributes htmlAttributes = HtmlTagsAndAttributes.getInstance();
    SimpleStringBag excluded = new SimpleStringBag();

    JsonArray<AutocompleteProposal> all = htmlAttributes
        .searchAttributes("html", excluded, "");
    assertNotNull(all);
    assertTrue(all.size() > 3);

    excluded.add(all.get(2).getName());

    JsonArray<AutocompleteProposal> allButOne = htmlAttributes
        .searchAttributes("html", excluded, "");
    assertNotNull(allButOne);

View Full Code Here


  /**
   * Tests that attribute names are (prefix-)filtered.
   */
  public void testFiltering() {
    HtmlTagsAndAttributes htmlAttributes = HtmlTagsAndAttributes.getInstance();
    SimpleStringBag excluded = new SimpleStringBag();

    JsonArray<AutocompleteProposal> all = htmlAttributes
        .searchAttributes("html", excluded, "");
    assertNotNull(all);

View Full Code Here

    lineTokens.add(new Token(CodeMirror2.HTML, TokenType.TAG, "<html"));
    lineTokens.add(new Token(CodeMirror2.HTML, TokenType.WHITESPACE, " "));
    AutocompleteProposals proposals = findAutocompletions();

    assertEquals(htmlAttributes.searchAttributes("html", new SimpleStringBag(), "").size(),
        proposals.size());
    assertEquals("accesskey", proposals.get(0).getName());
  }
View Full Code Here

   * Tests that proposal list is updated when parsing of tag is finished.
   */
  public void testUpdateOnTagFinish() {
    String sampleAttribute = "accesskey";
    HtmlTagsAndAttributes htmlAttributes = HtmlTagsAndAttributes.getInstance();
    SimpleStringBag excluded = new SimpleStringBag();
    assertEquals(1, htmlAttributes.searchAttributes("html", excluded, sampleAttribute).size());
    excluded.add(sampleAttribute);

    JsonArray<Token> tokens1 = JsonCollections.createArray();
    tokens1.add(new Token(CodeMirror2.HTML, TokenType.TAG, "<html"));
    tokens1.add(new Token(CodeMirror2.HTML, TokenType.WHITESPACE, " "));
    String line1 = tokensToText(tokens1);
View Full Code Here

   * Tests that proposal list is updated when parsing of document is finished.
   */
  public void testUpdateOnDocFinish() {
    String sampleAttribute = "accesskey";
    HtmlTagsAndAttributes htmlAttributes = HtmlTagsAndAttributes.getInstance();
    SimpleStringBag excluded = new SimpleStringBag();
    assertEquals(1, htmlAttributes.searchAttributes("html", excluded, sampleAttribute).size());
    excluded.add(sampleAttribute);

    JsonArray<Token> tokens1 = JsonCollections.createArray();
    tokens1.add(new Token(CodeMirror2.HTML, TokenType.TAG, "<html"));
    tokens1.add(new Token(CodeMirror2.HTML, TokenType.WHITESPACE, " "));
    String line1 = tokensToText(tokens1);
View Full Code Here

   * Tests that used attributes are excluded.
   */
  public void testExcludedHtmlAttributes() {
    String reversed = "reversed";
    HtmlTagsAndAttributes htmlAttributes = HtmlTagsAndAttributes.getInstance();
    SimpleStringBag excluded = new SimpleStringBag();
    assertEquals(1, htmlAttributes.searchAttributes("ol", excluded, reversed).size());
    excluded.add(reversed);

    lineTokens.add(new Token(CodeMirror2.HTML, TokenType.TAG, "<ol"));
    lineTokens.add(new Token(CodeMirror2.HTML, TokenType.WHITESPACE, " "));
    lineTokens.add(new Token(CodeMirror2.HTML, TokenType.ATTRIBUTE, reversed));
    lineTokens.add(new Token(CodeMirror2.HTML, TokenType.ATOM, "="));
View Full Code Here

TOP

Related Classes of com.google.collide.client.util.collections.SimpleStringBag

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.