@Test public void addIfFeatureEnabledShouldAcceptZeroTimeoutOptionToDisableFeature() throws Exception { Mockery context = new Mockery(); final Logger logger = context.mock(Logger.class); final IoFilterChain filterChain = context.mock(IoFilterChain.class); context.checking(new Expectations() { { oneOf(logger).isDebugEnabled(); will(returnValue(true)); oneOf(logger).debug(with(stringMatching("WebSocket inactivity timeout is disabled.*"))); } }); WsCheckAliveFilter.addIfFeatureEnabled(filterChain, FILTER_NAME, 0L, logger); context.assertIsSatisfied(); }
public static void addIfFeatureEnabled(IoFilterChain filterChain, String filterName, long inactivityTimeoutIn, Logger logger) { addIfFeatureEnabled(filterChain, filterName, inactivityTimeoutIn, null, logger); }
WsCheckAliveFilter extends IoFilterAdapter<IoSessionEx> { public static void addIfFeatureEnabled(IoFilterChain filterChain, String filterName, long inactivityTimeoutIn, Logger logger) { addIfFeatureEnabled(filterChain, filterName, inactivityTimeoutIn, null, logger); } }
WsCheckAliveFilter extends IoFilterAdapter<IoSessionEx> { public static void addIfFeatureEnabled(IoFilterChain filterChain, String filterName, long inactivityTimeoutIn, Logger logger) { addIfFeatureEnabled(filterChain, filterName, inactivityTimeoutIn, null, logger); } WsCheckAliveFilter(long inactivityTimeout, Logger logger);   WsCheckAliveFilter(long inactivityTimeout, IoSession wsSession, Logger logger); }
WsCheckAliveFilter extends IoFilterAdapter<IoSessionEx> { public static void addIfFeatureEnabled(IoFilterChain filterChain, String filterName, long inactivityTimeoutIn, Logger logger) { addIfFeatureEnabled(filterChain, filterName, inactivityTimeoutIn, null, logger); } WsCheckAliveFilter(long inactivityTimeout, Logger logger);   WsCheckAliveFilter(long inactivityTimeout, IoSession wsSession, Logger logger); static void validateSystemProperties(Properties configuration, Logger logger); static void addIfFeatureEnabled(IoFilterChain filterChain, String filterName, long inactivityTimeoutIn, Logger logger); static void addIfFeatureEnabled(IoFilterChain filterChain, String filterName, long inactivityTimeoutIn,
                                           IoSessionEx wsSession, Logger logger); static void moveIfFeatureEnabled(IoFilterChain fromChain, IoFilterChain toChain,
                                            String filterName, long inactivityTimeout, Logger logger); static void updateExtensions(IoFilterChain filterChain); @Override void onPostAdd(IoFilterChain filterChain, String name, NextFilter nextFilter); @Override void onPreRemove(IoFilterChain filterChain,
                            String name,
                            NextFilter nextFilter); }
WsCheckAliveFilter extends IoFilterAdapter<IoSessionEx> { public static void addIfFeatureEnabled(IoFilterChain filterChain, String filterName, long inactivityTimeoutIn, Logger logger) { addIfFeatureEnabled(filterChain, filterName, inactivityTimeoutIn, null, logger); } WsCheckAliveFilter(long inactivityTimeout, Logger logger);   WsCheckAliveFilter(long inactivityTimeout, IoSession wsSession, Logger logger); static void validateSystemProperties(Properties configuration, Logger logger); static void addIfFeatureEnabled(IoFilterChain filterChain, String filterName, long inactivityTimeoutIn, Logger logger); static void addIfFeatureEnabled(IoFilterChain filterChain, String filterName, long inactivityTimeoutIn,
                                           IoSessionEx wsSession, Logger logger); static void moveIfFeatureEnabled(IoFilterChain fromChain, IoFilterChain toChain,
                                            String filterName, long inactivityTimeout, Logger logger); static void updateExtensions(IoFilterChain filterChain); @Override void onPostAdd(IoFilterChain filterChain, String name, NextFilter nextFilter); @Override void onPreRemove(IoFilterChain filterChain,
                            String name,
                            NextFilter nextFilter); static final long DISABLE_INACTIVITY_TIMEOUT; static final long DEFAULT_WS_INACTIVITY_TIMEOUT_MILLIS; }