Code example for IdentityScope

Methods: addIdentity, removeIdentity, size

0
 
    /** 
     * verify that identities are removed 
     * @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());
    } 
 
    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);