Package com.google.visualization.datasource.query

Examples of com.google.visualization.datasource.query.Query


    assertEquals("Label 2", labels.getLabel(new SimpleColumn("c2")));
  }

  public void testInvalidLabel() throws Exception {
    try {
      Query query = QueryBuilder.getInstance().parseQuery("select c1 label c1 gaga ");
      fail("Should have thrown an exception.");
    } catch (InvalidQueryException e) {
      // Expected behavior.
    }
  }
View Full Code Here


    }
  }

  public void testInvalidEmptyLabel() throws Exception {
    try {
      Query query = QueryBuilder.getInstance().parseQuery("select c1 label c1 ");
      fail("Should have thrown an exception.");
    } catch (InvalidQueryException e) {
      // Expected behavior.
    }
  }
View Full Code Here

    }
  }

  public void testDuplicateLabelColumn() throws Exception {
    try {
      Query query = QueryBuilder.getInstance().parseQuery("select c1 label c1 'gaga', c1 'gugu' ");
      fail("Should have thrown an exception.");
    } catch (InvalidQueryException e) {
      // Expected behavior.
    }
  }
View Full Code Here

    }
  }

  public void testInvalidTwoLabelsNoComma() throws Exception {
    try {
      Query query = QueryBuilder.getInstance().parseQuery(
          "select c1, c2 label c1,c2 'label 1' c2 'label 2' ");
      fail("Should have thrown an exception.");
    } catch (InvalidQueryException e) {
      // Expected behavior.
    }
View Full Code Here

  }

  // FORMAT clause tests

  public void testOneValidFormatWithDoubleQuotes() throws Exception {
    Query query = QueryBuilder.getInstance().parseQuery("select c1 Format c1 \"Format 1\" ");
    QueryFormat formats = query.getUserFormatOptions();
    assertEquals("Format 1", formats.getPattern(new SimpleColumn("c1")));
  }
View Full Code Here

    QueryFormat formats = query.getUserFormatOptions();
    assertEquals("Format 1", formats.getPattern(new SimpleColumn("c1")));
  }

  public void testOneValidFormatWithSingleQuote() throws Exception {
    Query query = QueryBuilder.getInstance().parseQuery("select c1 Format c1 'Format 1' ");
    QueryFormat formats = query.getUserFormatOptions();
    assertEquals("Format 1", formats.getPattern(new SimpleColumn("c1")));
  }
View Full Code Here

    QueryFormat formats = query.getUserFormatOptions();
    assertEquals("Format 1", formats.getPattern(new SimpleColumn("c1")));
  }

  public void testTwoValidFormats() throws Exception {
    Query query = QueryBuilder.getInstance().parseQuery(
        "select c1,c2 Format c1 'Format 1', c2 'Format 2' ");
    QueryFormat formats = query.getUserFormatOptions();
    assertEquals("Format 1", formats.getPattern(new SimpleColumn("c1")));
    assertEquals("Format 2", formats.getPattern(new SimpleColumn("c2")));
  }
View Full Code Here

    assertEquals("Format 2", formats.getPattern(new SimpleColumn("c2")));
  }

  public void testInvalidFormat() throws Exception {
    try {
      Query query = QueryBuilder.getInstance().parseQuery("select c1 Format c1 gaga ");
      fail("Should have thrown an exception.");
    } catch (InvalidQueryException e) {
      // Expected behavior.
    }
  }
View Full Code Here

    }
  }

  public void testInvalidEmptyFormat() throws Exception {
    try {
      Query query = QueryBuilder.getInstance().parseQuery("select c1 Format c1 ");
      fail("Should have thrown an exception.");
    } catch (InvalidQueryException e) {
      // Expected behavior.
    }
  }
View Full Code Here

    }
  }

  public void testInvalidTwoFormatsNoComma() throws Exception {
    try {
      Query query = QueryBuilder.getInstance().parseQuery(
          "select c1,c2 Format c1 'Format 1' c2 'Format 2' ");
      fail("Should have thrown an exception.");
    } catch (InvalidQueryException e) {
      // Expected behavior.
    }
View Full Code Here

TOP

Related Classes of com.google.visualization.datasource.query.Query

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.