use of com.hazelcast.sql.SqlRow in project hazelcast by hazelcast.
the class NotPredicateIntegrationTest method check.
private void check(String operand, Boolean expectedResult, Object... params) {
String sql = sql(operand);
List<SqlRow> rows = execute(sql, params);
assertEquals(1, rows.size());
SqlRow row = rows.get(0);
assertEquals(1, row.getMetadata().getColumnCount());
assertEquals(SqlColumnType.BOOLEAN, row.getMetadata().getColumn(0).getType());
assertEquals(expectedResult, row.getObject(0));
}
use of com.hazelcast.sql.SqlRow in project hazelcast by hazelcast.
the class LikeFunctionIntegrationTest method check.
private void check(String sql, Boolean expectedResult, Object... params) {
if (negated && expectedResult != null) {
expectedResult = !expectedResult;
}
List<SqlRow> rows = execute(sql, params);
assertEquals(1, rows.size());
SqlRow row = rows.get(0);
assertEquals(1, row.getMetadata().getColumnCount());
assertEquals(SqlColumnType.BOOLEAN, row.getMetadata().getColumn(0).getType());
assertEquals(expectedResult, row.getObject(0));
}
use of com.hazelcast.sql.SqlRow in project hazelcast by hazelcast.
the class SqlClientCursorCleanupTest method testExceptionOnFetch.
@Test
public void testExceptionOnFetch() {
IMap<Integer, Person> map = member.getMap(MAP_NAME);
map.put(0, new Person());
map.put(1, new Person());
map.put(2, new Person());
try {
SqlResult result = client.getSql().execute(statement());
for (SqlRow ignore : result) {
fail = true;
}
fail("Must fail");
} catch (Exception e) {
assertNoState();
}
}
use of com.hazelcast.sql.SqlRow in project hazelcast by hazelcast.
the class SqlNoDeserializationTest method testMember.
@Test
public void testMember() {
try (SqlResult res = instance().getSql().execute(SQL)) {
for (SqlRow row : res) {
SqlRowImpl row0 = (SqlRowImpl) row;
row0.getObjectRaw(0);
row0.getObjectRaw(1);
checkFailure(row, true);
checkFailure(row, false);
}
}
}
use of com.hazelcast.sql.SqlRow in project hazelcast by hazelcast.
the class SqlNoSerializationTest method check.
private void check(String sql, boolean expectedIndexUsage) {
checkIndexUsage(new SqlStatement(sql), expectedIndexUsage);
try (SqlResult res = instance().getSql().execute(sql)) {
int count = 0;
for (SqlRow row : res) {
Object key = row.getObject(0);
Object value = row.getObject(1);
assertTrue(key instanceof Key);
assertTrue(value instanceof Value);
count++;
}
assertEquals(1, count);
}
}
Aggregations