|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.subethamail.smtp.test.util.Client
public class Client
A crude telnet client that can be used to send SMTP messages and test the responses.
| Constructor Summary | |
|---|---|
Client(java.lang.String host,
int port)
Establishes a connection to host and port. |
|
| Method Summary | |
|---|---|
void |
close()
|
void |
expect(java.lang.String expect)
Throws an exception if the response does not start with the specified string. |
void |
expectContains(java.lang.String expect)
Throws an exception if the response does not contain the specified string. |
protected java.lang.String |
readResponse()
Get the complete response, including a multiline response. |
void |
send(java.lang.String msg)
Sends a message to the server, ie "HELO foo.example.com". |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Client(java.lang.String host,
int port)
throws java.net.UnknownHostException,
java.io.IOException
java.io.IOException
java.net.UnknownHostException| Method Detail |
|---|
public void send(java.lang.String msg)
throws java.lang.Exception
an - exception if the method cannot send for any reason
java.lang.Exception
public void expect(java.lang.String expect)
throws java.lang.Exception
java.lang.Exception
public void expectContains(java.lang.String expect)
throws java.lang.Exception
java.lang.Exception
protected java.lang.String readResponse()
throws java.lang.Exception
java.lang.Exception
public void close()
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||