diff options
author | mikaelpeltier <mikaelpeltier@google.com> | 2015-06-24 14:31:11 +0200 |
---|---|---|
committer | Mikael Peltier <mikaelpeltier@google.com> | 2015-06-24 14:59:36 +0000 |
commit | 04563874ddaac702d6c715eaa89c29b253f4c54e (patch) | |
tree | c305fa98670c3e80be494cc054a8e31b51bfe7f2 /simple/simple-http/src/test/java/org/simpleframework/http/core/MockChannel.java | |
parent | f1828481ebcfee3bddc323fca178a4502a60ceef (diff) | |
download | toolchain_jack-04563874ddaac702d6c715eaa89c29b253f4c54e.zip toolchain_jack-04563874ddaac702d6c715eaa89c29b253f4c54e.tar.gz toolchain_jack-04563874ddaac702d6c715eaa89c29b253f4c54e.tar.bz2 |
Add simpleframework source files
Change-Id: I18d01df16de2868ca5458f79a88e6070b75db2c3
(cherry picked from commit 3e9f84cf7b22f6970eb8041ca38d12d75c6bb270)
Diffstat (limited to 'simple/simple-http/src/test/java/org/simpleframework/http/core/MockChannel.java')
-rw-r--r-- | simple/simple-http/src/test/java/org/simpleframework/http/core/MockChannel.java | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/simple/simple-http/src/test/java/org/simpleframework/http/core/MockChannel.java b/simple/simple-http/src/test/java/org/simpleframework/http/core/MockChannel.java new file mode 100644 index 0000000..92a4f5d --- /dev/null +++ b/simple/simple-http/src/test/java/org/simpleframework/http/core/MockChannel.java @@ -0,0 +1,57 @@ +package org.simpleframework.http.core; + +import java.nio.channels.SocketChannel; +import java.util.HashMap; +import java.util.Map; + +import org.simpleframework.common.lease.Lease; +import org.simpleframework.http.MockTrace; +import org.simpleframework.transport.Certificate; +import org.simpleframework.transport.Channel; +import org.simpleframework.transport.ByteCursor; +import org.simpleframework.transport.ByteWriter; +import org.simpleframework.transport.trace.Trace; + + +public class MockChannel implements Channel { + + private ByteCursor cursor; + + public MockChannel(ByteCursor cursor) { + this.cursor = cursor; + } + + public boolean isSecure() { + return false; + } + + public Trace getTrace(){ + return new MockTrace(); + } + + public Lease getLease() { + return null; + } + + public Certificate getCertificate() { + return null; + } + + public ByteCursor getCursor() { + return cursor; + } + + public ByteWriter getWriter() { + return new MockSender(); + } + + public Map getAttributes() { + return new HashMap(); + } + + public void close() {} + + public SocketChannel getSocket() { + return null; + } +}
\ No newline at end of file |