Code example for IdentityScope

Methods: addIdentity, getIdentity

0
        ss.addIdentity(new IdentityScopeStub("bbb"));
        assertEquals(2, ss.size());
    } 
 
    /* 
     * verify  getIdentity(String) returns requested identity or null if not found 
     */ 
    public void testGetIdentityString() throws Exception { 
        //SystemScope ss = new SystemScope("SystemScope"); 
        assertNull(ss.getIdentity("aaa"));
         
        java.security.Identity aaa = new IdentityScopeStub("aaa");
        ss.addIdentity(aaa);
        assertSame(aaa, ss.getIdentity(aaa.getName()));
        assertNull(ss.getIdentity("bbb"));
         
    } 
 
    /* 
     * verify  getIdentity(PublicKey) returns requested identity or null if not found 
     */