keith-turner commented on code in PR #30:
URL:
https://github.com/apache/accumulo-classloaders/pull/30#discussion_r2582243169
##########
modules/local-caching-classloader/src/test/java/org/apache/accumulo/classloader/lcc/MiniAccumuloClusterClassLoaderFactoryTest.java:
##########
@@ -275,6 +275,25 @@ public void testClassLoader() throws Exception {
}
}
+ private List<byte[]> getValues(AccumuloClient client, String table)
+ throws TableNotFoundException, AccumuloSecurityException,
AccumuloException {
+ Scanner scanner = client.createScanner(table);
+ List<byte[]> values = new ArrayList<>(1000);
+ scanner.forEach((k, v) -> values.add(v.get()));
+ return values;
+ }
+
+ private int countExpectedRows(AccumuloClient client, String table, byte[]
expectedValue)
+ throws TableNotFoundException, AccumuloSecurityException,
AccumuloException {
+ Scanner scanner = client.createScanner(table);
+ int count = 0;
+ for (Entry<Key,Value> e : scanner) {
+ assertArrayEquals(expectedValue, e.getValue().get());
Review Comment:
If this did something like the following, seems like it could simplify outer
code and remove the need for the getValues function. Outer code could assert
the count is as expected and it would not need to catch an ignore the
AssertionError.
```java
if(Arrays.equals(e.getValue().get(), expectedValue)){
count++;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]