本文整理汇总了Java中org.apache.harmony.xnet.tests.support.MyTrustManagerFactorySpi类的典型用法代码示例。如果您正苦于以下问题:Java MyTrustManagerFactorySpi类的具体用法?Java MyTrustManagerFactorySpi怎么用?Java MyTrustManagerFactorySpi使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MyTrustManagerFactorySpi类属于org.apache.harmony.xnet.tests.support包,在下文中一共展示了MyTrustManagerFactorySpi类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testTrustManagerFactory10
import org.apache.harmony.xnet.tests.support.MyTrustManagerFactorySpi; //导入依赖的package包/类
/**
* 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) {
}
}
示例2: test_ConstructorLjavax_net_ssl_TrustManagerFactorySpiLjava_security_ProviderLjava_lang_String
import org.apache.harmony.xnet.tests.support.MyTrustManagerFactorySpi; //导入依赖的package包/类
/**
* Test for
* <code>TrustManagerFactory(TrustManagerFactorySpi impl, Provider prov, String algoriyjm) </code>
* constructor
* Assertion: created new TrustManagerFactory object
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "TrustManagerFactory",
args = {javax.net.ssl.TrustManagerFactorySpi.class, java.security.Provider.class, java.lang.String.class}
)
public void test_ConstructorLjavax_net_ssl_TrustManagerFactorySpiLjava_security_ProviderLjava_lang_String()
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) {
}
}