use of org.jboss.netty.channel.FakeChannelHandlerContext in project bagheera by mozilla-metrics.
the class AccessFilterTest method setup.
@Before
public void setup() throws IOException {
String[] namespaces = new String[] { "foo_*", "bar" };
WildcardProperties props = new WildcardProperties();
String propsFileStr = "foo_*.allow.delete.access=false\n" + "foo_*.id.validation=true\n" + "bar.allow.delete.access=true\n" + "bar.id.validation=false";
InputStream is = new ByteArrayInputStream(propsFileStr.getBytes("UTF-8"));
props.load(is);
filter = new AccessFilter(new Validator(namespaces), props);
remoteAddr = InetSocketAddress.createUnresolved("192.168.1.1", 51723);
Channel channel = createMock(Channel.class);
expect(channel.getCloseFuture()).andReturn(new DefaultChannelFuture(channel, false));
expect(channel.getRemoteAddress()).andReturn(remoteAddr);
OrderedMemoryAwareThreadPoolExecutor executor = new OrderedMemoryAwareThreadPoolExecutor(10, 0L, 0L);
final ExecutionHandler handler = new ExecutionHandler(executor, true, true);
ctx = new FakeChannelHandlerContext(channel, handler);
}
use of org.jboss.netty.channel.FakeChannelHandlerContext in project bagheera by mozilla-metrics.
the class ContentLengthFilterTest method setup.
@Before
public void setup() {
Channel channel = createMock(Channel.class);
expect(channel.getCloseFuture()).andReturn(new DefaultChannelFuture(channel, false));
expect(channel.getRemoteAddress()).andReturn(InetSocketAddress.createUnresolved("192.168.1.1", 51723));
OrderedMemoryAwareThreadPoolExecutor executor = new OrderedMemoryAwareThreadPoolExecutor(10, 0L, 0L);
final ExecutionHandler handler = new ExecutionHandler(executor, true, true);
ctx = new FakeChannelHandlerContext(channel, handler);
}
Aggregations