assertTrue(pse.getConsistency().equals(cl.toString()));
/** * 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(pse.getConsistency().equals(cl.toString()));
assertTrue(pse.getConsistency().equals(cl_one.toString())); clearActivityLog(); assertTrue(pse.getConsistency().equals(cl_all.toString()));
@Override protected boolean match(PreparedStatementExecution actualPreparedStatementExecution) { List<CqlType> variableTypes = actualPreparedStatementExecution.getVariableTypes(); List<Object> actualVariables = actualPreparedStatementExecution.getVariables(); if (!actualPreparedStatementExecution.getConsistency().equals(expectedPreparedStatementExecution.getConsistency())) return false; if (!actualPreparedStatementExecution.getPreparedStatementText().equals(expectedPreparedStatementExecution.getPreparedStatementText())) return false; List<Object> expectedVariables = expectedPreparedStatementExecution.getVariables(); return checkVariables(expectedVariables, variableTypes, actualVariables); } }
/** * 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(pse.getConsistency().equals(cl.toString()));
assertTrue(pse.getConsistency().equals(cl.toString()));
assertTrue(pse.getConsistency().equals(cl_one.toString())); clearActivityLog(); assertTrue(pse.getConsistency().equals(cl_all.toString()));