org.apache.commons.net.telnet
Class TelnetClientFunctionalTest

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

public class TelnetClientFunctionalTest
extends junit.framework.TestCase

JUnit functional test for TelnetClient. Connects to the weather forecast service rainmaker.wunderground.com and asks for Los Angeles forecast.

Author:
Bruno D'Avanzo

Field Summary
protected  org.apache.commons.net.telnet.TelnetClient tc1
           
 
Constructor Summary
TelnetClientFunctionalTest()
           
 
Method Summary
static void main(String[] args)
          main for running the test.
protected  void setUp()
          test setUp
 void testFunctionalTest()
          Do the functional test: - connect to the weather service - press return on the first menu - send LAX on the second menu - send X to exit
 boolean waitForString(InputStream is, String end, long timeout)
          Helper method.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, 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

tc1

protected org.apache.commons.net.telnet.TelnetClient tc1
Constructor Detail

TelnetClientFunctionalTest

public TelnetClientFunctionalTest()
Method Detail

main

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


setUp

protected void setUp()
test setUp

Overrides:
setUp in class junit.framework.TestCase

testFunctionalTest

public void testFunctionalTest()
                        throws Exception
Do the functional test: - connect to the weather service - press return on the first menu - send LAX on the second menu - send X to exit

Throws:
Exception

waitForString

public boolean waitForString(InputStream is,
                             String end,
                             long timeout)
                      throws Exception
Helper method. waits for a string with timeout

Throws:
Exception


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