CertPathTrustManagerParametersTest.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:In-the-Box-Fork 作者:
/**
 * @tests javax.net.ssl.CertPathTrustManagerParameters#
 *     CertPathTrustManagerParameters(java.security.cert.CertPathParameters)
 * Case 1: Try to construct object.
 * Case 2: Check NullPointerException.
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "CertPathTrustManagerParameters",
    args = {java.security.cert.CertPathParameters.class}
)
public void test_ConstructorLjava_security_cert_CertPathParameters() {
    // case 1: Try to construct object.
    try {
        CertPathParameters parameters = new MyCertPathParameters();
        CertPathTrustManagerParameters p =
            new CertPathTrustManagerParameters(parameters);
        assertNotSame("Parameters were cloned incorrectly",
                parameters, p.getParameters());
    } catch (Exception e) {
        fail("Unexpected exception " + e.toString());
    }

    // case 2: Check NullPointerException.
    try {
        new CertPathTrustManagerParameters(null);
        fail("Expected CertPathTrustManagerParameters was not thrown");
    } catch (NullPointerException npe) {
        // expected
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号