@Test public void remove_shouldExecuteImmediatelyIfInIoThread() throws Exception { Mockery context = new Mockery(); final IoSessionEx session = context.mock(IoSessionEx.class); context.checking(new Expectations() { { oneOf(session).isIoAligned(); will(returnValue(true)); oneOf(session).getIoThread(); will(returnValue(currentThread())); } }); AbstractIoProcessor<IoSessionEx> processor = new TestIoProcessor<>(); processor.remove(session); context.assertIsSatisfied(); assertEquals("remove0", ((TestIoProcessor<?>) processor).called); }
@Override public final void remove(final T session) { if (session.isIoAligned()) { verifyInIoThread(session, session.getIoThread()); } remove0(session); }
AbstractIoProcessor implements IoProcessorEx<T> { @Override public final void remove(final T session) { if (session.isIoAligned()) { verifyInIoThread(session, session.getIoThread()); } remove0(session); } }
AbstractIoProcessor implements IoProcessorEx<T> { @Override public final void remove(final T session) { if (session.isIoAligned()) { verifyInIoThread(session, session.getIoThread()); } remove0(session); }  }
AbstractIoProcessor implements IoProcessorEx<T> { @Override public final void remove(final T session) { if (session.isIoAligned()) { verifyInIoThread(session, session.getIoThread()); } remove0(session); }  @Override final void add(final T session); @Override final void flush(final T session); @Override final void remove(final T session); @Override final void updateTrafficControl(final T session); }
AbstractIoProcessor implements IoProcessorEx<T> { @Override public final void remove(final T session) { if (session.isIoAligned()) { verifyInIoThread(session, session.getIoThread()); } remove0(session); }  @Override final void add(final T session); @Override final void flush(final T session); @Override final void remove(final T session); @Override final void updateTrafficControl(final T session);  }