1 16 package org.apache.commons.net.telnet; 17 18 23 public class EchoOptionHandlerTest extends TelnetOptionHandlerTestAbstract 24 { 25 28 public static void main(String args[]) 29 { 30 junit.textui.TestRunner.run(EchoOptionHandlerTest.class); 31 } 32 33 36 protected void setUp() 37 { 38 opthand1 = new EchoOptionHandler(); 39 opthand2 = new EchoOptionHandler(true, true, true, true); 40 opthand3 = new EchoOptionHandler(false, false, false, false); 41 } 42 43 46 public void testConstructors() 47 { 48 assertEquals(opthand1.getOptionCode(), TelnetOption.ECHO); 49 super.testConstructors(); 50 } 51 52 56 public void testStartSubnegotiation() 57 { 58 int resp1[] = opthand1.startSubnegotiationLocal(); 59 int resp2[] = opthand1.startSubnegotiationRemote(); 60 61 assertEquals(resp1, null); 62 assertEquals(resp2, null); 63 } 64 65 69 public void testAnswerSubnegotiation() 70 { 71 int subn[] = 72 { 73 TelnetCommand.IAC, TelnetCommand.SB, TelnetOption.ECHO, 74 1, TelnetCommand.IAC, TelnetCommand.SE, 75 }; 76 77 int resp1[] = opthand1.answerSubnegotiation(subn, subn.length); 78 79 assertEquals(resp1, null); 80 } 81 } 82 | Popular Tags |