use of java.security.cert.PolicyQualifierInfo in project robovm by robovm.
the class PolicyQualifierInfoTest method testGetEncoded02.
/**
* Test #2 for <code>getEncoded()</code> method
* Assertion: a copy is returned each time
*
* @throws IOException
*/
public final void testGetEncoded02() throws IOException {
// get valid encoding
byte[] encoding = getDerEncoding();
byte[] encodingCopy = encoding.clone();
// pass valid array
PolicyQualifierInfo i = new PolicyQualifierInfo(encodingCopy);
// get encoding
byte[] encodingRet = i.getEncoded();
// modify returned array
encodingRet[0] = (byte) 0;
// get encoding again
byte[] encodingRet1 = i.getEncoded();
// check that above modification did not change
// internal state of the PolicyQualifierInfo instance
assertTrue(Arrays.equals(encoding, encodingRet1));
}
use of java.security.cert.PolicyQualifierInfo in project robovm by robovm.
the class PolicyQualifierInfoTest method testToString.
/**
* Test for <code>toString()</code> method
* Assertion: returns description of the contents of this
* <code>PolicyQualifierInfo</code> as printable <code>String</code>
* @throws IOException
*
* @throws IOException
*/
public final void testToString() throws IOException {
// get valid encoding
byte[] encoding = getDerEncoding();
// pass valid array
PolicyQualifierInfo i = new PolicyQualifierInfo(encoding);
assertNotNull(i.toString());
}
use of java.security.cert.PolicyQualifierInfo in project robovm by robovm.
the class PolicyQualifierInfoTest method testGetPolicyQualifier01.
/**
* Test #1 for <code>getPolicyQualifier()</code> method
* Assertion: Returns the ASN.1 DER encoded form of
* this <code>PolicyQualifierInfo</code>
*
* @throws IOException
*/
public final void testGetPolicyQualifier01() throws IOException {
// get valid encoding
byte[] encoding = getDerEncoding();
// get policy qualifier encoding
byte[] pqEncoding = new byte[28];
System.arraycopy(encoding, 12, pqEncoding, 0, pqEncoding.length);
// pass valid array
PolicyQualifierInfo i = new PolicyQualifierInfo(encoding);
// get encoding
byte[] pqEncodingRet = i.getPolicyQualifier();
// check returned array
assertTrue(Arrays.equals(pqEncoding, pqEncodingRet));
}
use of java.security.cert.PolicyQualifierInfo in project robovm by robovm.
the class PolicyQualifierInfoTest method testPolicyQualifierInfo04.
/**
* Test #4 for <code>PolicyQualifierInfo</code> constructor<br>
* Assertion: The encoded byte array is copied on construction
*
* @throws IOException
*/
public final void testPolicyQualifierInfo04() throws IOException {
// get valid encoding
byte[] encoding = getDerEncoding();
byte[] encodingCopy = encoding.clone();
// pass valid array
PolicyQualifierInfo i = new PolicyQualifierInfo(encodingCopy);
// get encoding
byte[] encodingRet = i.getEncoded();
// check returned array
assertTrue(Arrays.equals(encoding, encodingRet));
// modify input
encodingCopy[0] = (byte) 0;
// get encoding again
byte[] encodingRet1 = i.getEncoded();
// check that above modification did not change
// internal state of the PolicyQualifierInfo instance
assertTrue(Arrays.equals(encoding, encodingRet1));
}
use of java.security.cert.PolicyQualifierInfo in project robovm by robovm.
the class PolicyQualifierInfoTest method testGetEncoded01.
/**
* Test #1 for <code>getEncoded()</code> method
* Assertion: Returns the ASN.1 DER encoded form of
* this <code>PolicyQualifierInfo</code>
*
* @throws IOException
*/
public final void testGetEncoded01() throws IOException {
// get valid encoding
byte[] encoding = getDerEncoding();
// pass valid array
PolicyQualifierInfo i = new PolicyQualifierInfo(encoding);
// get encoding
byte[] encodingRet = i.getEncoded();
// check returned array
assertTrue(Arrays.equals(encoding, encodingRet));
}
Aggregations