blurQueryRow.setQuery(queryRow);
blurQueryRow.setUseCacheIfPresent(false);
blurQueryRow.setCacheResult(false);
String uuid = "5678";
blurQueryRow.setUuid(uuid);
final User user = new User("testuser", new HashMap<String, String>());
try {
IndexManager.DEBUG_RUN_SLOW.set(true);
new Thread(new Runnable() {
@Override
public void run() {
try {
UserContext.setUser(user);
// This call will take several seconds to execute.
client.query(tableName, blurQueryRow);
} catch (BlurException e) {
// e.printStackTrace();
} catch (TException e) {
e.printStackTrace();
}
}
}).start();
Thread.sleep(500);
BlurQueryStatus queryStatusById = client.queryStatusById(tableName, uuid);
assertEquals(user.getUsername(), queryStatusById.getUser().getUsername());
assertEquals(queryStatusById.getState(), QueryState.RUNNING);
client.cancelQuery(tableName, uuid);
} finally {
IndexManager.DEBUG_RUN_SLOW.set(false);
}