Map<String, Listener> listeners = server.getServerContext()
.getListeners();
assertEquals(3, listeners.size());
Listener listener = listeners.get("listener0");
assertNotNull(listener);
assertTrue(listener instanceof NioListener);
assertEquals(2222, ((NioListener) listener).getPort());
assertEquals(InetAddress.getByName("1.2.3.4"), InetAddress.getByName(((NioListener) listener)
.getServerAddress()));
assertEquals(100, ((NioListener) listener)
.getDataConnectionConfiguration().getIdleTime());
assertTrue(((NioListener) listener)
.getDataConnectionConfiguration().isActiveEnabled());
assertTrue(((NioListener) listener)
.getDataConnectionConfiguration().isImplicitSsl());
assertEquals(InetAddress.getByName("1.2.3.4"), InetAddress.getByName(((NioListener) listener)
.getDataConnectionConfiguration().getActiveLocalAddress()) );
assertEquals("123-125", ((NioListener) listener)
.getDataConnectionConfiguration().getPassivePorts());
assertEquals(false, ((NioListener) listener)
.getDataConnectionConfiguration().isPassiveIpCheck());
RemoteIpFilter filter = (RemoteIpFilter) listener.getSessionFilter();
assertEquals(3, filter.size());
assertTrue(filter.contains(new Subnet(InetAddress.getByName("1.2.3.0"), 16)));
assertTrue(filter.contains(new Subnet(InetAddress.getByName("1.2.4.0"), 16)));
assertTrue(filter.contains(new Subnet(InetAddress.getByName("1.2.3.4"), 32)));
listener = listeners.get("listener1");
assertNotNull(listener);
assertTrue(listener instanceof MyCustomListener);
assertEquals(2223, listener.getPort());
listener = listeners.get("listener2");
assertNotNull(listener);
assertTrue(listener instanceof MyCustomListener);
assertEquals(2224, listener.getPort());
CommandFactory cf = server.getCommandFactory();
assertTrue(cf.getCommand("FOO") instanceof HELP);
assertTrue(cf.getCommand("FOO2") instanceof STAT);