Search in sources :

Example 16 with WriteResult

use of com.datastax.oss.dsbulk.executor.api.result.WriteResult in project dsbulk by datastax.

the class BulkExecutorTestBase method writeAsyncStringFailSafeTest.

@Test
void writeAsyncStringFailSafeTest() throws Exception {
    BulkExecutor executor = newBulkExecutor(true);
    WriteResult r = executor.writeAsync("should fail").get();
    verifyFailedWriteResult(r);
    verifySession(0, 1);
    verifyListener(0, 1);
}
Also used : WriteResult(com.datastax.oss.dsbulk.executor.api.result.WriteResult) Test(org.junit.jupiter.api.Test)

Example 17 with WriteResult

use of com.datastax.oss.dsbulk.executor.api.result.WriteResult in project dsbulk by datastax.

the class BulkExecutorITBase method writeAsyncStringTest.

// Tests for asynchronous write methods
@Test
void writeAsyncStringTest() throws Exception {
    String query = WRITE_QUERIES.blockFirst();
    WriteResult r = failFastExecutor.writeAsync(query).get();
    verifySuccessfulWriteResult(r, query);
}
Also used : WriteResult(com.datastax.oss.dsbulk.executor.api.result.WriteResult) Test(org.junit.jupiter.api.Test)

Example 18 with WriteResult

use of com.datastax.oss.dsbulk.executor.api.result.WriteResult in project dsbulk by datastax.

the class BulkExecutorITBase method writeSyncStringTest.

// Tests for synchronous write methods
@Test
void writeSyncStringTest() {
    String query = WRITE_QUERIES.blockFirst();
    WriteResult r = failFastExecutor.writeSync(query);
    verifySuccessfulWriteResult(r, query);
}
Also used : WriteResult(com.datastax.oss.dsbulk.executor.api.result.WriteResult) Test(org.junit.jupiter.api.Test)

Example 19 with WriteResult

use of com.datastax.oss.dsbulk.executor.api.result.WriteResult in project dsbulk by datastax.

the class BulkExecutorITBase method writeAsyncStatementTest.

@Test
void writeAsyncStatementTest() throws Exception {
    WriteResult r = failFastExecutor.writeAsync(WRITE_STATEMENT).get();
    verifySuccessfulWriteResult(r, String.format(WRITE_QUERY, 0, 0));
}
Also used : WriteResult(com.datastax.oss.dsbulk.executor.api.result.WriteResult) Test(org.junit.jupiter.api.Test)

Example 20 with WriteResult

use of com.datastax.oss.dsbulk.executor.api.result.WriteResult in project dsbulk by datastax.

the class BulkExecutorITBase method writeAsyncStringFailSafeTest.

@Test
void writeAsyncStringFailSafeTest() throws Exception {
    WriteResult r = failSafeExecutor.writeAsync(FAILED_QUERY).get();
    verifyFailedWriteResult(r);
}
Also used : WriteResult(com.datastax.oss.dsbulk.executor.api.result.WriteResult) Test(org.junit.jupiter.api.Test)

Aggregations

WriteResult (com.datastax.oss.dsbulk.executor.api.result.WriteResult)23 Test (org.junit.jupiter.api.Test)22 Path (java.nio.file.Path)6 DefaultWriteResult (com.datastax.oss.dsbulk.executor.api.result.DefaultWriteResult)5 TooManyErrorsException (com.datastax.oss.dsbulk.workflow.api.error.TooManyErrorsException)4 AllNodesFailedException (com.datastax.oss.driver.api.core.AllNodesFailedException)1 DriverExecutionException (com.datastax.oss.driver.api.core.DriverExecutionException)1 DriverTimeoutException (com.datastax.oss.driver.api.core.DriverTimeoutException)1 RequestThrottlingException (com.datastax.oss.driver.api.core.RequestThrottlingException)1 BusyConnectionException (com.datastax.oss.driver.api.core.connection.BusyConnectionException)1 FrameTooLongException (com.datastax.oss.driver.api.core.connection.FrameTooLongException)1 AsyncResultSet (com.datastax.oss.driver.api.core.cql.AsyncResultSet)1 BatchStatement (com.datastax.oss.driver.api.core.cql.BatchStatement)1 ExecutionInfo (com.datastax.oss.driver.api.core.cql.ExecutionInfo)1 Row (com.datastax.oss.driver.api.core.cql.Row)1 InvalidQueryException (com.datastax.oss.driver.api.core.servererrors.InvalidQueryException)1 QueryExecutionException (com.datastax.oss.driver.api.core.servererrors.QueryExecutionException)1 SyntaxError (com.datastax.oss.driver.api.core.servererrors.SyntaxError)1 BulkExecutionException (com.datastax.oss.dsbulk.executor.api.exception.BulkExecutionException)1 DriverUtils.mockRow (com.datastax.oss.dsbulk.tests.driver.DriverUtils.mockRow)1