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 testresult = false;
tc1.connect("rainmaker.wunderground.com", 3000);
InputStream is = tc1.getInputStream();
OutputStream os = tc1.getOutputStream();
boolean cont = waitForString(is, "Return to continue:", 30000);
if (cont)
{
os.write("\n".getBytes());
os.flush();
cont = waitForString(is, "city code--", 30000);
}
if (cont)
{
os.write("LAX\n".getBytes());
os.flush();
cont = waitForString(is, "Los Angeles", 30000);
}
if (cont)
{
cont = waitForString(is, "X to exit:", 30000);
}
if (cont)
{
os.write("X\n".getBytes());
os.flush();
tc1.disconnect();
testresult = true;
}
assertTrue(testresult);