### Question:
KeepAlive extends AbstractMessageFilter implements AlarmListener { @Override public boolean sessionMessage( Who sender, Message msg ) throws Exception { if (msg.isType( mt_request ) ) { handleRequest( msg ); return true; } if (msg.isType( mt_response )) { handleResponse( msg ); return true; } return super.sessionMessage( sender, msg ); } KeepAlive( TransportMessage transport, URL uri, Resources resources ); @Override String toString(); boolean getServer(); @Override boolean sessionMessage( Who sender, Message msg ); int wakeup( AlarmManager manager, Object state, long due ); int getDelay(); int getCount(); final static String DELAY; final static String COUNT; }### Answer:
@Test public void serverUp() throws Exception { transport.is_server = true; String uri = "tcp: KeepAlive filter = newKeepAlive(uri); filter.setSession( session ); filter.sessionNotify( Session.UP ); Message req = constructMessage(); filter.sessionMessage( null, req ); assertEquals(req.reply(),transport.msg); }