[java-identity-provider COMMIT] in /trunk/idp-attribute-resolver-impl/src: main/java/net/shibboleth/idp/attribute/res...
noreply at shibboleth.net
noreply at shibboleth.net
Mon Mar 25 10:18:29 EDT 2013
Author: rdw
Date: Mon Mar 25 10:18:28 2013
New Revision: 4358
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4358&view=rev
Log:
IDP-275 Rename the (v3) context that the scripts get so as to leave the old name free for legacy support.
Modified:
trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/ad/ScriptedAttributeDefinition.java
trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/ad/ScriptedAttributeTest.java
Modified: trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/ad/ScriptedAttributeDefinition.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/ad/ScriptedAttributeDefinition.java?rev=4358&r1=4357&r2=4358&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/ad/ScriptedAttributeDefinition.java (original)
+++ trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/ad/ScriptedAttributeDefinition.java Mon Mar 25 10:18:28 2013
@@ -141,7 +141,7 @@
scriptContext.setAttribute(getId(), new Attribute(getId()), ScriptContext.ENGINE_SCOPE);
log.debug("Attribute definition '{}': adding current attribute resolution context to script context", getId());
- scriptContext.setAttribute("requestContext", resolutionContext, ScriptContext.ENGINE_SCOPE);
+ scriptContext.setAttribute("resolutionContext", resolutionContext, ScriptContext.ENGINE_SCOPE);
final Map<String, Set<AttributeValue>> dependencyAttributes =
PluginDependencySupport.getAllAttributeValues(resolutionContext, getDependencies());
Modified: trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/ad/ScriptedAttributeTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/ad/ScriptedAttributeTest.java?rev=4358&r1=4357&r2=4358&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/ad/ScriptedAttributeTest.java (original)
+++ trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/ad/ScriptedAttributeTest.java Mon Mar 25 10:18:28 2013
@@ -60,7 +60,7 @@
+ ".addValue(\"" + SIMPLE_VALUE + "\");\n";
private static final String TEST_SIMPLE_SCRIPT_USING_PREDEF_ATTRIBUTE =
- "importPackage(Packages.net.shibboleth.idp.attribute.resolver.impl.ad);importPackage(Packages.net.shibboleth.idp.attribute);\n"
+ "importPackage(Packages.net.shibboleth.idp.attribute);\n"
+ "tmp = "
+ TEST_ATTRIBUTE_NAME
+ ".getValues(); val = new StringAttributeValue(\""
@@ -74,16 +74,16 @@
+ TestSources.DEPENDS_ON_ATTRIBUTE_NAME_ATTR + ".iterator();\n" + "while (values.hasNext()) {\n"
+ " val = values.next();\n" + " " + TEST_ATTRIBUTE_NAME + ".addValue(val);\n}\n";
- /** Something to look at the requestContext. */
- private static final String TEST_REQUEST_SCRIPT =
+ /** Something to look at the resolutionContext. */
+ private static final String TEST_RESOLUTION_CONTEXT_SCRIPT =
"importPackage(Packages.net.shibboleth.idp.attribute.resolver.impl.ad);\n"
+ TEST_ATTRIBUTE_NAME
+ " = res = new JscriptAttribute(\""
+ TEST_ATTRIBUTE_NAME
+ "\");\n"
- + "clazloader = requestContext.getClass().getClassLoader();\n"
+ + "clazloader = resolutionContext.getClass().getClassLoader();\n"
+ "claz = clazloader.loadClass(\"net.shibboleth.idp.attribute.resolver.AttributeResolutionContext\");\n"
- + "parent = requestContext.getParent();\n" + "child = parent.getSubcontext(claz);\n"
+ + "parent = resolutionContext.getParent();\n" + "child = parent.getSubcontext(claz);\n"
+ TEST_ATTRIBUTE_NAME + ".addValue(child);\n";
private static final String TEST_FAIL_SCRIPT =
@@ -216,7 +216,7 @@
* @throws ComponentInitializationException only if the test has gone wrong
* @throws ScriptException
*/
- @Test public void testRequestContext() throws ResolutionException, ComponentInitializationException,
+ @Test public void testWithContext() throws ResolutionException, ComponentInitializationException,
ScriptException {
// Set the dependency on the data connector
@@ -226,7 +226,7 @@
final ScriptedAttributeDefinition scripted = new ScriptedAttributeDefinition();
scripted.setId(TEST_ATTRIBUTE_NAME);
[... 6 lines stripped ...]
More information about the commits
mailing list