当前位置: 首页>>代码示例>>Java>>正文


Java MyTrustManagerFactorySpi类代码示例

本文整理汇总了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) {
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:31,代码来源:TrustManagerFactory1Test.java

示例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) {
    }
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:38,代码来源:TrustManagerFactory1Test.java


注:本文中的org.apache.harmony.xnet.tests.support.MyTrustManagerFactorySpi类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。