XACMLSchemaFactoryTest.java revision 1f1a4f601910433031571ae0439dbe569b9928bc
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014 ForgeRock AS.
*/
/**
* Unit tests for {@link com.sun.identity.entitlement.xacml3.XACMLSchemaFactory}.
*
* @since 12.0.0
*/
public class XACMLSchemaFactoryTest {
private AdviceExpressions aes;
private XACMLSchemaFactory xacmlSchemaFactory;
public void setup() throws EntitlementException {
xacmlSchemaFactory = new XACMLSchemaFactory();
aes = new AdviceExpressions();
}
@Test
public void shouldConvertResourceAttributesToAndFrom() throws EntitlementException {
// When...
// Then...
}
}
@Test
public void shouldConvertAdviceExpressionToAndFrom() throws EntitlementException{
// When...
// Then...
}
}
@Test
public void shouldConvertAdviceExpressionsToAndFrom() throws EntitlementException {
// When...
// Then...
}
/**
* 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) {
for (int j = 0; j < 5 * i; j++) {
}
return result;
}
/**
* Create an advice expression using the values in the specified resource attribute
* @param ra the specified resource attribute
* @return an advice expression
* @throws EntitlementException if there are JSON errors
*/
private AdviceExpression createAdviceExpression(final ResourceAttribute ra) throws EntitlementException {
// We bypass much of the grief of conversion by getting JSON to do the heavy lifting for us.
return result;
}
/**
* Assert the specified resource attribute objects contain the same values.
* @param ra1 the first specified resource attribute object
* @param ra2 the second specified resource attribute object
*/
private void assertEqualResourceAttributeValues(final ResourceAttribute ra1, final ResourceAttribute ra2) {
}
/**
* Check the specified resource attribute objects contain the same values, returning true if so, false otherwise.
* @param ra1 the first specified resource attribute object
* @param ra2 the second specified resource attribute object
*/
private boolean checkEqualResourceAttributes(final ResourceAttribute ra1, final ResourceAttribute ra2) {
return true;
}
return true;
}
return false;
}
}
/**
* Assert that two advice expression objects contain the same values.
* @param ae1 the first advice expression object
* @param ae2 the second advice expression object
*/
private void assertEqualAdviceExpressionValues(final AdviceExpression ae1, final AdviceExpression ae2) {
}
/**
* Check that two advice expression objects contain the same values, return true if so, false otherwise.
* @param ae1 the first advice expression object
* @param ae2 the second advice expression object
* @return true if the advice expression objects contain the same values, false otherwise.
*/
private boolean checkEqualAdviceExpressionValues(final AdviceExpression ae1, final AdviceExpression ae2) {
return true;
}
return false;
}
return false;
}
return false;
}
return false;
}
}
/**
* Compare two sets of strings, returning true if they hold the same values, false otherwise
* @param one The first set of strings
* @param two The second set of strings
* @return true if both sets hold the same values, false otherwise.
*/
return true;
}
return true;
}
return false;
}
return false;
}
return false;
}
}
return true;
}
/**
* Compare two strings, either or both of which may be null.
* @param one First string
* @param two Second string
* @return true if the strings are the same, false otherwise.
*/
return true;
}
return false;
}
}
/**
* Compare two lists of AttributeAssignmentExpression objects. If the lists contain the same values, return
* true, otherwise return false.
* @param list1 The first list.
* @param list2 The second list.
* @return true if the lists contain the same values, false otherwise.
*/
private boolean compareListsOfAttributeAssignmentExpression(List<AttributeAssignmentExpression> list1,
return false;
}
boolean found = false;
found = true;
break;
}
}
if (!found) {
return false;
}
}
return true;
}
/**
* @param first First attribute assignment expression to check
* @param second Second attribute assignment expression to check
* @return true if both attribute assignment expressions contain the same values, false otherwise
*/
return true;
}
return false;
}
return true;
}
return false;
}
return false;
}
}
/**
* Compare two AttributeValue objects, returning true if they contain equal values, false otherwise.
* @param first The first attribute value.
* @param second The second attribute value.
* @return true if the objects contain the same values, false otherwise.
*/
return true;
}
return false;
}
return true;
}
return false;
}
return false;
}
boolean found = false;
try {
if (found) {
break;
}
} catch (EntitlementException ignored) {
}
}
}
if (!found) {
return false;
}
}
return true;
}
/**
* Assert that two advice expressions objects contain the same values, i.e. that the advice expression objects
* they contain, contain the same values.
* @param aes1 the first advice expressions object
* @param aes2 the second advice expressions object
*/
private void assertEqualAdviceExpressions(final AdviceExpressions aes1, final AdviceExpressions aes2) {
boolean found = false;
found = true;
break;
}
}
}
}
}