import junit.framework.TestCase;
public class SslRMIServerSocketFactoryTest extends TestCase {
public void testSslRMIServerSocketFactory() {
SslRMIServerSocketFactory factory = new SslRMIServerSocketFactory();
SslRMIServerSocketFactory factory1 = new SslRMIServerSocketFactory(
null, null, false);
assertTrue(factory.equals(factory1));
assertTrue(factory1.equals(factory));
assertNull(factory.getEnabledCipherSuites());
assertNull(factory.getEnabledProtocols());
assertFalse(factory.getNeedClientAuth());
factory1 = new SslRMIServerSocketFactory(null, null, true);
assertTrue(factory1.getNeedClientAuth());
assertFalse(factory.equals(factory1));
assertFalse(factory1.equals(factory));
factory1 = new SslRMIServerSocketFactory(null,
new String[] { "TLSv1" }, false);
assertFalse(factory.equals(factory1));
assertFalse(factory1.equals(factory));
SSLServerSocketFactory tmpfac = (SSLServerSocketFactory) SSLServerSocketFactory
.getDefault();
factory1 = new SslRMIServerSocketFactory(tmpfac.getDefaultCipherSuites(),
null, false);
assertFalse(factory.equals(factory1));
assertFalse(factory1.equals(factory));
try {
new SslRMIServerSocketFactory(new String[] { "Incorrect" }, null,
false);
fail("No expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
}
try {
new SslRMIServerSocketFactory(null, new String[] { "Incorrect" },
false);
fail("No expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
}