public class TestDTLSClientError extends Object
| Constructor and Description |
|---|
TestDTLSClientError() |
| Modifier and Type | Method and Description |
|---|---|
static void |
connectNotInstanceOfInetSocketAddressTest()
Tests that connecting a socket with an address that is not an instance of InetSocketAddress throws an
IllegalArgumentException exception with message "unsupported address type".
|
static void |
connectSocketTwiceTest()
Tests that attempting to connect a socket twice throws a Runtime Exception with message "DTLS Socket is already
connected".
|
static void |
differentDatagramAndSocketAddressTest()
Tests that sending a datagramPacket with a different address than the underlying DatagramSocket throws a
NoSuchAlgorithmException exception, with a message that starts with "connected address and packet address
differ".
|
static void |
differentDatagramAndSocketPortTest()
Tests that sending a datagramPacket with a different port than the underlying DatagramSocket throws a
NoSuchAlgorithmException exception, with a message that starts with "connected address and packet address
differ".
|
static void |
dtlsClientInit()
Initialization method of DTLSClientErrorTest tests.
|
static void |
NullProtocolEchoTest()
Tests that calling DTLSContext.getDTLSInstance(String protocol) with a null protocol string throws a
NoSuchAlgorithmException exception.
|
static void |
openClosedSocketTest()
Tests that attempting to open a closed socket throws a Runtime Exception with message "DTLS Socket is closed".
|
static void |
receiveTimeoutTest()
Tests that attempting a receive operation without server response will timeout and throws a
SocketTimeoutException.
|
static void |
sendClosedSocketTest()
Tests that attempting a send operation on a close socket throws a SocketException with message "DTLS Socket is
closed".
|
static void |
teardown()
Gracefully close the DTLS connection and delete the client.
|
static void |
UnknownProtocolTest()
Tests that calling DTLSContext.getDTLSInstance(String protocol) with an unknown protocol throws a
NoSuchAlgorithmException exception.
|
public static void connectNotInstanceOfInetSocketAddressTest()
throws SocketException
SocketException - if the connect fails.public static void connectSocketTwiceTest()
throws SocketException
SocketException - if the connect fails.public static void differentDatagramAndSocketAddressTest()
throws IOException
IOException - if an error occurred while sending the datagram packet to the server.public static void differentDatagramAndSocketPortTest()
throws IOException
IOException - if an error occurred while sending the datagram packet to the server.public static void dtlsClientInit()
throws IOException,
GeneralSecurityException
IOException - if an exception occurred while loading resources or while connecting with the server.GeneralSecurityException - if an exception occurred while creating the SSL context.public static void NullProtocolEchoTest()
public static void openClosedSocketTest()
throws SocketException
SocketException - if the connect fails.public static void receiveTimeoutTest()
throws IOException
IOException - if any other error occurred while sending the datagram packet to the server.public static void sendClosedSocketTest()
throws IOException
IOException - if an error occurred while sending the datagram packet to the server.public static void teardown()
public static void UnknownProtocolTest()