Package org.apache.harmony.security.tests.support

Examples of org.apache.harmony.security.tests.support.IdentityScopeStub


     */
    public void testGetIdentityPublicKey() throws Exception {
        //SystemScope ss = new SystemScope("SystemScope");
        java.security.PublicKey kkk = new PublicKeyStub("kkk", "fff", null);
        assertNull(ss.getIdentity(kkk));
        java.security.Identity aaa = new IdentityScopeStub("aaa");
        aaa.setPublicKey(kkk);
        ss.addIdentity(aaa);
       
        assertSame(aaa, ss.getIdentity(kkk));               
    }
View Full Code Here


     * i.e. KeyManagementException is thrown
     */
    public void testAddIdentity() throws Exception {
//        SystemScope ss = new SystemScope("SystemScope");
        java.security.PublicKey kkk = new PublicKeyStub("kkk", "fff", null);       
        java.security.Identity aaa = new IdentityScopeStub("aaa");
        aaa.setPublicKey(kkk);
        ss.addIdentity(aaa);
       
        java.security.Identity bbb = new IdentityScopeStub("aaa");
        try {
            ss.addIdentity(bbb);
            fail("KeyManagementException should be thrown for already used name");
        } catch (KeyManagementException ok) {}
       
        java.security.Identity ccc = new IdentityScopeStub("ccc");
        ccc.setPublicKey(kkk);
        try {
            ss.addIdentity(ccc);
            fail("KeyManagementException should be thrown for already used key");
        } catch (KeyManagementException ok) {}           
               
View Full Code Here

     * @throws Exception
     */
   
    public void testRemoveIdentity() throws Exception{
//        SystemScope ss = new SystemScope("SystemScope");             
        java.security.Identity aaa = new IdentityScopeStub("aaa");       
        ss.addIdentity(aaa);
        assertEquals(1, ss.size());
        ss.removeIdentity(aaa);
        assertEquals(0, ss.size());
    }
View Full Code Here

        assertEquals(0, ss.size());
    }

    public void testIdentities() throws Exception {
//        SystemScope ss = new SystemScope("SystemScope");             
        java.security.Identity aaa = new IdentityScopeStub("aaa");
        java.security.Identity bbb = new IdentityScopeStub("bbb");
        ss.addIdentity(aaa);
        ss.addIdentity(bbb);
       
        boolean hasAaa = false, hasBbb = false;
        Enumeration e = ss.identities();
View Full Code Here

TOP

Related Classes of org.apache.harmony.security.tests.support.IdentityScopeStub

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.