Search in sources :

Example 1 with PolicyResponseProvider

use of com.sun.identity.entitlement.opensso.PolicyResponseProvider in project OpenAM by OpenRock.

the class XACMLSchemaFactoryTest method setup.

@BeforeMethod
public void setup() throws EntitlementException {
    xacmlSchemaFactory = new XACMLSchemaFactory();
    resourceAttributeUtil = new ResourceAttributeUtil();
    PolicyResponseProvider rp1 = createPolicyResponseProvider(1);
    PolicyResponseProvider rp2 = createPolicyResponseProvider(2);
    PolicyResponseProvider rp3 = createPolicyResponseProvider(3);
    PolicyResponseProvider rp4 = createPolicyResponseProvider(4);
    rpSet = CollectionUtils.asSet(rp1, rp2, rp3, rp4);
    AdviceExpression ae1 = createAdviceExpression(rp1);
    AdviceExpression ae2 = createAdviceExpression(rp2);
    AdviceExpression ae3 = createAdviceExpression(rp3);
    AdviceExpression ae4 = createAdviceExpression(rp4);
    aes = new AdviceExpressions();
    aes.getAdviceExpression().addAll(Arrays.asList(ae1, ae2, ae3, ae4));
}
Also used : AdviceExpression(com.sun.identity.entitlement.xacml3.core.AdviceExpression) PolicyResponseProvider(com.sun.identity.entitlement.opensso.PolicyResponseProvider) AdviceExpressions(com.sun.identity.entitlement.xacml3.core.AdviceExpressions) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with PolicyResponseProvider

use of com.sun.identity.entitlement.opensso.PolicyResponseProvider in project OpenAM by OpenRock.

the class XACMLSchemaFactoryTest method createPolicyResponseProvider.

/**
     * Create a PolicyResponseProvider object
     * @param i Value to stick on the end of various strings
     * @return the created PolicyResponseProvider object
     */
private PolicyResponseProvider createPolicyResponseProvider(int i) {
    PolicyResponseProvider result = new PolicyResponseProvider();
    result.setPResponseProviderName("responseProvider" + i);
    result.setPropertyName("propertyName" + i);
    Set<String> values = new HashSet<String>();
    for (int j = 0; j < 5 * i; j++) {
        values.add("value" + j);
    }
    result.setPropertyValues(values);
    return result;
}
Also used : PolicyResponseProvider(com.sun.identity.entitlement.opensso.PolicyResponseProvider) HashSet(java.util.HashSet)

Aggregations

PolicyResponseProvider (com.sun.identity.entitlement.opensso.PolicyResponseProvider)2 AdviceExpression (com.sun.identity.entitlement.xacml3.core.AdviceExpression)1 AdviceExpressions (com.sun.identity.entitlement.xacml3.core.AdviceExpressions)1 HashSet (java.util.HashSet)1 BeforeMethod (org.testng.annotations.BeforeMethod)1