| 1024 | ASSERT_OK(writer->Close()); |
| 1025 | } |
| 1026 | void AppMetadataTest::TestDoPutReadMetadata() { |
| 1027 | std::shared_ptr<Schema> schema = ExampleIntSchema(); |
| 1028 | ASSERT_OK_AND_ASSIGN(auto do_put_result, client_->DoPut(FlightDescriptor{}, schema)); |
| 1029 | std::unique_ptr<FlightStreamWriter> writer = std::move(do_put_result.writer); |
| 1030 | std::unique_ptr<FlightMetadataReader> reader = std::move(do_put_result.reader); |
| 1031 | |
| 1032 | RecordBatchVector expected_batches; |
| 1033 | ASSERT_OK(ExampleIntBatches(&expected_batches)); |
| 1034 | |
| 1035 | std::shared_ptr<RecordBatch> chunk; |
| 1036 | std::shared_ptr<Buffer> metadata; |
| 1037 | auto num_batches = static_cast<int>(expected_batches.size()); |
| 1038 | for (int i = 0; i < num_batches; ++i) { |
| 1039 | ASSERT_OK(writer->WriteWithMetadata(*expected_batches[i], |
| 1040 | Buffer::FromString(std::to_string(i)))); |
| 1041 | ASSERT_OK(reader->ReadMetadata(&metadata)); |
| 1042 | ASSERT_NE(nullptr, metadata); |
| 1043 | ASSERT_EQ(std::to_string(i), metadata->ToString()); |
| 1044 | } |
| 1045 | // As opposed to DoPutDrainMetadata, now we've read the messages, so |
| 1046 | // make sure this still closes as expected. |
| 1047 | ASSERT_OK(writer->Close()); |
| 1048 | } |
| 1049 | |
| 1050 | //------------------------------------------------------------ |
| 1051 | // Test IPC options in data plane methods |
nothing calls this directly
no test coverage detected