use of io.crate.testing.SQLResponse in project crate by crate.
the class SysCheckerIntegrationTest method testMinimumMasterNodesCheckWithResetCorrectSetting.
@Test
public void testMinimumMasterNodesCheckWithResetCorrectSetting() {
int setMinimumMasterNodes = numberOfMasterNodes() / 2 + 1;
execute("set global discovery.zen.minimum_master_nodes=?", new Object[] { setMinimumMasterNodes });
SQLResponse response = execute("select severity, passed from sys.checks where id=?", new Object[] { 1 });
assertThat(TestingHelpers.printedTable(response.rows()), is("3| true\n"));
}
use of io.crate.testing.SQLResponse in project crate by crate.
the class SysCheckerIntegrationTest method testNumberOfPartitionCheckPassedForDocTablesCustomAndDefaultSchemas.
@Test
public void testNumberOfPartitionCheckPassedForDocTablesCustomAndDefaultSchemas() {
execute("create table foo.bar (id int) partitioned by (id)");
execute("create table bar (id int) partitioned by (id)");
execute("insert into foo.bar (id) values (?)", new Object[] { 1 });
execute("insert into bar (id) values (?)", new Object[] { 1 });
SQLResponse response = execute("select severity, passed from sys.checks where id=?", new Object[] { 2 });
assertThat(TestingHelpers.printedTable(response.rows()), is("2| true\n"));
}
use of io.crate.testing.SQLResponse in project crate by crate.
the class SysCheckerIntegrationTest method testMinimumMasterNodesCheckSetNotCorrectNumberOfMasterNodes.
@Test
public void testMinimumMasterNodesCheckSetNotCorrectNumberOfMasterNodes() throws InterruptedException {
int setMinimumMasterNodes = numberOfMasterNodes() / 2;
execute("set global discovery.zen.minimum_master_nodes=?", new Object[] { setMinimumMasterNodes });
SQLResponse response = execute("select severity, passed from sys.checks where id=?", new Object[] { 1 });
assertThat(TestingHelpers.printedTable(response.rows()), is("3| false\n"));
}
use of io.crate.testing.SQLResponse in project crate by crate.
the class SysShardsTest method testSelectGlobalCountAndOthers.
@Test
public void testSelectGlobalCountAndOthers() throws Exception {
SQLResponse response = execute("select count(*), max(table_name) from sys.shards");
assertEquals(1L, response.rowCount());
assertEquals(26L, response.rows()[0][0]);
assertEquals("quotes", response.rows()[0][1]);
}
use of io.crate.testing.SQLResponse in project crate by crate.
the class SysShardsTest method testSelectGroupByAllTables.
@Test
public void testSelectGroupByAllTables() throws Exception {
SQLResponse response = execute("select count(*), table_name from sys.shards " + "group by table_name order by table_name");
assertEquals(3L, response.rowCount());
assertEquals(10L, response.rows()[0][0]);
assertEquals("blobs", response.rows()[0][1]);
assertEquals("characters", response.rows()[1][1]);
assertEquals("quotes", response.rows()[2][1]);
}
Aggregations