Java Code Examples for java.security.cert.CollectionCertStoreParameters#clone()
The following examples show how to use
java.security.cert.CollectionCertStoreParameters#clone() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CollectionCertStoreParametersTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test #1 for <code>clone()</code> method<br> */ public final void testClone01() { Vector<Certificate> certificates = new Vector<Certificate>(); certificates.add(new MyCertificate("TEST", new byte[] {(byte)4})); CollectionCertStoreParameters cp1 = new CollectionCertStoreParameters(certificates); CollectionCertStoreParameters cp2 = (CollectionCertStoreParameters)cp1.clone(); // check that that we have new object assertTrue(cp1 != cp2); }
Example 2
Source File: CollectionCertStoreParametersTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test #2 for <code>clone()</code> method<br> */ public final void testClone02() { Vector<Certificate> certificates = new Vector<Certificate>(); certificates.add(new MyCertificate("TEST", new byte[] {(byte)4})); CollectionCertStoreParameters cp1 = new CollectionCertStoreParameters(certificates); CollectionCertStoreParameters cp2 = (CollectionCertStoreParameters)cp1.clone(); // check that both objects hold the same reference assertTrue(cp1.getCollection() == cp2.getCollection()); }
Example 3
Source File: CollectionCertStoreParametersTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * Test #3 for <code>clone()</code> method<br> */ public final void testClone03() { CollectionCertStoreParameters cp1 = new CollectionCertStoreParameters(); CollectionCertStoreParameters cp2 = (CollectionCertStoreParameters)cp1.clone(); CollectionCertStoreParameters cp3 = (CollectionCertStoreParameters)cp2.clone(); // check that all objects hold the same reference assertTrue(cp1.getCollection() == cp2.getCollection() && cp3.getCollection() == cp2.getCollection()); }