Commits


tianchen authored and Bryan Cutler committed b185296b4f8
ARROW-6930: [Java] Create utility class for populating vector values used for test purpose only There is a lot of verbosity in the construction of vectors for testing purposes (multiple lines of setSafe(...) or set(...). This change adds a utility to populate vector values in a concise way for test purposes only. The utility class TestValueVectorPopulator is located in java/vector/src/test/java/org/apache/arrow/vector/testing and can be used for testing by modules other than arrow-vector by adding the following test dependency: ``` <dependency> <groupId>org.apache.arrow</groupId> <artifactId>arrow-vector</artifactId> <version>${project.version}</version> <classifier>tests</classifier> <type>test-jar</type> <scope>test</scope> </dependency> ``` Usage would be something like: ``` try (IntVector vector = new IntVector(“vector”, allocator)) { ValueVectorDataPopulator.setVector(vector, 1, 2, null, 4, 5); output = doSomethingWith(input); assertThat(output).isEqualTo(expected); } ``` Closes #5693 from tianchen92/ARROW-6930 and squashes the following commits: 5cbc46b <tianchen> use vector tests dependency in tools b0e10dc <tianchen> add test comments 3f7bb15 <tianchen> remove test-jar config in vector 81b66fa <tianchen> fix test styles b28b66b <tianchen> make testing classes reusable ad5ab83 <tianchen> resolve comments and add tests 488f692 <tianchen> ARROW-6930: Create static factory methods for common array types of testing Authored-by: tianchen <niki.lj@alibaba-inc.com> Signed-off-by: Bryan Cutler <cutlerb@gmail.com>