kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 06b2eac624d26b648753252ee14952bc189c42c8def251c49e878ead0db43b29 |
|---|---|
| Author | GregBestland <Greg.Bestland@datastax.com> · 2017-02-27 10:14 -06:00 |
| Committer | GregBestland <Greg.Bestland@datastax.com> · 2017-02-27 10:14 -06:00 |
| Parents | 1e9ad4f86e72 |
1 file changed
modified driver-core/src/test/java/com/datastax/driver/core/ConsistencyTest.java +0 −21
| @@ -15,7 +15,6 @@ | ||
| 15 | 15 | */ |
| 16 | 16 | package com.datastax.driver.core; |
| 17 | 17 | |
| 18 | - | |
| 19 | 18 | import org.scassandra.Scassandra; |
| 20 | 19 | import org.scassandra.http.client.BatchExecution; |
| 21 | 20 | import org.scassandra.http.client.PreparedStatementExecution; |
| @@ -34,7 +33,6 @@ | ||
| 34 | 33 | |
| 35 | 34 | public class ConsistencyTest { |
| 36 | 35 | |
| 37 | - | |
| 38 | 36 | private static final Logger logger = LoggerFactory.getLogger(ConsistencyTest.class); |
| 39 | 37 | private ScassandraCluster sCluster; |
| 40 | 38 | |
| @@ -42,7 +40,6 @@ | ||
| 42 | 40 | public void setUp() { |
| 43 | 41 | sCluster = ScassandraCluster.builder().withNodes(1).build(); |
| 44 | 42 | sCluster.init(); |
| 45 | - | |
| 46 | 43 | } |
| 47 | 44 | |
| 48 | 45 | @AfterClass(groups = "short") |
| @@ -55,7 +52,6 @@ | ||
| 55 | 52 | clearActivityLog(); |
| 56 | 53 | } |
| 57 | 54 | |
| 58 | - | |
| 59 | 55 | public void clearActivityLog() { |
| 60 | 56 | for (Scassandra node : sCluster.nodes()) { |
| 61 | 57 | node.activityClient().clearAllRecordedActivity(); |
| @@ -75,10 +71,8 @@ | ||
| 75 | 71 | * as null. |
| 76 | 72 | */ |
| 77 | 73 | public void checkSerialCLMatch(ConsistencyLevel expected, String received) { |
| 78 | - | |
| 79 | 74 | if (expected.equals(ConsistencyLevel.SERIAL)) { |
| 80 | 75 | assertNull(received); |
| 81 | - | |
| 82 | 76 | } else { |
| 83 | 77 | assertTrue(received.equals(expected.toString())); |
| 84 | 78 | } |
| @@ -162,8 +156,6 @@ | ||
| 162 | 156 | String batchStateString = "batch_default_cl"; |
| 163 | 157 | BatchExecution batch = executeBatch(session, batchStateString, null, null); |
| 164 | 158 | assertTrue(batch.getConsistency().equals(ConsistencyLevel.LOCAL_ONE.toString())); |
| 165 | - | |
| 166 | - | |
| 167 | 159 | } finally { |
| 168 | 160 | cluster.close(); |
| 169 | 161 | } |
| @@ -194,11 +186,9 @@ | ||
| 194 | 186 | String batchStateString = "batch_query_cl"; |
| 195 | 187 | BatchExecution batch = executeBatch(session, batchStateString, null, null); |
| 196 | 188 | assertTrue(batch.getConsistency().equals(cl.toString())); |
| 197 | - | |
| 198 | 189 | } finally { |
| 199 | 190 | cluster.close(); |
| 200 | 191 | } |
| 201 | - | |
| 202 | 192 | } |
| 203 | 193 | |
| 204 | 194 | /** |
| @@ -230,7 +220,6 @@ | ||
| 230 | 220 | } finally { |
| 231 | 221 | cluster.close(); |
| 232 | 222 | } |
| 233 | - | |
| 234 | 223 | } |
| 235 | 224 | |
| 236 | 225 | /** |
| @@ -247,7 +236,6 @@ | ||
| 247 | 236 | Cluster cluster = builder().withQueryOptions(new QueryOptions().setConsistencyLevel(cl_one)).build(); |
| 248 | 237 | try { |
| 249 | 238 | |
| 250 | - | |
| 251 | 239 | Session session = cluster.connect(); |
| 252 | 240 | |
| 253 | 241 | //Check order of precedence for simple statements |
| @@ -274,7 +262,6 @@ | ||
| 274 | 262 | pse = executePrepared(session, prepareString, cl_all, null); |
| 275 | 263 | assertTrue(pse.getConsistency().equals(cl_all.toString())); |
| 276 | 264 | |
| 277 | - | |
| 278 | 265 | //Check order of precedence for batch statements |
| 279 | 266 | //Construct unique batch statement with no CL defined. |
| 280 | 267 | String batchString = "batch_opts_cl"; |
| @@ -286,11 +273,9 @@ | ||
| 286 | 273 | batchString = "prep_stm_cl"; |
| 287 | 274 | batch = executeBatch(session, batchString, cl_all, null); |
| 288 | 275 | assertTrue(batch.getConsistency().equals(cl_all.toString())); |
| 289 | - | |
| 290 | 276 | } finally { |
| 291 | 277 | cluster.close(); |
| 292 | 278 | } |
| 293 | - | |
| 294 | 279 | } |
| 295 | 280 | |
| 296 | 281 | /** |
| @@ -309,7 +294,6 @@ | ||
| 309 | 294 | Query clQuery = executeSimple(session, queryString, null, cl); |
| 310 | 295 | checkSerialCLMatch(cl, clQuery.getSerialConsistency()); |
| 311 | 296 | |
| 312 | - | |
| 313 | 297 | //Check prepared statement CL |
| 314 | 298 | String prepareString = "preapred_statement_serial_cl"; |
| 315 | 299 | PreparedStatementExecution pse = executePrepared(session, prepareString, null, null); |
| @@ -319,11 +303,9 @@ | ||
| 319 | 303 | String batchStateString = "batch_statement_serial_cl"; |
| 320 | 304 | BatchExecution batch = executeBatch(session, batchStateString, null, null); |
| 321 | 305 | checkSerialCLMatch(cl, batch.getSerialConsistency()); |
| 322 | - | |
| 323 | 306 | } finally { |
| 324 | 307 | cluster.close(); |
| 325 | 308 | } |
| 326 | - | |
| 327 | 309 | } |
| 328 | 310 | |
| 329 | 311 | /** |
| @@ -351,11 +333,8 @@ | ||
| 351 | 333 | String batchStateString = "batch_statement_serial_cl"; |
| 352 | 334 | BatchExecution batch = executeBatch(session, batchStateString, null, cl); |
| 353 | 335 | checkSerialCLMatch(cl, batch.getSerialConsistency()); |
| 354 | - | |
| 355 | 336 | } finally { |
| 356 | 337 | cluster.close(); |
| 357 | 338 | } |
| 358 | - | |
| 359 | 339 | } |
| 360 | - | |
| 361 | 340 | } |