org.jboss.netty.channel.ChannelConfig Java Examples
The following examples show how to use
org.jboss.netty.channel.ChannelConfig.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ImapRequestFrameDecoderTest.java From james-project with Apache License 2.0 | 5 votes |
@Test void newCumulationBufferShouldNotThrowWhenNoAttachments() { ChannelHandlerContext channelHandler = mock(ChannelHandlerContext.class); Channel channel = mock(Channel.class); ChannelConfig channelConfig = mock(ChannelConfig.class); when(channelConfig.getBufferFactory()).thenReturn(mock(ChannelBufferFactory.class)); when(channelHandler.getChannel()).thenReturn(channel); when(channel.getConfig()).thenReturn(channelConfig); when(channelHandler.getAttachment()).thenReturn(ImmutableMap.<String, Object>of()); assertThatCode(() -> testee.newCumulationBuffer(channelHandler, 36)) .doesNotThrowAnyException(); }
Example #2
Source File: ImapRequestFrameDecoderTest.java From james-project with Apache License 2.0 | 5 votes |
@Test void newCumulationBufferShouldNotThrowOnNegativeSize() { ChannelHandlerContext channelHandler = mock(ChannelHandlerContext.class); Channel channel = mock(Channel.class); ChannelConfig channelConfig = mock(ChannelConfig.class); when(channelConfig.getBufferFactory()).thenReturn(mock(ChannelBufferFactory.class)); when(channelHandler.getChannel()).thenReturn(channel); when(channel.getConfig()).thenReturn(channelConfig); when(channelHandler.getAttachment()).thenReturn(ImmutableMap.<String, Object>of(NEEDED_DATA, -1)); assertThatCode(() -> testee.newCumulationBuffer(channelHandler, 36)) .doesNotThrowAnyException(); }
Example #3
Source File: OspfInterfaceImplTest.java From onos with Apache License 2.0 | 5 votes |
/** * Tests electRouter() method. */ @Test public void testElectRouter() throws Exception { ospfInterface.setOspfArea(ospfArea); ospfInterface.setDr(Ip4Address.valueOf("3.3.3.3")); ospfInterface.setBdr(Ip4Address.valueOf("3.3.3.3")); ospfInterface.setIpNetworkMask(Ip4Address.valueOf("255.255.255.255")); ChannelConfig channelConfig = EasyMock.createMock(ChannelConfig.class); EasyMock.expect(channelConfig.getBufferFactory()).andReturn(new HeapChannelBufferFactory()); Channel channel = EasyMock.createMock(Channel.class); ospfInterface.electRouter(channel); assertThat(ospfInterface.dr(), is(notNullValue())); }
Example #4
Source File: PcepClientControllerImplTest.java From onos with Apache License 2.0 | 4 votes |
@Override public ChannelConfig getConfig() { // TODO Auto-generated method stub return null; }