Sets up a pair of scanners with either a list of values or no data @param no_data Whether or not to return 0 data.
(final boolean no_data)
| 453 | * @param no_data Whether or not to return 0 data. |
| 454 | */ |
| 455 | protected void setupMockScanners(final boolean no_data) throws Exception { |
| 456 | if (Const.SALT_WIDTH() > 0) { |
| 457 | scanners = new ArrayList<Scanner>(Const.SALT_BUCKETS()); |
| 458 | scanner_a = mock(Scanner.class); |
| 459 | scanner_b = mock(Scanner.class); |
| 460 | if (no_data) { |
| 461 | when(scanner_a.nextRows()).thenReturn( |
| 462 | Deferred.<ArrayList<ArrayList<KeyValue>>>fromResult(null)); |
| 463 | when(scanner_b.nextRows()).thenReturn( |
| 464 | Deferred.<ArrayList<ArrayList<KeyValue>>>fromResult(null)); |
| 465 | } else { |
| 466 | setupValues(); |
| 467 | } |
| 468 | scanners.add(scanner_a); |
| 469 | scanners.add(scanner_b); |
| 470 | } else { |
| 471 | scanners = new ArrayList<Scanner>(1); |
| 472 | scanner_a = mock(Scanner.class); |
| 473 | if (no_data) { |
| 474 | when(scanner_a.nextRows()).thenReturn( |
| 475 | Deferred.<ArrayList<ArrayList<KeyValue>>>fromResult(null)); |
| 476 | } else { |
| 477 | setupValues(); |
| 478 | } |
| 479 | scanners.add(scanner_a); |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | /** |
| 484 | * This method sets up some row keys and values to pass to the scanners. |
no test coverage detected