[ https://issues.apache.org/jira/browse/ARROW-6930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ji Liu updated ARROW-6930: -------------------------- Summary: [Java] Create utility class for common array types of testing (was: [Java] Create static factory methods for common array types of testing.) > [Java] Create utility class 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 > Assignee: Ji Liu > Priority: Minor > Labels: pull-request-available > Time Spent: 7h 10m > Remaining Estimate: 0h > > 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)