/**
* Test for
* <code>TrustManagerFactory(TrustManagerFactorySpi impl, Provider prov, String algoriyjm) </code>
* constructor
* Assertion: created new TrustManagerFactory object
*/
public void testTrustManagerFactory10() throws NoSuchAlgorithmException {
if (!DEFSupported) {
fail(NotSupportedMsg);
return;
}
TrustManagerFactorySpi spi = new MyTrustManagerFactorySpi();
TrustManagerFactory tmF = new myTrustManagerFactory(spi, defaultProvider,
defaultAlgorithm);
assertTrue("Not CertStore object", tmF instanceof TrustManagerFactory);
assertEquals("Incorrect algorithm", tmF.getAlgorithm(),
defaultAlgorithm);
assertEquals("Incorrect provider", tmF.getProvider(), defaultProvider);
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) {
}
}
TrustManagerFactory1Test.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:freeVM
作者:
评论列表
文章目录