Commit b2a8bb25 authored by cdanger's avatar cdanger

Replaced occurrences of 'com.thalesgroup' with 'org.ow2'

parent 05f4f8bf
......@@ -60,3 +60,6 @@ To get started using a PDP to evaluate XACML requests, instantiate a new PDP ins
Once you have a PDP instance. You can evaluate a XACML request by calling one of the `PDP#evaluate(...)` methods.
Our PDP implementation uses SLF4J for logging so you can use any SLF4J implementation to manage logging. As an example, we use logback for testing, so you can use [logback.xml](src/test/resources/logback.xml) as an example for configuring loggers, appenders, etc.
If you are using **Java 8**, make sure you set the following JVM system property is set before execution:
`javax.xml.accessExternalSchema = http`
\ No newline at end of file
......@@ -28,7 +28,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This is a com.thalesgroup.authzforce.core.test.basic implementation of <code>PdpExtensionRegistry</code>.
* This is an implementation of <code>PdpExtensionRegistry</code>.
*
* @param <T>
* type of extension in this registry
......
......@@ -26,7 +26,7 @@ import org.ow2.authzforce.core.pdp.api.combining.CombiningAlgRegistry;
import org.ow2.authzforce.core.pdp.impl.BasePdpExtensionRegistry;
/**
* This is a com.thalesgroup.authzforce.core.test.basic implementation of <code>CombiningAlgRegistry</code>.
* This is a basic implementation of <code>CombiningAlgRegistry</code>.
*
* @version $Id: $
*/
......
......@@ -132,11 +132,6 @@ public class AttributeDesignator<AV extends AttributeValue> extends AttributeDes
throw UNSUPPORTED_DATATYPE_SET_OPERATION_EXCEPTION;
}
/*
* (non-Javadoc)
*
* @see com.thalesgroup.authzforce.core.eval.Expression#isStatic()
*/
/** {@inheritDoc} */
@Override
public boolean isStatic()
......
......@@ -235,11 +235,6 @@ public class AttributeSelectorExpression<AV extends AttributeValue> extends Attr
throw UNSUPPORTED_PATH_SET_OPERATION_EXCEPTION;
}
/*
* (non-Javadoc)
*
* @see com.thalesgroup.authzforce.core.eval.Expression#isStatic()
*/
/** {@inheritDoc} */
@Override
public boolean isStatic()
......@@ -348,9 +343,6 @@ public class AttributeSelectorExpression<AV extends AttributeValue> extends Attr
/**
* {@inheritDoc}
*
* Invokes the <code>AttributeProvider</code> used by the given <code>EvaluationContext</code> to try to resolve an attribute value. If the selector is defined with MustBePresent as true, then
* failure to find a matching value will result in Indeterminate, otherwise it will result in an empty bag. To support the com.thalesgroup.authzforce.core.test.basic selector functionality defined
* in the XACML specification, use a Provider that has only the <code>SelectorModule</code> as a module that supports selector finding.
*/
@Override
public Bag<AV> evaluate(EvaluationContext context) throws IndeterminateEvaluationException
......
......@@ -312,14 +312,6 @@ public class ExpressionFactoryImpl implements ExpressionFactory {
return this.functionRegistry.getFunction(functionId, subFuncReturnTypeFactory);
}
/*
* (non-Javadoc)
*
* @see
* com.thalesgroup.authzforce.core.eval.ExpressionFactory#getInstance(oasis.
* names.tc.xacml._3_0 .core.schema.wd_17.ExpressionType,
* oasis.names.tc.xacml._3_0.core.schema.wd_17.DefaultsType, java.util.List)
*/
/** {@inheritDoc} */
@Override
public Expression<?> getInstance(ExpressionType expr, XPathCompiler xPathCompiler, Deque<String> longestVarRefChain)
......@@ -402,13 +394,6 @@ public class ExpressionFactoryImpl implements ExpressionFactory {
return expression;
}
/*
* (non-Javadoc)
*
* @see com.thalesgroup.authzforce.core.eval.ExpressionFactory#
* createAttributeValueExpression(oasis
* .names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType)
*/
/** {@inheritDoc} */
@Override
public ValueExpression<? extends AttributeValue> getInstance(AttributeValueType jaxbAttrVal,
......
......@@ -38,9 +38,10 @@ import org.ow2.authzforce.core.pdp.api.value.StandardDatatypes;
/**
* A class that implements the logical function "and".
* <p>
* From XACML core specification of function 'urn:oasis:names:tc:xacml:1.0:function:and': This function SHALL return "True" if it has no arguments and SHALL return "False" if one of its arguments
* evaluates to "False". The order of evaluation SHALL be from first argument to last. The evaluation SHALL stop with a result of "False" if any argument evaluates to "False", leaving the rest of the
* arguments unevaluated.
* From XACML core specification of function 'urn:oasis:names:tc:xacml:1.0:function:and': This function SHALL return
* "True" if it has no arguments and SHALL return "False" if one of its arguments evaluates to "False". The order of
* evaluation SHALL be from first argument to last. The evaluation SHALL stop with a result of "False" if any argument
* evaluates to "False", leaving the rest of the arguments unevaluated.
*
*
* @version $Id: $
......@@ -56,11 +57,12 @@ final class LogicalAndFunction extends SingleParameterTypedFirstOrderFunction<Bo
* <ol>
* <li>If any argument expression is constant BooleanAttributeValue False, return always False.</li>
* <li>Else If all argument expressions are constant BooleanAttributeValue True, return always True.</li>
* <li>
* Else If any argument expression is constant BooleanAttributeValue True, remove it from the arguments, as it has no effect on the final result. Indeed, and function is commutative and
* and(true, x, y...) = and(x, y...).</li>
* <li>Else If any argument expression is constant BooleanAttributeValue True, remove it from the arguments, as
* it has no effect on the final result. Indeed, and function is commutative and and(true, x, y...) = and(x,
* y...).</li>
* </ol>
* The first two optimizations can be achieved by pre-evaluating the function call with context = null and check the result if no IndeterminateEvaluationException is thrown.
* The first two optimizations can be achieved by pre-evaluating the function call with context = null and check
* the result if no IndeterminateEvaluationException is thrown.
*/
private static final class Call extends FirstOrderFunctionCall<BooleanValue>
{
......@@ -69,16 +71,20 @@ final class LogicalAndFunction extends SingleParameterTypedFirstOrderFunction<Bo
private final List<Expression<?>> checkedArgExpressions;
private Call(final FirstOrderFunctionSignature<BooleanValue> functionSig, final List<Expression<?>> argExpressions, final Datatype<?>[] remainingArgTypes) throws IllegalArgumentException
private Call(final FirstOrderFunctionSignature<BooleanValue> functionSig,
final List<Expression<?>> argExpressions, final Datatype<?>[] remainingArgTypes)
throws IllegalArgumentException
{
super(functionSig, argExpressions, remainingArgTypes);
this.checkedArgExpressions = argExpressions;
invalidArgTypeMsgPrefix = "Function " + functionSig.getName() + ": Invalid type (expected = " + StandardDatatypes.BOOLEAN_FACTORY.getDatatype() + ") of arg#";
invalidArgTypeMsgPrefix = "Function " + functionSig.getName() + ": Invalid type (expected = "
+ StandardDatatypes.BOOLEAN_FACTORY.getDatatype() + ") of arg#";
indeterminateArgMsgPrefix = "Function " + functionSig.getName() + ": Indeterminate arg #";
}
@Override
public BooleanValue evaluate(final EvaluationContext context, final AttributeValue... remainingArgs) throws IndeterminateEvaluationException
public BooleanValue evaluate(final EvaluationContext context, final AttributeValue... remainingArgs)
throws IndeterminateEvaluationException
{
IndeterminateEvaluationException indeterminateException = null;
int argIndex = 0;
......@@ -93,11 +99,13 @@ final class LogicalAndFunction extends SingleParameterTypedFirstOrderFunction<Bo
{
return BooleanValue.FALSE;
}
} catch (final IndeterminateEvaluationException e)
}
catch (final IndeterminateEvaluationException e)
{
// keep the indeterminate error to throw later if there was not any FALSE in
// remaining args
indeterminateException = new IndeterminateEvaluationException(indeterminateArgMsgPrefix + argIndex, StatusHelper.STATUS_PROCESSING_ERROR, e);
indeterminateException = new IndeterminateEvaluationException(
indeterminateArgMsgPrefix + argIndex, StatusHelper.STATUS_PROCESSING_ERROR, e);
}
argIndex++;
......@@ -114,9 +122,12 @@ final class LogicalAndFunction extends SingleParameterTypedFirstOrderFunction<Bo
try
{
attrVal = BooleanValue.class.cast(arg);
} catch (final ClassCastException e)
}
catch (final ClassCastException e)
{
throw new IndeterminateEvaluationException(invalidArgTypeMsgPrefix + argIndex + ": " + arg.getClass().getName(), StatusHelper.STATUS_PROCESSING_ERROR, e);
throw new IndeterminateEvaluationException(
invalidArgTypeMsgPrefix + argIndex + ": " + arg.getClass().getName(),
StatusHelper.STATUS_PROCESSING_ERROR, e);
}
if (!attrVal.getUnderlyingValue())
......@@ -141,12 +152,14 @@ final class LogicalAndFunction extends SingleParameterTypedFirstOrderFunction<Bo
private final SingleParameterTypedFirstOrderFunctionSignature<BooleanValue, BooleanValue> funcSig;
private CallFactory(final SingleParameterTypedFirstOrderFunctionSignature<BooleanValue, BooleanValue> functionSignature)
private CallFactory(
final SingleParameterTypedFirstOrderFunctionSignature<BooleanValue, BooleanValue> functionSignature)
{
this.funcSig = functionSignature;
}
protected FirstOrderFunctionCall<BooleanValue> getInstance(final List<Expression<?>> argExpressions, final Datatype<?>[] remainingArgTypes)
protected FirstOrderFunctionCall<BooleanValue> getInstance(final List<Expression<?>> argExpressions,
final Datatype<?>[] remainingArgTypes)
{
return new Call(funcSig, argExpressions, remainingArgTypes);
}
......@@ -157,18 +170,15 @@ final class LogicalAndFunction extends SingleParameterTypedFirstOrderFunction<Bo
LogicalAndFunction(final String functionId)
{
super(functionId, StandardDatatypes.BOOLEAN_FACTORY.getDatatype(), true, Arrays.asList(StandardDatatypes.BOOLEAN_FACTORY.getDatatype()));
super(functionId, StandardDatatypes.BOOLEAN_FACTORY.getDatatype(), true,
Arrays.asList(StandardDatatypes.BOOLEAN_FACTORY.getDatatype()));
this.funcCallFactory = new CallFactory(this.functionSignature);
}
/*
* (non-Javadoc)
*
* @see com.thalesgroup.authzforce.core.func.FirstOrderFunction#getFunctionCall(java.util.List, com.thalesgroup.authzforce.core.eval.DatatypeDef[])
*/
/** {@inheritDoc} */
@Override
public FirstOrderFunctionCall<BooleanValue> newCall(final List<Expression<?>> argExpressions, final Datatype<?>... remainingArgTypes) throws IllegalArgumentException
public FirstOrderFunctionCall<BooleanValue> newCall(final List<Expression<?>> argExpressions,
final Datatype<?>... remainingArgTypes) throws IllegalArgumentException
{
return this.funcCallFactory.getInstance(argExpressions, remainingArgTypes);
}
......
......@@ -37,9 +37,10 @@ import org.ow2.authzforce.core.pdp.api.value.StandardDatatypes;
/**
* A class that implements the logical functions "or"
* <p>
* From XACML core specification of function 'urn:oasis:names:tc:xacml:1.0:function:or': This function SHALL return "False" if it has no arguments and SHALL return "True" if at least one of its
* arguments evaluates to "True". The order of evaluation SHALL be from first argument to last. The evaluation SHALL stop with a result of "True" if any argument evaluates to "True", leaving the rest
* of the arguments unevaluated.
* From XACML core specification of function 'urn:oasis:names:tc:xacml:1.0:function:or': This function SHALL return
* "False" if it has no arguments and SHALL return "True" if at least one of its arguments evaluates to "True". The
* order of evaluation SHALL be from first argument to last. The evaluation SHALL stop with a result of "True" if any
* argument evaluates to "True", leaving the rest of the arguments unevaluated.
*
*
* @version $Id: $
......@@ -54,27 +55,32 @@ final class LogicalOrFunction extends SingleParameterTypedFirstOrderFunction<Boo
private final List<Expression<?>> checkedArgExpressions;
private Call(final FirstOrderFunctionSignature<BooleanValue> functionSig, final List<Expression<?>> argExpressions, final Datatype<?>[] remainingArgTypes) throws IllegalArgumentException
private Call(final FirstOrderFunctionSignature<BooleanValue> functionSig,
final List<Expression<?>> argExpressions, final Datatype<?>[] remainingArgTypes)
throws IllegalArgumentException
{
super(functionSig, argExpressions, remainingArgTypes);
this.checkedArgExpressions = argExpressions;
indeterminateArgMsgPrefix = "Function " + functionSig.getName() + ": Indeterminate arg #";
invalidArgTypeMsgPrefix = "Function " + functionSig.getName() + ": Invalid type (expected = " + StandardDatatypes.BOOLEAN_FACTORY.getDatatype() + ") of arg#";
invalidArgTypeMsgPrefix = "Function " + functionSig.getName() + ": Invalid type (expected = "
+ StandardDatatypes.BOOLEAN_FACTORY.getDatatype() + ") of arg#";
}
@Override
public BooleanValue evaluate(final EvaluationContext context, final AttributeValue... checkedRemainingArgs) throws IndeterminateEvaluationException
public BooleanValue evaluate(final EvaluationContext context, final AttributeValue... checkedRemainingArgs)
throws IndeterminateEvaluationException
{
/**
* TODO: optimize this function call by checking the following:
* <ol>
* <li>If any argument expression is constant BooleanAttributeValue True, return always true.</li>
* <li>Else If all argument expressions are constant BooleanAttributeValue False, return always false.</li>
* <li>
* Else If any argument expression is constant BooleanAttributeValue False, remove it from the arguments, as it has no effect on the final result. Indeed, or function is commutative and
* or(false, x, y...) = or(x, y...).</li>
* <li>Else If any argument expression is constant BooleanAttributeValue False, remove it from the
* arguments, as it has no effect on the final result. Indeed, or function is commutative and or(false, x,
* y...) = or(x, y...).</li>
* </ol>
* The first two optimizations can be achieved by pre-evaluating the function call with context = null and check the result if no IndeterminateEvaluationException is thrown.
* The first two optimizations can be achieved by pre-evaluating the function call with context = null and
* check the result if no IndeterminateEvaluationException is thrown.
*/
IndeterminateEvaluationException indeterminateException = null;
......@@ -90,11 +96,13 @@ final class LogicalOrFunction extends SingleParameterTypedFirstOrderFunction<Boo
{
return BooleanValue.TRUE;
}
} catch (final IndeterminateEvaluationException e)
}
catch (final IndeterminateEvaluationException e)
{
// save the indeterminate to throw later only if there was not any TRUE in remaining
// args
indeterminateException = new IndeterminateEvaluationException(indeterminateArgMsgPrefix + argIndex, StatusHelper.STATUS_PROCESSING_ERROR, e);
indeterminateException = new IndeterminateEvaluationException(indeterminateArgMsgPrefix + argIndex,
StatusHelper.STATUS_PROCESSING_ERROR, e);
}
argIndex++;
......@@ -111,9 +119,12 @@ final class LogicalOrFunction extends SingleParameterTypedFirstOrderFunction<Boo
try
{
attrVal = BooleanValue.class.cast(arg);
} catch (final ClassCastException e)
}
catch (final ClassCastException e)
{
throw new IndeterminateEvaluationException(invalidArgTypeMsgPrefix + argIndex + ": " + arg.getClass().getName(), StatusHelper.STATUS_PROCESSING_ERROR, e);
throw new IndeterminateEvaluationException(
invalidArgTypeMsgPrefix + argIndex + ": " + arg.getClass().getName(),
StatusHelper.STATUS_PROCESSING_ERROR, e);
}
if (attrVal.getUnderlyingValue())
......@@ -138,17 +149,14 @@ final class LogicalOrFunction extends SingleParameterTypedFirstOrderFunction<Boo
LogicalOrFunction(final String functionId)
{
super(functionId, StandardDatatypes.BOOLEAN_FACTORY.getDatatype(), true, Arrays.asList(StandardDatatypes.BOOLEAN_FACTORY.getDatatype()));
super(functionId, StandardDatatypes.BOOLEAN_FACTORY.getDatatype(), true,
Arrays.asList(StandardDatatypes.BOOLEAN_FACTORY.getDatatype()));
}
/*
* (non-Javadoc)
*
* @see com.thalesgroup.authzforce.core.func.FirstOrderFunction#getFunctionCall(java.util.List, com.thalesgroup.authzforce.core.eval.DatatypeDef[])
*/
/** {@inheritDoc} */
@Override
public FirstOrderFunctionCall<BooleanValue> newCall(final List<Expression<?>> argExpressions, final Datatype<?>... remainingArgTypes)
public FirstOrderFunctionCall<BooleanValue> newCall(final List<Expression<?>> argExpressions,
final Datatype<?>... remainingArgTypes)
{
return new Call(functionSignature, argExpressions, remainingArgTypes);
}
......
......@@ -271,11 +271,6 @@ final class StandardHigherOrderBagFunctions
super(functionName, returnType, subFunctionReturnType);
}
/*
* (non-Javadoc)
*
* @see com.thalesgroup.authzforce.core.func.HigherOrderBagFunction#checkNumberOfArgs(int)
*/
@Override
protected final void checkNumberOfArgs(final int numInputs)
{
......@@ -298,11 +293,6 @@ final class StandardHigherOrderBagFunctions
*/
protected abstract Call<RETURN_T, SUB_RETURN_T> newFunctionCall(FirstOrderFunction<SUB_RETURN_T> subFunc, List<Expression<?>> primitiveInputs, Expression<?> lastInputBag);
/*
* (non-Javadoc)
*
* @see com.thalesgroup.authzforce.core.func.HigherOrderBagFunction# createFunctionCallFromSubFunction (com.thalesgroup.authzforce.core.func.FirstOrderFunction, java.util.List, java.util.List)
*/
@Override
protected final FunctionCall<RETURN_T> createFunctionCallFromSubFunction(final FirstOrderFunction<SUB_RETURN_T> subFunc, final List<Expression<?>> inputsAfterSubFunc)
{
......
......@@ -46,11 +46,6 @@ final class StringConcatenateFunction extends SingleParameterTypedFirstOrderFunc
StandardDatatypes.STRING_FACTORY.getDatatype()));
}
/*
* (non-Javadoc)
*
* @see com.thalesgroup.authzforce.core.func.FirstOrderFunction#getFunctionCall(java.util.List, com.thalesgroup.authzforce.core.eval.DatatypeDef[])
*/
@Override
public FirstOrderFunctionCall<StringValue> newCall(final List<Expression<?>> argExpressions, final Datatype<?>... remainingArgTypes)
{
......
......@@ -52,19 +52,24 @@ final class StringN11nFunction extends SingleParameterTypedFirstOrderFunction<St
private final StringNormalizer strNormalizer;
private final SingleParameterTypedFirstOrderFunctionSignature<StringValue, StringValue> funcSig;
public CallFactory(final SingleParameterTypedFirstOrderFunctionSignature<StringValue, StringValue> functionSignature, final StringNormalizer stringNormalizer)
public CallFactory(
final SingleParameterTypedFirstOrderFunctionSignature<StringValue, StringValue> functionSignature,
final StringNormalizer stringNormalizer)
{
this.funcSig = functionSignature;
this.strNormalizer = stringNormalizer;
}
private FirstOrderFunctionCall<StringValue> getInstance(final List<Expression<?>> argExpressions, final Datatype<?>... remainingArgTypes) throws IllegalArgumentException
private FirstOrderFunctionCall<StringValue> getInstance(final List<Expression<?>> argExpressions,
final Datatype<?>... remainingArgTypes) throws IllegalArgumentException
{
return new EagerSinglePrimitiveTypeEval<StringValue, StringValue>(funcSig, argExpressions, remainingArgTypes)
return new EagerSinglePrimitiveTypeEval<StringValue, StringValue>(funcSig, argExpressions,
remainingArgTypes)
{
@Override
protected StringValue evaluate(final Deque<StringValue> argStack) throws IndeterminateEvaluationException
protected StringValue evaluate(final Deque<StringValue> argStack)
throws IndeterminateEvaluationException
{
return strNormalizer.normalize(argStack.getFirst());
}
......@@ -89,8 +94,10 @@ final class StringN11nFunction extends SingleParameterTypedFirstOrderFunction<St
public StringValue normalize(final StringValue value)
{
/*
* Specified by fn:lower-case function in [XF]. Looking at Saxon HE as our reference for Java open source implementation of XPath functions, we can check in Saxon implementation of
* fn:lower-case (LowerCase class), that this is equivalent to String#toLowerCase(); English locale to be used for Locale-insensitive strings, see String.toLowerCase()
* Specified by fn:lower-case function in [XF]. Looking at Saxon HE as our reference for Java open source
* implementation of XPath functions, we can check in Saxon implementation of fn:lower-case (LowerCase
* class), that this is equivalent to String#toLowerCase(); English locale to be used for Locale-insensitive
* strings, see String.toLowerCase()
*/
return value.toLowerCase(Locale.ENGLISH);
}
......@@ -108,18 +115,15 @@ final class StringN11nFunction extends SingleParameterTypedFirstOrderFunction<St
*/
StringN11nFunction(final String functionId, final StringNormalizer stringNormalizer)
{
super(functionId, StandardDatatypes.STRING_FACTORY.getDatatype(), false, Collections.singletonList(StandardDatatypes.STRING_FACTORY.getDatatype()));
super(functionId, StandardDatatypes.STRING_FACTORY.getDatatype(), false,
Collections.singletonList(StandardDatatypes.STRING_FACTORY.getDatatype()));
this.funcCallFactory = new CallFactory(functionSignature, stringNormalizer);
}
/*
* (non-Javadoc)
*
* @see com.thalesgroup.authzforce.core.func.FirstOrderFunction#getFunctionCall(java.util.List, com.thalesgroup.authzforce.core.eval.DatatypeDef[])
*/
/** {@inheritDoc} */
@Override
public FirstOrderFunctionCall<StringValue> newCall(final List<Expression<?>> argExpressions, final Datatype<?>... remainingArgTypes) throws IllegalArgumentException
public FirstOrderFunctionCall<StringValue> newCall(final List<Expression<?>> argExpressions,
final Datatype<?>... remainingArgTypes) throws IllegalArgumentException
{
return funcCallFactory.getInstance(argExpressions, remainingArgTypes);
}
......
......@@ -136,11 +136,7 @@ final class SubstringFunction<AV extends SimpleValue<String>> extends MultiParam
this.param0Type = param0Type;
}
/*
* (non-Javadoc)
*
* @see com.thalesgroup.authzforce.core.func.FirstOrderFunction#getFunctionCall(java.util.List, com.thalesgroup.authzforce.core.eval.DatatypeDef[])
*/
/** {@inheritDoc} */
@Override
public FirstOrderFunctionCall<StringValue> newCall(final List<Expression<?>> argExpressions, final Datatype<?>... remainingArgTypes)
......
......@@ -135,11 +135,6 @@ public final class XPathNodeCountFunction extends SingleParameterTypedFirstOrder
this.funcCallFactory = new CallFactory(this.functionSignature);
}
/*
* (non-Javadoc)
*
* @see com.thalesgroup.authzforce.core.func.FirstOrderFunction#getFunctionCall(java.util.List, com.thalesgroup.authzforce.core.eval.DatatypeDef[])
*/
/** {@inheritDoc} */
@Override
public FirstOrderFunctionCall<IntegerValue> newCall(final List<Expression<?>> argExpressions, Datatype<?>... remainingArgTypes) throws IllegalArgumentException
......
......@@ -131,11 +131,6 @@ public class BaseDatatypeFactoryRegistry extends BasePdpExtensionRegistry<Dataty
return createValueExpression(datatypeFactory, jaxbAttrVal, xPathCompiler, datatypeFactory.isExpressionStatic());
}
/*
* (non-Javadoc)
*
* @see com.thalesgroup.authzforce.core.BasePdpExtensionRegistry#addExtension(com.thalesgroup.authzforce .core.PdpExtension)
*/
/** {@inheritDoc} */
@Override
public void addExtension(DatatypeFactory<?> datatypeFactory) throws IllegalArgumentException
......
......@@ -190,6 +190,7 @@ public abstract class PdpTest
@Test
public void test() throws IllegalArgumentException, IOException, URISyntaxException, JAXBException
{
LOGGER.debug("******************************");
LOGGER.debug("Starting PDP test of directory '{}'", testDirPath);
final String testResourceLocationPrefix = testDirPath + "/";
// Parse request
......
This is the directory for all non-regression tests, where each subdirectory corresponds to one test, named after the ID of the issue(s) (underscore-separated list if multiple) of the specific bug(s) in the issue management system (e.g. Gitlab, JIRA...) that this test reproduces before fixing. Therefore, this test validates that there have been no regression after fixing the bug. Tests in this directory are run by the class `com.thalesgroup.authzforce.core.test.nonregression.NonRegression.java` in folder `src/test/java`. This class expects one subdirectory named `$issueId_$shortTitle` (e.g. 12_SomethingBrokenBecauseOfSomeOtherThing) under `src/test/resources/NonRegression` per test with the following content:
This is the directory for all non-regression tests, where each subdirectory corresponds to one test, named after the ID of the issue(s) (underscore-separated list if multiple) of the specific bug(s) in the issue management system (e.g. Gitlab, JIRA...) that this test reproduces before fixing. Therefore, this test validates that there have been no regression after fixing the bug. Tests in this directory are run by the class `org.ow2.authzforce.core.test.NonRegression.java` in folder `src/test/java`. This class expects one subdirectory per test, named `${issueMgtServerId}#${issueId}.${shortTitle}${suffix}` under directory `src/test/resources/NonRegression`, with the following content (`issueMgtServerId` is either `OW2` if the issue was reported on Authzforce OW2-hosted JIRA site, or `GitHub` if reported on the GitHub project repository; `issueId` is the issue ID on either site; `shortTitle` is a short title for the issue in a form compatible with filenames and with whitespaces replaced by underscores; you may add a suffix (optional) in the form `.${M}of{N}` indicate the part number if the bug requires a sequence of multiple sub-tests to be reproduced, where `N` is the total number of sub-tests in the sequence and `M` is the index of the sub-test in this sequence; e.g. `OW2#12.Something_broken` would be the issue at URL `https://jira.ow2.org/browse/AUTHZFORCE-12`, `GitHub#34.Some_other_thing_broken.1of2` would sub-test #1 in a sequence of 2 sub-tests reproducing the issue at URL `https://github.com/authzforce/core/issues/34`):
- `pdp.xml` (required) : PDP configuration file
- `pdp-ext.xsd` (optional): XSD for loading PDP extensions such as the TestAttributeFinder, required only if such extensions are used in the PDP configuration file
- `policy.xml` (required): XACML Policy(Set) file
- `request.xml` (required): XACML Request
- `response.xml` (required): expected response for the test to succeed
- `README.md` (required): description of the test, mostly taken from the issue description and comments in the issue management system where the bug was reported.
- `README.md` (required): title and description of the test, mostly taken from the issue description and comments in the issue management system where the bug was reported.
If you implement or use a new PDP extension for testing, make sure there have a matching 'system' entry for the resolving the extension XSD location in the XML catalog file `src/test/resources/catalog.xml`, like the one for the TestAttributeFinder XSD.
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment