3131import java .lang .reflect .Method ;
3232import java .net .URI ;
3333import java .util .ArrayList ;
34- import java .util .Arrays ;
34+ import java .util .Collections ;
3535import java .util .HashMap ;
3636import java .util .HashSet ;
3737import java .util .List ;
@@ -159,7 +159,7 @@ void asyncApiBigDataTest() throws Throwable
159159 }
160160
161161 @ Test
162- void rxApiBigDataTest () throws Throwable
162+ void rxApiBigDataTest ()
163163 {
164164 assertRxIsAvailable ();
165165 Bookmark bookmark = createNodesRx ( bigDataTestBatchCount (), BIG_DATA_TEST_BATCH_SIZE , driver );
@@ -221,7 +221,17 @@ Config config()
221221
222222 abstract C createContext ();
223223
224- abstract List <BlockingCommand <C >> createTestSpecificBlockingCommands ();
224+ List <BlockingCommand <C >> createTestSpecificBlockingCommands () {
225+ return Collections .emptyList ();
226+ }
227+
228+ List <AsyncCommand <C >> createTestSpecificAsyncCommands () {
229+ return Collections .emptyList ();
230+ }
231+
232+ List <RxCommand <C >> createTestSpecificRxCommands () {
233+ return Collections .emptyList ();
234+ }
225235
226236 abstract boolean handleWriteFailure ( Throwable error , C context );
227237
@@ -245,23 +255,15 @@ private List<BlockingCommand<C>> createBlockingCommands()
245255 {
246256 List <BlockingCommand <C >> commands = new ArrayList <>();
247257
248- commands .add ( new BlockingReadQuery <>( driver , false ) );
249- commands .add ( new BlockingReadQuery <>( driver , true ) );
250-
251- commands .add ( new BlockingReadQueryInTx <>( driver , false ) );
252- commands .add ( new BlockingReadQueryInTx <>( driver , true ) );
258+ commands .add ( new BlockingReadQueryWithRetries <>( driver , false ) );
259+ commands .add ( new BlockingReadQueryWithRetries <>( driver , true ) );
253260
254- commands .add ( new BlockingWriteQuery <>( this , driver , false ) );
255- commands .add ( new BlockingWriteQuery <>( this , driver , true ) );
261+ commands .add ( new BlockingWriteQueryWithRetries <>( this , driver , false ) );
262+ commands .add ( new BlockingWriteQueryWithRetries <>( this , driver , true ) );
256263
257- commands .add ( new BlockingWriteQueryInTx <>( this , driver , false ) );
258- commands .add ( new BlockingWriteQueryInTx <>( this , driver , true ) );
264+ commands .add ( new BlockingWrongQueryWithRetries <>( driver ) );
259265
260- commands .add ( new BlockingWrongQuery <>( driver ) );
261- commands .add ( new BlockingWrongQueryInTx <>( driver ) );
262-
263- commands .add ( new BlockingFailingQuery <>( driver ) );
264- commands .add ( new BlockingFailingQueryInTx <>( driver ) );
266+ commands .add ( new BlockingFailingQueryWithRetries <>( driver ) );
265267
266268 commands .add ( new FailedAuth <>( databaseUri (), config () ) );
267269
@@ -299,29 +301,19 @@ private List<Future<?>> launchRxWorkerThreads( C context )
299301
300302 private List <RxCommand <C >> createRxCommands ()
301303 {
302- return Arrays .asList (
303- new RxReadQuery <>( driver , false ),
304- new RxReadQuery <>( driver , true ),
305-
306- new RxWriteQuery <>( this , driver , false ),
307- new RxWriteQuery <>( this , driver , true ),
304+ List <RxCommand <C >> commands = new ArrayList <>();
308305
309- new RxReadQueryInTx <>( driver , false ),
310- new RxReadQueryInTx <>( driver , true ),
306+ commands . add ( new RxReadQueryWithRetries <>( driver , false ) );
307+ commands . add ( new RxReadQueryWithRetries <>( driver , true ) );
311308
312- new RxWriteQueryInTx <>( this , driver , false ),
313- new RxWriteQueryInTx <>( this , driver , true ),
309+ commands . add ( new RxWriteQueryWithRetries <>( this , driver , false ) );
310+ commands . add ( new RxWriteQueryWithRetries <>( this , driver , true ) );
314311
315- new RxReadQueryWithRetries <>( driver , false ),
316- new RxReadQueryWithRetries <>( driver , false ),
312+ commands .add ( new RxFailingQueryWithRetries <>( driver ) );
317313
318- new RxWriteQueryWithRetries <>( this , driver , false ),
319- new RxWriteQueryWithRetries <>( this , driver , true ),
314+ commands .addAll ( createTestSpecificRxCommands () );
320315
321- new RxFailingQuery <>( driver ),
322- new RxFailingQueryInTx <>( driver ),
323- new RxFailingQueryWithRetries <>( driver )
324- );
316+ return commands ;
325317 }
326318
327319 private Future <Void > launchRxWorkerThread ( ExecutorService executor , List <RxCommand <C >> commands , C context )
@@ -367,23 +359,15 @@ private List<AsyncCommand<C>> createAsyncCommands()
367359 {
368360 List <AsyncCommand <C >> commands = new ArrayList <>();
369361
370- commands .add ( new AsyncReadQuery <>( driver , false ) );
371- commands .add ( new AsyncReadQuery <>( driver , true ) );
372-
373- commands .add ( new AsyncReadQueryInTx <>( driver , false ) );
374- commands .add ( new AsyncReadQueryInTx <>( driver , true ) );
375-
376- commands .add ( new AsyncWriteQuery <>( this , driver , false ) );
377- commands .add ( new AsyncWriteQuery <>( this , driver , true ) );
362+ commands .add ( new AsyncReadQueryWithRetries <>( driver , false ) );
363+ commands .add ( new AsyncReadQueryWithRetries <>( driver , true ) );
378364
379- commands .add ( new AsyncWriteQueryInTx <>( this , driver , false ) );
380- commands .add ( new AsyncWriteQueryInTx <>( this , driver , true ) );
365+ commands .add ( new AsyncWriteQueryWithRetries <>( this , driver , false ) );
366+ commands .add ( new AsyncWriteQueryWithRetries <>( this , driver , true ) );
381367
382- commands .add ( new AsyncWrongQuery <>( driver ) );
383- commands .add ( new AsyncWrongQueryInTx <>( driver ) );
368+ commands .add ( new AsyncWrongQueryWithRetries <>( driver ) );
384369
385- commands .add ( new AsyncFailingQuery <>( driver ) );
386- commands .add ( new AsyncFailingQueryInTx <>( driver ) );
370+ commands .add ( new AsyncFailingQueryWithRetries <>( driver ) );
387371
388372 return commands ;
389373 }
0 commit comments