use of uk.gov.gchq.gaffer.sparkaccumulo.operation.rfilereaderrdd.RFileReaderRDD in project Gaffer by gchq.
the class RFileReaderRddIT method throwRTX_whenRDDHasIncorrectUser.
@Test
public void throwRTX_whenRDDHasIncorrectUser() throws IOException, InterruptedException, AccumuloSecurityException, AccumuloException, TableNotFoundException, TableExistsException {
// Given
final MiniAccumuloCluster cluster = createAccumuloCluster(tableName, config, Arrays.asList("Bananas"));
final RFileReaderRDD rdd = new RFileReaderRDD(sparkSession.sparkContext(), cluster.getInstanceName(), cluster.getZooKeepers(), "Incorrect Username", "", tableName, new HashSet<>(), serialiseConfiguration(config));
// When / Then
assertThatExceptionOfType(RuntimeException.class).isThrownBy(rdd::getPartitions).withMessage("Exception connecting to Accumulo");
}
use of uk.gov.gchq.gaffer.sparkaccumulo.operation.rfilereaderrdd.RFileReaderRDD in project Gaffer by gchq.
the class RFileReaderRddIT method testRFileReaderRDDCanBeCreatedWith5TableInputs.
@Test
public void testRFileReaderRDDCanBeCreatedWith5TableInputs() throws IOException, InterruptedException, AccumuloSecurityException, AccumuloException, TableNotFoundException, TableExistsException {
// Given
final List<String> dataInput = Arrays.asList("train", "plane", "automobile", "bike", "boat");
final MiniAccumuloCluster cluster = createAccumuloCluster(tableName, config, dataInput);
// When
final RFileReaderRDD rdd = new RFileReaderRDD(sparkSession.sparkContext(), cluster.getInstanceName(), cluster.getZooKeepers(), MiniAccumuloClusterProvider.USER, MiniAccumuloClusterProvider.PASSWORD, tableName, new HashSet<>(), serialiseConfiguration(config));
// Then
assertThat(rdd.count()).isEqualTo(dataInput.size());
assertThat(rdd.getPartitions()).hasSize(1);
}
Aggregations