kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 1c8ac384bf5a480dc55b68b43a6ea863ad9f19424beee1121c08ac105e2752da |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2015-07-03 17:52 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-07-03 19:21 +02:00 |
| Parents | 500d183ecd2a |
1 file changed
modified driver-core/src/test/java/com/datastax/driver/core/ExceptionsTest.java +7 −5
| @@ -15,6 +15,8 @@ | ||
| 15 | 15 | */ |
| 16 | 16 | package com.datastax.driver.core; |
| 17 | 17 | |
| 18 | +import java.util.Locale; | |
| 19 | + | |
| 18 | 20 | import com.datastax.driver.core.exceptions.*; |
| 19 | 21 | import org.testng.annotations.Test; |
| 20 | 22 | |
| @@ -192,7 +194,7 @@ | ||
| 192 | 194 | c.session.execute("USE " + keyspace); |
| 193 | 195 | c.session.execute(String.format(TestUtils.CREATE_TABLE_SIMPLE_FORMAT, table)); |
| 194 | 196 | |
| 195 | - c.session.execute(new SimpleStatement(String.format(TestUtils.INSERT_FORMAT, table, key, "foo", 42, 24.03f)).setConsistencyLevel(ConsistencyLevel.ALL)); | |
| 197 | + c.session.execute(new SimpleStatement(String.format(Locale.US, TestUtils.INSERT_FORMAT, table, key, "foo", 42, 24.03f)).setConsistencyLevel(ConsistencyLevel.ALL)); | |
| 196 | 198 | c.session.execute(new SimpleStatement(String.format(TestUtils.SELECT_ALL_FORMAT, table)).setConsistencyLevel(ConsistencyLevel.ALL)); |
| 197 | 199 | |
| 198 | 200 | c.cassandraCluster.forceStop(2); |
| @@ -308,7 +310,7 @@ | ||
| 308 | 310 | c.session.execute("USE " + keyspace); |
| 309 | 311 | c.session.execute(String.format(TestUtils.CREATE_TABLE_SIMPLE_FORMAT, table)); |
| 310 | 312 | |
| 311 | - c.session.execute(new SimpleStatement(String.format(TestUtils.INSERT_FORMAT, table, key, "foo", 42, 24.03f)).setConsistencyLevel(ConsistencyLevel.ALL)); | |
| 313 | + c.session.execute(new SimpleStatement(String.format(Locale.US, TestUtils.INSERT_FORMAT, table, key, "foo", 42, 24.03f)).setConsistencyLevel(ConsistencyLevel.ALL)); | |
| 312 | 314 | c.session.execute(new SimpleStatement(String.format(TestUtils.SELECT_ALL_FORMAT, table)).setConsistencyLevel(ConsistencyLevel.ALL)); |
| 313 | 315 | |
| 314 | 316 | c.cassandraCluster.stop(2); |
| @@ -326,7 +328,7 @@ | ||
| 326 | 328 | } |
| 327 | 329 | |
| 328 | 330 | try{ |
| 329 | - c.session.execute(new SimpleStatement(String.format(TestUtils.INSERT_FORMAT, table, key, "foo", 42, 24.03f)).setConsistencyLevel(ConsistencyLevel.ALL)); | |
| 331 | + c.session.execute(new SimpleStatement(String.format(Locale.US, TestUtils.INSERT_FORMAT, table, key, "foo", 42, 24.03f)).setConsistencyLevel(ConsistencyLevel.ALL)); | |
| 330 | 332 | } catch (UnavailableException e) { |
| 331 | 333 | String expectedError = String.format("Not enough replica available for query at consistency %s (%d required but only %d alive)", "ALL", 3, 2); |
| 332 | 334 | assertEquals(e.getMessage(), expectedError); |
| @@ -361,12 +363,12 @@ | ||
| 361 | 363 | c.session.execute("USE " + keyspace); |
| 362 | 364 | c.session.execute(String.format(TestUtils.CREATE_TABLE_SIMPLE_FORMAT, table)); |
| 363 | 365 | |
| 364 | - c.session.execute(new SimpleStatement(String.format(TestUtils.INSERT_FORMAT, table, key, "foo", 42, 24.03f)).setConsistencyLevel(ConsistencyLevel.ALL)); | |
| 366 | + c.session.execute(new SimpleStatement(String.format(Locale.US, TestUtils.INSERT_FORMAT, table, key, "foo", 42, 24.03f)).setConsistencyLevel(ConsistencyLevel.ALL)); | |
| 365 | 367 | c.session.execute(new SimpleStatement(String.format(TestUtils.SELECT_ALL_FORMAT, table)).setConsistencyLevel(ConsistencyLevel.ALL)); |
| 366 | 368 | |
| 367 | 369 | c.cassandraCluster.forceStop(2); |
| 368 | 370 | try{ |
| 369 | - c.session.execute(new SimpleStatement(String.format(TestUtils.INSERT_FORMAT, table, key, "foo", 42, 24.03f)).setConsistencyLevel(ConsistencyLevel.ALL)); | |
| 371 | + c.session.execute(new SimpleStatement(String.format(Locale.US, TestUtils.INSERT_FORMAT, table, key, "foo", 42, 24.03f)).setConsistencyLevel(ConsistencyLevel.ALL)); | |
| 370 | 372 | } catch (WriteTimeoutException e) { |
| 371 | 373 | assertEquals(e.getConsistencyLevel(), ConsistencyLevel.ALL); |
| 372 | 374 | assertEquals(e.getReceivedAcknowledgements(), 2); |