}
@Test
public void testPredicate() throws HBqlException {
ExecutionResults results;
results = connection.execute("DROP TABLE nosuchtable IF tableexists('nosuchtable')");
assertTrue(!results.getPredicate());
results = connection.execute("CREATE TABLE nosuchtable (f1()) IF tableexists('nosuchtable')");
assertTrue(!results.getPredicate());
results = connection.execute("CREATE TEMP MAPPING nosuchmapping IF tableexists('nosuchtable')");
assertTrue(!results.getPredicate());
results = connection.execute("ALTER TABLE nosuchtable DROP FAMILY foo IF tableexists('nosuchtable')");
assertTrue(!results.getPredicate());
results = connection.execute("DISABLE TABLE testtable IF tableexists('testtable')");
results = connection.execute("DROP TABLE testtable IF tableexists('testtable')");
results = connection.execute("CREATE TABLE testtable (f1()) IF NOT tableexists('testtable')");
results = connection.execute("ALTER TABLE testtable ADD FAMILY f1() IF not familyexistsfortable('f1', 'testtable')");
assertTrue(!results.getPredicate());
results = connection.execute("DISABLE TABLE testtable");
results = connection.execute("ALTER TABLE testtable ADD FAMILY f2() IF not familyexistsfortable('f2', 'testtable')");
assertTrue(results.getPredicate());
results = connection.execute("ALTER TABLE testtable ALTER FAMILY f1 TO f3() IF not familyexistsfortable('f3', 'testtable')");
assertTrue(results.getPredicate());
results = connection.execute("DISABLE TABLE nosuchtable IF tableexists('nosuchtable') AND tableenabled('nosuchtable')");
assertFalse(results.getPredicate());
results = connection.execute("ENABLE TABLE testtable");
}