assertTrue(batch.getConsistency().equals(cl.toString())); } finally { cluster.close();
/** * When no consistency level is defined the default of LOCAL_ONE should be used. * * @test_category consistency */ @Test(groups = "short") public void should_use_global_default_cl_when_none_specified() throws Throwable { // Build a cluster with no CL level set in the query options. Cluster cluster = builder().build(); try { Session session = cluster.connect(); // Construct unique simple statement query, with no CL defined. // Check to ensure String queryString = "default_cl"; Query clQuery = executeSimple(session, queryString, null, null); assertTrue(clQuery.getConsistency().equals(ConsistencyLevel.LOCAL_ONE.toString())); // Check prepared statement default CL String prepareString = "prepared_default_cl"; PreparedStatementExecution pse = executePrepared(session, prepareString, null, null); assertTrue(pse.getConsistency().equals(ConsistencyLevel.LOCAL_ONE.toString())); // Check batch statement default CL String batchStateString = "batch_default_cl"; BatchExecution batch = executeBatch(session, batchStateString, null, null); assertTrue(batch.getConsistency().equals(ConsistencyLevel.LOCAL_ONE.toString())); } finally { cluster.close(); } }
assertTrue(batch.getConsistency().equals(cl.toString())); } finally { cluster.close();
assertTrue(batch.getConsistency().equals(cl_one.toString())); clearActivityLog(); assertTrue(batch.getConsistency().equals(cl_all.toString())); } finally { cluster.close();
@Override protected boolean match(BatchExecution actualBatchExecution) { if (!actualBatchExecution.getConsistency().equals(expectedBatchExecution.getConsistency())) { return false;
/** * When no consistency level is defined the default of LOCAL_ONE should be used. * * @test_category consistency */ @Test(groups = "short") public void should_use_global_default_cl_when_none_specified() throws Throwable { // Build a cluster with no CL level set in the query options. Cluster cluster = builder().build(); try { Session session = cluster.connect(); // Construct unique simple statement query, with no CL defined. // Check to ensure String queryString = "default_cl"; Query clQuery = executeSimple(session, queryString, null, null); assertTrue(clQuery.getConsistency().equals(ConsistencyLevel.LOCAL_ONE.toString())); // Check prepared statement default CL String prepareString = "prepared_default_cl"; PreparedStatementExecution pse = executePrepared(session, prepareString, null, null); assertTrue(pse.getConsistency().equals(ConsistencyLevel.LOCAL_ONE.toString())); // Check batch statement default CL String batchStateString = "batch_default_cl"; BatchExecution batch = executeBatch(session, batchStateString, null, null); assertTrue(batch.getConsistency().equals(ConsistencyLevel.LOCAL_ONE.toString())); } finally { cluster.close(); } }
assertTrue(batch.getConsistency().equals(cl.toString())); } finally { cluster.close();
assertTrue(batch.getConsistency().equals(cl.toString())); } finally { cluster.close();
assertTrue(batch.getConsistency().equals(cl_one.toString())); clearActivityLog(); assertTrue(batch.getConsistency().equals(cl_all.toString())); } finally { cluster.close();