Remove EmbeddedChannel restriction to IOData (#763)

Remove EmbeddedChannel restriction to IOData

Motivation:

You should be able to read any type from the outbound buffer.

Modifications:

Change Embedded channel outboundBuffer and pendingOutboundBuffer to store NIOAny instead of IOData and refactor test code accordingly.

Result:

- Users can test what went through the pipeline without serializing everything and using "if case let" syntax everywhere.
- fixes #551
This commit is contained in:
JovanMilenkovic authored and Johannes Weiss committed 2019-01-30 19:24:59 +00:00
1 parent 70c714a54d
commit cf56bfd119
15 files changed
+89 -123

No files matched your search

@@ -34,7 +34,7 @@ class HTTPServerProtocolErrorHandlerTest: XCTestCase {
XCTAssertNoThrow(try channel.closeFuture.wait())
// We expect exactly one ByteBuffer in the output.
guard case .some(.byteBuffer(var written)) = channel.readOutbound() else {
guard var written = channel.readOutbound(as: ByteBuffer.self) else {
XCTFail("No writes")
return
}
@@ -127,7 +127,7 @@ class HTTPServerProtocolErrorHandlerTest: XCTestCase {
XCTAssertNoThrow(try channel.closeFuture.wait())
// We expect exactly one ByteBuffer in the output.
guard case .some(.byteBuffer(var written)) = channel.readOutbound() else {
guard var written = channel.readOutbound(as: ByteBuffer.self) else {
XCTFail("No writes")
return
}