use of org.testng.annotations.BeforeClass in project OpenAM by OpenRock.
the class HttpStarEvaluationTest method setup.
@BeforeClass
public void setup() throws Exception {
SSOToken adminToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
adminSubject = SubjectUtils.createSubject(adminToken);
PrivilegeManager pm = PrivilegeManager.getInstance("/", adminSubject);
Privilege privilege = Privilege.getNewInstance();
privilege.setName(POLICY_NAME);
Map<String, Boolean> actions = new HashMap<String, Boolean>();
actions.put("findAll", true);
Entitlement entitlement = new Entitlement(ApplicationTypeManager.URL_APPLICATION_TYPE_NAME, "http://*", actions);
privilege.setEntitlement(entitlement);
privilege.setSubject(new AuthenticatedUsers());
pm.add(privilege);
}
use of org.testng.annotations.BeforeClass in project OpenAM by OpenRock.
the class IDPPTest method setup.
@BeforeClass
public void setup() throws Exception {
if (!migrated) {
return;
}
user1 = IdRepoUtils.createUser(orgName, USER1_NAME);
group1 = IdRepoUtils.createGroup(orgName, GROUP1_NAME);
group1.addMember(user1);
PolicyManager policyMgr = new PolicyManager(adminToken, orgName);
Policy policy = new Policy("IDPPTestPolicy1");
Set values = new HashSet();
values.add("deny");
Map actionValues = new HashMap();
actionValues.put("MODIFY", values);
actionValues.put("QUERY", values);
String resourceName = "*";
String ruleName = "rule1";
Rule rule = new Rule(ruleName, serviceType, resourceName, actionValues);
policy.addRule(rule);
SubjectTypeManager subjectTypeMgr = policyMgr.getSubjectTypeManager();
com.sun.identity.policy.interfaces.Subject subject = subjectTypeMgr.getSubject("AMIdentitySubject");
values = new HashSet();
values.add(group1.getUniversalId());
subject.setValues(values);
policy.addSubject("subject1", subject, false);
policyMgr.addPolicy(policy);
}
use of org.testng.annotations.BeforeClass in project OpenAM by OpenRock.
the class IdentityGroupToEntitlementGroupTest method setup.
@BeforeClass
public void setup() throws Exception {
SSOToken adminToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
AMIdentityRepository amir = new AMIdentityRepository(adminToken, "/");
group1 = amir.createIdentity(IdType.GROUP, GROUP_NAME1, Collections.EMPTY_MAP);
group2 = amir.createIdentity(IdType.GROUP, GROUP_NAME2, Collections.EMPTY_MAP);
}
use of org.testng.annotations.BeforeClass in project OpenAM by OpenRock.
the class SubRealmEvaluationTest method setup.
@BeforeClass
public void setup() throws Exception {
SSOToken adminToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
adminSubject = SubjectUtils.createSubject(adminToken);
Application appl = new Application(APPL_NAME, ApplicationTypeManager.getAppplicationType(adminSubject, ApplicationTypeManager.URL_APPLICATION_TYPE_NAME));
// Test disabled, unable to fix model change
// Set<String> avaliableResources = new HashSet<String>();
// avaliableResources.add("http://www.testevaluator.com:80/*");
// appl.addResources(avaliableResources);
appl.setEntitlementCombiner(DenyOverride.class);
ApplicationManager.saveApplication(adminSubject, "/", appl);
}
use of org.testng.annotations.BeforeClass in project OpenAM by OpenRock.
the class ReferralPrivilegeWithRemovedRealmTest method setup.
@BeforeClass
public void setup() throws Exception {
if (!migrated) {
return;
}
OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
String subRealm = SUB_REALM.substring(1);
ocm.createSubOrganization(subRealm, Collections.EMPTY_MAP);
createReferral();
}
Aggregations