blob: 92a4f5d40e9104ef4db4c00a4d6d4583ae45591c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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;
}
}
|