org.apache.commons.net.telnet
Class TelnetClientTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.net.telnet.TelnetClientTest
All Implemented Interfaces:
junit.framework.Test, org.apache.commons.net.telnet.TelnetNotificationHandler

public class TelnetClientTest
extends junit.framework.TestCase
implements org.apache.commons.net.telnet.TelnetNotificationHandler

JUnit test class for TelnetClient.s Implements protocol compliance tests

Author:
Bruno D'Avanzo

Field Summary
protected  int numdo
           
protected  int numdont
           
protected  int numwill
           
protected  int numwont
           
 
Fields inherited from interface org.apache.commons.net.telnet.TelnetNotificationHandler
RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT
 
Constructor Summary
TelnetClientTest()
           
 
Method Summary
protected  boolean equalBytes(byte[] a1, byte[] a2)
          Helper method.
static void main(String[] args)
          main for running the test.
 void receivedNegotiation(int negotiation_code, int option_code)
          Callback method called when TelnetClient receives an option negotiation command.
protected  void setUp()
          open connections needed for the tests for the test.
protected  void tearDown()
           
 void testAYT()
          test of AYT functionality
 void testDeleteOptionHandler()
          protocol compliance test in case of option handler removal
 void testInitial()
          tests the initial condition of the sessions
 void testNotification()
          test of option negotiation notification
 void testOptionNegotiation()
          protocol compliance test for option negotiation
 void testOptionRenegotiation()
          protocol compliance test for option renegotiation
 void testSetReaderThread()
          test of setReaderThread
 void testSpy()
          test of Spy functionality
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numdo

protected int numdo

numdont

protected int numdont

numwill

protected int numwill

numwont

protected int numwont
Constructor Detail

TelnetClientTest

public TelnetClientTest()
Method Detail

main

public static void main(String[] args)
main for running the test.


setUp

protected void setUp()
              throws Exception
open connections needed for the tests for the test.

Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception

testInitial

public void testInitial()
                 throws Exception
tests the initial condition of the sessions

Throws:
Exception

testOptionNegotiation

public void testOptionNegotiation()
                           throws Exception
protocol compliance test for option negotiation

Throws:
Exception

testOptionRenegotiation

public void testOptionRenegotiation()
                             throws Exception
protocol compliance test for option renegotiation

Throws:
Exception

testNotification

public void testNotification()
                      throws Exception
test of option negotiation notification

Throws:
Exception

testDeleteOptionHandler

public void testDeleteOptionHandler()
                             throws Exception
protocol compliance test in case of option handler removal

Throws:
Exception

testAYT

public void testAYT()
             throws Exception
test of AYT functionality

Throws:
Exception

testSpy

public void testSpy()
             throws Exception
test of Spy functionality

Throws:
Exception

testSetReaderThread

public void testSetReaderThread()
                         throws Exception
test of setReaderThread

Throws:
Exception

equalBytes

protected boolean equalBytes(byte[] a1,
                             byte[] a2)
Helper method. compares two arrays of int


receivedNegotiation

public void receivedNegotiation(int negotiation_code,
                                int option_code)
Callback method called when TelnetClient receives an option negotiation command.

Specified by:
receivedNegotiation in interface org.apache.commons.net.telnet.TelnetNotificationHandler
Parameters:
negotiation_code - - type of negotiation command received (RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT)

option_code - - code of the option negotiated



Copyright © 1997-2010 Apache Software Foundation. All Rights Reserved.