Package com.google.visualization.datasource.query

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


  }

  // LIMIT and OFFSET tests

  public void testValidLimit() throws Exception {
    Query query = QueryBuilder.getInstance().parseQuery(" limit 100 ");
    assertEquals(100, query.getRowLimit());
  }
View Full Code Here


    assertEquals(100, query.getRowLimit());
  }

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

    }
  }

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

    }
  }

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

      // Expected behavior.
    }
  }

  public void testValidOffset() throws Exception {
    Query query = QueryBuilder.getInstance().parseQuery(" offset 100 ");
    assertEquals(100, query.getRowOffset());
  }
View Full Code Here

    assertEquals(100, query.getRowOffset());
  }

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

    }
  }

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

    }
  }

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

      // Expected behavior.
    }
  }

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

    assertEquals(10, query.getRowOffset());
  }

  public void testReverseLimitAndOffset() throws Exception {
    try {
      Query query = QueryBuilder.getInstance().parseQuery(" offset 10 limit 10 ");
      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.