From b1625ebd99fc3767b1855c8ab4270e627c8974ae Mon Sep 17 00:00:00 2001 From: Bryan Cutler Date: Wed, 26 Jun 2019 19:27:28 -0700 Subject: [PATCH] Fix compilation for TestFlightClient --- .../org/apache/arrow/flight/TestFlightClient.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/java/flight/src/test/java/org/apache/arrow/flight/TestFlightClient.java b/java/flight/src/test/java/org/apache/arrow/flight/TestFlightClient.java index 273f11fd8cd..e6b55b2a46a 100644 --- a/java/flight/src/test/java/org/apache/arrow/flight/TestFlightClient.java +++ b/java/flight/src/test/java/org/apache/arrow/flight/TestFlightClient.java @@ -39,15 +39,14 @@ public class TestFlightClient { public void independentShutdown() throws Exception { try (final BufferAllocator allocator = new RootAllocator(Integer.MAX_VALUE); final FlightServer server = FlightTestUtil.getStartedServer( - port -> FlightServer.builder(allocator, Location.forGrpcInsecure(FlightTestUtil.LOCALHOST, port), - new Producer(allocator)).build())) { - final Location location = Location.forGrpcInsecure(FlightTestUtil.LOCALHOST, server.getPort()); + (location) -> FlightServer.builder(allocator, location, new Producer(allocator)).build())) { final Schema schema = new Schema(Collections.singletonList(Field.nullable("a", new ArrowType.Int(32, true)))); - try (final FlightClient client1 = FlightClient.builder(allocator, location).build(); + try (final FlightClient client1 = FlightClient.builder(allocator, server.getLocation()).build(); final VectorSchemaRoot root = VectorSchemaRoot.create(schema, allocator)) { // Use startPut as this ensures the RPC won't finish until we want it to - final ClientStreamListener listener = client1.startPut(FlightDescriptor.path("test"), root); - try (final FlightClient client2 = FlightClient.builder(allocator, location).build()) { + final ClientStreamListener listener = client1.startPut(FlightDescriptor.path("test"), root, + new AsyncPutListener()); + try (final FlightClient client2 = FlightClient.builder(allocator, server.getLocation()).build()) { client2.listActions().forEach(actionType -> Assert.assertNotNull(actionType.getType())); } listener.completed();