Micah Kornfield created ARROW-6930: -------------------------------------- Summary: [Java] Create static factory methods for common array types of testing. Key: ARROW-6930 URL: https://issues.apache.org/jira/browse/ARROW-6930 Project: Apache Arrow Issue Type: Improvement Components: Java Reporter: Micah Kornfield
There is a lot of verbosity in the construction of Arrays for testing purposes (multiple lines of setSafe(...) or set(...). We should start adding some static factory methods to make test setup clearer and more concise. A strawman proposal for BigIntVector might look like: static BigIntVector create(String name, BufferAllocator allocator, Long... values). Usage would be something like: try (BigIntVector input = BigIntVectorCreate("sample_data", allocator, 1235L, null, 456L), BigIntVector expected = BigIntVectorCreate("sample_data", allocator, 1L, null, 0L),) { output = doSomethingWith(input); assertThat(output).isEqualTo(expected); } -- This message was sent by Atlassian Jira (v8.3.4#803005)