Search in sources :

Example 31 with BeforeClass

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);
}
Also used : SSOToken(com.iplanet.sso.SSOToken) HashMap(java.util.HashMap) AuthenticatedUsers(org.forgerock.openam.entitlement.conditions.subject.AuthenticatedUsers) BeforeClass(org.testng.annotations.BeforeClass)

Example 32 with BeforeClass

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);
}
Also used : Policy(com.sun.identity.policy.Policy) PolicyManager(com.sun.identity.policy.PolicyManager) HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) SubjectTypeManager(com.sun.identity.policy.SubjectTypeManager) Rule(com.sun.identity.policy.Rule) HashMap(java.util.HashMap) Map(java.util.Map) HashSet(java.util.HashSet) BeforeClass(org.testng.annotations.BeforeClass)

Example 33 with BeforeClass

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);
}
Also used : SSOToken(com.iplanet.sso.SSOToken) AMIdentityRepository(com.sun.identity.idm.AMIdentityRepository) BeforeClass(org.testng.annotations.BeforeClass)

Example 34 with BeforeClass

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);
}
Also used : SSOToken(com.iplanet.sso.SSOToken) BeforeClass(org.testng.annotations.BeforeClass)

Example 35 with BeforeClass

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();
}
Also used : OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

BeforeClass (org.testng.annotations.BeforeClass)1186 Series (com.axibase.tsd.api.model.series.Series)178 File (java.io.File)157 ArrayList (java.util.ArrayList)78 HashMap (java.util.HashMap)43 ClusterControllerManager (org.apache.helix.integration.manager.ClusterControllerManager)37 Injector (com.google.inject.Injector)36 Properties (java.util.Properties)35 Path (org.apache.hadoop.fs.Path)33 ClusterSetup (org.apache.helix.tools.ClusterSetup)33 Configuration (org.apache.hadoop.conf.Configuration)31 BigDecimal (java.math.BigDecimal)29 URL (java.net.URL)28 MockParticipantManager (org.apache.helix.integration.manager.MockParticipantManager)27 Date (java.util.Date)26 Server (org.eclipse.jetty.server.Server)25 ServerConnector (org.eclipse.jetty.server.ServerConnector)25 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)23 IOException (java.io.IOException)23 Path (java.nio.file.Path)23