Code example for PolicyQualifierInfo

Methods: toString

0
        // 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();
        // modify returned array 
        pqEncodingRet[0] = (byte)0;
        // get encoding again 
        byte[] pqEncodingRet1 = i.getPolicyQualifier();
        // 
        assertNotSame(pqEncodingRet, pqEncodingRet1);
        // check that above modification did not change 
        // internal state of the PolicyQualifierInfo instance 
        assertTrue(Arrays.equals(pqEncoding, pqEncodingRet1));
    } 
 
    /** 
     * Test for <code>getPolicyQualifierId()</code> method 
     * Assertion: Returns the <code>policyQualifierId</code>