Search in sources :

Example 1 with MyTrustManagerFactorySpi

use of org.apache.harmony.xnet.tests.support.MyTrustManagerFactorySpi in project robovm by robovm.

the class myTrustManagerFactory method test_ConstructorLjavax_net_ssl_TrustManagerFactorySpiLjava_security_ProviderLjava_lang_String.

public void test_ConstructorLjavax_net_ssl_TrustManagerFactorySpiLjava_security_ProviderLjava_lang_String() throws NoSuchAlgorithmException {
    TrustManagerFactorySpi spi = new MyTrustManagerFactorySpi();
    TrustManagerFactory tmF = new myTrustManagerFactory(spi, getDefaultProvider(), getDefaultAlgorithm());
    assertTrue("Not CertStore object", tmF instanceof TrustManagerFactory);
    assertEquals("Incorrect algorithm", tmF.getAlgorithm(), getDefaultAlgorithm());
    assertEquals("Incorrect provider", tmF.getProvider(), getDefaultProvider());
    assertNull("Incorrect result", tmF.getTrustManagers());
    tmF = new myTrustManagerFactory(null, null, null);
    assertTrue("Not CertStore object", tmF instanceof TrustManagerFactory);
    assertNull("Provider must be null", tmF.getProvider());
    assertNull("Algorithm must be null", tmF.getAlgorithm());
    try {
        tmF.getTrustManagers();
        fail("NullPointerException must be thrown");
    } catch (NullPointerException e) {
    }
}
Also used : MyTrustManagerFactorySpi(org.apache.harmony.xnet.tests.support.MyTrustManagerFactorySpi) TrustManagerFactorySpi(javax.net.ssl.TrustManagerFactorySpi) TrustManagerFactory(javax.net.ssl.TrustManagerFactory) MyTrustManagerFactorySpi(org.apache.harmony.xnet.tests.support.MyTrustManagerFactorySpi)

Aggregations

TrustManagerFactory (javax.net.ssl.TrustManagerFactory)1 TrustManagerFactorySpi (javax.net.ssl.TrustManagerFactorySpi)1 MyTrustManagerFactorySpi (org.apache.harmony.xnet.tests.support.MyTrustManagerFactorySpi)1