@Test public void testShouldReturnClientTimeout() throws Exception { server.prime(when(query)); thrown.expect(OperationTimedOutException.class); query(new SimpleStatement(query).setReadTimeoutMillis(1000)); }
@AfterClass public static void stopCassandra() { //Sometimes cleaning request to EmbeddedCassandra timeouts but it is not a big deal not to clean embeddedCassandra // because keyspace is dropped and recreated in the initialization of this test. It is better not to break the build // on slow machines try { EmbeddedCassandraServerHelper.cleanEmbeddedCassandra(); } catch (OperationTimedOutException e) { e.printStackTrace(); } }
@Test public void testShouldReturnClientTimeoutWhenUsingNoResult() throws Exception { server.prime(when(query).then(noResult())); thrown.expect(OperationTimedOutException.class); query(new SimpleStatement(query).setReadTimeoutMillis(1000)); }