List of usage examples for org.apache.commons.net.telnet SuppressGAOptionHandler getAcceptRemote
public boolean getAcceptRemote()
From source file:io.termd.core.telnet.TelnetHandlerTest.java
@Test public void testAcceptSGA() throws Exception { final AtomicReference<Boolean> serverValue = new AtomicReference<>(); SuppressGAOptionHandler optionHandler = new SuppressGAOptionHandler(false, false, false, true); testOptionValue(() -> new TelnetHandler() { @Override//from w ww . j a v a 2 s. c om protected void onOpen(TelnetConnection conn) { conn.writeWillOption(Option.SGA); } @Override protected void onSGA(boolean sga) { serverValue.set(sga); testComplete(); } }, optionHandler); assertEquals(true, serverValue.get()); assertEquals(true, optionHandler.getAcceptRemote()); }
From source file:io.termd.core.telnet.TelnetHandlerTest.java
@Test public void testRejectSGA() throws Exception { final AtomicReference<Boolean> serverValue = new AtomicReference<>(); SuppressGAOptionHandler optionHandler = new SuppressGAOptionHandler(false, false, false, false); testOptionValue(() -> new TelnetHandler() { @Override//from w ww . j a va 2 s .c o m protected void onOpen(TelnetConnection conn) { conn.writeWillOption(Option.SGA); } @Override protected void onSGA(boolean sga) { serverValue.set(sga); testComplete(); } }, optionHandler); assertEquals(false, serverValue.get()); assertEquals(false, optionHandler.getAcceptRemote()); }