Package com.google.visualization.datasource.query

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


    }
  }

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


    }
  }

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

  }

  // SKIPPING tests

  public void testSkipping() throws Exception {
    Query query = QueryBuilder.getInstance().parseQuery(" skipping 10 ");
    assertEquals(10, query.getRowSkipping());
  }
View Full Code Here

    assertEquals(10, query.getRowSkipping());
  }
 
  public void testNegativeSkipping() throws Exception {
    try {
      Query query = QueryBuilder.getInstance().parseQuery(" skipping -1 ");
      fail("Should have thrown an exception.");
    } catch (InvalidQueryException e) {
      // Expected behavior.
    }
  }
View Full Code Here

    }
  }
 
  public void testZeroSkipping() throws Exception {
    // Zero value is OK, it means no skipping
    Query query = QueryBuilder.getInstance().parseQuery(" skipping 0 ");
    assertEquals(0, query.getRowSkipping());
  }
View Full Code Here

    Query query = QueryBuilder.getInstance().parseQuery(" skipping 0 ");
    assertEquals(0, query.getRowSkipping());
  }
 
  public void testSkippingLimitAndOffset() throws Exception {
    Query query = QueryBuilder.getInstance().parseQuery(" skipping 10 limit 100 offset 10  ");
    assertEquals(10, query.getRowSkipping());
    assertEquals(100, query.getRowLimit());
    assertEquals(10, query.getRowOffset());
  }
View Full Code Here

    assertEquals(10, query.getRowOffset());
  }
 
  public void testUnorderedLimitSkippingAndOffset() throws Exception {
    try {
      Query query = QueryBuilder.getInstance().parseQuery(" limit 100 skipping 10 offset 10 ");
      fail("Should have thrown an exception.");
    }
    catch (InvalidQueryException e) {
      // Expected behavior.
    }
View Full Code Here

  }

  // LABEL clause tests

  public void testOneValidLabelWithDoubleQuotes() throws Exception {
    Query query = QueryBuilder.getInstance().parseQuery("select c1 label c1 \"Label 1\" ");
    QueryLabels labels = query.getLabels();
    assertEquals("Label 1", labels.getLabel(new SimpleColumn("c1")));
  }
View Full Code Here

    QueryLabels labels = query.getLabels();
    assertEquals("Label 1", labels.getLabel(new SimpleColumn("c1")));
  }

  public void testOneValidLabelWithSingleQuote() throws Exception {
    Query query = QueryBuilder.getInstance().parseQuery("select c1 label c1 'Label 1' ");
    QueryLabels labels = query.getLabels();
    assertEquals("Label 1", labels.getLabel(new SimpleColumn("c1")));
  }
View Full Code Here

    QueryLabels labels = query.getLabels();
    assertEquals("Label 1", labels.getLabel(new SimpleColumn("c1")));
  }

  public void testTwoValidLabels() throws Exception {
    Query query = QueryBuilder.getInstance().parseQuery(
        "select c1,c2 label c1 'Label 1', c2 'Label 2' ");
    QueryLabels labels = query.getLabels();
    assertEquals("Label 1", labels.getLabel(new SimpleColumn("c1")));
    assertEquals("Label 2", labels.getLabel(new SimpleColumn("c2")));
  }
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.