public void testGetCallerPrincipal() throws Exception {
Subject subject = new Subject();
GeronimoUserPrincipal userPrincipal = new GeronimoUserPrincipal("foo");
RealmPrincipal realmPrincipal = new RealmPrincipal("domain", userPrincipal);
PrimaryRealmPrincipal primaryRealmPrincipal = new PrimaryRealmPrincipal("domain", userPrincipal);
GeronimoGroupPrincipal groupPrincipal = new GeronimoGroupPrincipal("bar");
Set principals = subject.getPrincipals();
principals.add(userPrincipal);
principals.add(realmPrincipal);
principals.add(primaryRealmPrincipal);
principals.add(groupPrincipal);