use of org.apache.harmony.xnet.tests.support.MyTrustManagerFactorySpi.Parameters in project robovm by robovm.
the class MyProvider method test_engineInit_02.
/**
* @throws InvalidAlgorithmParameterException
* @throws NoSuchAlgorithmException
* javax.net.ssl.TrustManagerFactorySpi#engineInit(ManagerFactoryParameters spec)
*/
public void test_engineInit_02() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException {
factory.reset();
Provider provider = new MyProvider();
TrustManagerFactory tmf = TrustManagerFactory.getInstance("MyTMF", provider);
Parameters pr = null;
try {
KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
ks.load(null, null);
pr = new Parameters(ks);
tmf.init(pr);
} catch (Exception e) {
fail("Unexpected exception " + e.toString());
}
assertTrue(factory.isEngineInitCalled());
assertEquals(pr, factory.getSpec());
factory.reset();
tmf.init((ManagerFactoryParameters) null);
assertTrue(factory.isEngineInitCalled());
assertNull(factory.getSpec());
}
Aggregations