use of uk.gov.gchq.gaffer.accumulostore.key.core.impl.byteEntity.ByteEntityAccumuloElementConverter in project Gaffer by gchq.
the class ElementPreAggregationFilterTest method shouldNotAcceptElementWhenViewValidatorDoesNotAcceptElement.
@Test
public void shouldNotAcceptElementWhenViewValidatorDoesNotAcceptElement() throws Exception {
// Given
final AbstractElementFilter filter = new ElementPreAggregationFilter();
final Map<String, String> options = new HashMap<>();
options.put(AccumuloStoreConstants.SCHEMA, getSchemaJson());
options.put(AccumuloStoreConstants.VIEW, getEmptyViewJson());
options.put(AccumuloStoreConstants.ACCUMULO_ELEMENT_CONVERTER_CLASS, ByteEntityAccumuloElementConverter.class.getName());
filter.validateOptions(options);
final ByteEntityAccumuloElementConverter converter = new ByteEntityAccumuloElementConverter(getSchema());
final Element element = new Edge(TestGroups.EDGE, "source", "dest", true);
final Pair<Key> key = converter.getKeysFromElement(element);
final Value value = converter.getValueFromElement(element);
// When
final boolean accept = filter.accept(key.getFirst(), value);
// Then
assertFalse(accept);
}
use of uk.gov.gchq.gaffer.accumulostore.key.core.impl.byteEntity.ByteEntityAccumuloElementConverter in project Gaffer by gchq.
the class RowIdAggregatorTest method setup.
@BeforeClass
public static void setup() throws StoreException, AccumuloException, AccumuloSecurityException, IOException {
byteEntityStore = new SingleUseMockAccumuloStore();
gaffer1KeyStore = new SingleUseMockAccumuloStore();
gaffer1ElementConverter = new ClassicAccumuloElementConverter(schema);
byteEntityElementConverter = new ByteEntityAccumuloElementConverter(schema);
}
use of uk.gov.gchq.gaffer.accumulostore.key.core.impl.byteEntity.ByteEntityAccumuloElementConverter in project Gaffer by gchq.
the class ValidatorFilterTest method shouldNotAcceptElementWhenSchemaValidatorDoesNotAcceptElement.
@Test
public void shouldNotAcceptElementWhenSchemaValidatorDoesNotAcceptElement() throws Exception {
// Given
final ValidatorFilter filter = new ValidatorFilter();
final Map<String, String> options = new HashMap<>();
options.put(AccumuloStoreConstants.SCHEMA, getSchemaJson());
options.put(AccumuloStoreConstants.ACCUMULO_ELEMENT_CONVERTER_CLASS, ByteEntityAccumuloElementConverter.class.getName());
filter.validateOptions(options);
final ByteEntityAccumuloElementConverter converter = new ByteEntityAccumuloElementConverter(getSchema());
final Element element = new Edge(TestGroups.EDGE, "invalid", "dest", true);
final Pair<Key> key = converter.getKeysFromElement(element);
final Value value = converter.getValueFromElement(element);
// When
final boolean accept = filter.accept(key.getFirst(), value);
// Then
assertFalse(accept);
}
Aggregations