use of javax.net.ssl.SSLSocket in project robovm by robovm.
the class SSLSocketTest method test_getSupportedProtocols.
/**
* javax.net.ssl.SSLSocket#getSupportedProtocols()
*/
public void test_getSupportedProtocols() throws IOException {
SSLSocket ssl = getSSLSocket();
String[] res = ssl.getSupportedProtocols();
assertTrue("No supported protocols found", res.length > 0);
ssl.close();
}
use of javax.net.ssl.SSLSocket in project robovm by robovm.
the class SSLSocketTest method test_getSupportedCipherSuites.
/**
* javax.net.ssl.SSLSocket#getSupportedCipherSuites()
*/
public void test_getSupportedCipherSuites() throws IOException {
SSLSocket ssl = getSSLSocket();
String[] res = ssl.getSupportedCipherSuites();
assertTrue("no supported cipher suites", res.length > 0);
ssl.close();
}
use of javax.net.ssl.SSLSocket in project robovm by robovm.
the class SSLSocketTest method test_addHandshakeCompletedListener.
/**
* javax.net.ssl.SSLSocket#addHandshakeCompletedListener(HandshakeCompletedListener listener)
*/
@AndroidOnly("RI doesn't throw the specified IAE")
public void test_addHandshakeCompletedListener() throws IOException {
SSLSocket ssl = getSSLSocket();
HandshakeCompletedListener ls = new HandshakeCL();
try {
ssl.addHandshakeCompletedListener(null);
fail();
} catch (IllegalArgumentException expected) {
}
ssl.addHandshakeCompletedListener(ls);
ssl.close();
}
use of javax.net.ssl.SSLSocket in project robovm by robovm.
the class SSLSocketTest method test_EnabledCipherSuites.
/**
* javax.net.ssl.SSLSocket#getEnabledCipherSuites()
* javax.net.ssl.SSLSocket#setEnabledCipherSuites(String[] suites)
*/
public void test_EnabledCipherSuites() throws IOException {
SSLSocket ssl = getSSLSocket();
try {
ssl.setEnabledCipherSuites(null);
fail();
} catch (IllegalArgumentException expected) {
}
ssl.setEnabledCipherSuites(new String[] {});
try {
ssl.setEnabledCipherSuites(new String[] { "blubb" });
fail();
} catch (IllegalArgumentException expected) {
}
ssl.setEnabledCipherSuites(ssl.getSupportedCipherSuites());
String[] res = ssl.getEnabledCipherSuites();
assertNotNull("NULL result", res);
assertEquals("not all supported cipher suites were enabled", Arrays.asList(ssl.getSupportedCipherSuites()), Arrays.asList(res));
ssl.close();
}
use of javax.net.ssl.SSLSocket in project robovm by robovm.
the class SSLSocketTest method testConstructor.
/**
* javax.net.ssl.SSLSocket#SSLSocket()
*/
public void testConstructor() throws Exception {
SSLSocket ssl = getSSLSocket();
assertNotNull(ssl);
ssl.close();
}
Aggregations