TrustAnchor ta = TestUtils.getTrustAnchor();
if (ta == null) {
fail(getName() + ": not performed (could not create test TrustAnchor)");
}
PKIXCertPathValidatorResult vr1 =
new PKIXCertPathValidatorResult(
ta,
TestUtils.getPolicyTree(),
testPublicKey);
PKIXCertPathValidatorResult vr2 =
(PKIXCertPathValidatorResult) vr1.clone();
// check that method makes shallow copy
assertNotSame("notSame", vr1, vr2);
assertSame("trustAncor", vr1.getTrustAnchor(), vr2.getTrustAnchor());
assertSame("policyTree", vr1.getPolicyTree(), vr2.getPolicyTree());
assertSame("publicKey", vr1.getPublicKey(), vr2.getPublicKey());
// Regression for HARMONY-2786.
byte[] encoding = { 0x01 };
MyPKIXCertPathBuilderResult my = new MyPKIXCertPathBuilderResult(ta,
TestUtils.getPolicyTree(), testPublicKey, encoding);