/** @tests javax.net.ssl.CertPathTrustManagerParameters#getParameters() */ @TestTargetNew( level = TestLevel.COMPLETE, notes = "", method = "getParameters", args = {}) public void test_getParameters() { CertPathParameters parameters = new MyCertPathParameters(); CertPathTrustManagerParameters p = new CertPathTrustManagerParameters(parameters); if (!(p.getParameters() instanceof MyCertPathParameters)) { fail("incorrect parameters"); } assertNotSame("Parameters were cloned incorrectly", parameters, p.getParameters()); }
/** * @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 } }