[java-identity-provider COMMIT] in /trunk/idp-attribute-resolver-impl/src/test: java/net/shibboleth/idp/attribute/res...
noreply at shibboleth.net
noreply at shibboleth.net
Thu Mar 28 06:13:00 EDT 2013
Author: rdw
Date: Thu Mar 28 06:12:59 2013
New Revision: 4365
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4365&view=rev
Log:
Exbed the test scripts.
Added:
trunk/idp-attribute-resolver-impl/src/test/resources/data/net/shibboleth/idp/attribute/resolver/impl/ad/
trunk/idp-attribute-resolver-impl/src/test/resources/data/net/shibboleth/idp/attribute/resolver/impl/ad/attributes.script
trunk/idp-attribute-resolver-impl/src/test/resources/data/net/shibboleth/idp/attribute/resolver/impl/ad/context.script
trunk/idp-attribute-resolver-impl/src/test/resources/data/net/shibboleth/idp/attribute/resolver/impl/ad/fails.script
trunk/idp-attribute-resolver-impl/src/test/resources/data/net/shibboleth/idp/attribute/resolver/impl/ad/simple.script
trunk/idp-attribute-resolver-impl/src/test/resources/data/net/shibboleth/idp/attribute/resolver/impl/ad/simpleWithPredef.script
Modified:
trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/ad/ScriptedAttributeTest.java
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=4365&r1=4364&r2=4365&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 Thu Mar 28 06:12:59 2013
@@ -17,6 +17,7 @@
package net.shibboleth.idp.attribute.resolver.impl.ad;
+import java.io.IOException;
import java.util.Collection;
import java.util.Set;
@@ -34,12 +35,13 @@
import net.shibboleth.idp.attribute.resolver.impl.TestSources;
import net.shibboleth.utilities.java.support.collection.LazySet;
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
+import net.shibboleth.utilities.java.support.primitive.StringSupport;
import net.shibboleth.utilities.java.support.scripting.EvaluableScript;
import org.testng.Assert;
import org.testng.annotations.Test;
-/** test for {@link net.shibboleth.idp.attribute.resolver.impl.ScriptedAttribute}. */
+/** test for {@link net.shibboleth.idp.attribute.resolver.impl.ad.ScriptedAttribute}. */
public class ScriptedAttributeTest {
/** The name. */
@@ -51,43 +53,10 @@
/** Simple result. */
private static final String SIMPLE_VALUE = "simple";
- /**
- * A simple script to set a constant value.
- */
- private static final String TEST_SIMPLE_SCRIPT =
- "importPackage(Packages.net.shibboleth.idp.attribute.resolver.impl.ad);\n" + TEST_ATTRIBUTE_NAME
- + " = res = new JscriptAttribute(\"" + TEST_ATTRIBUTE_NAME + "\");\n" + TEST_ATTRIBUTE_NAME
- + ".addValue(\"" + SIMPLE_VALUE + "\");\n";
-
- private static final String TEST_SIMPLE_SCRIPT_USING_PREDEF_ATTRIBUTE =
- "importPackage(Packages.net.shibboleth.idp.attribute);\n"
- + "tmp = "
- + TEST_ATTRIBUTE_NAME
- + ".getValues(); val = new StringAttributeValue(\""
- + SIMPLE_VALUE
- + "\");tmp.add(val);" + TEST_ATTRIBUTE_NAME + ".setValues(tmp);";
-
- /** A simple script to set a value based on input values. */
- private static final String TEST_ATTRIBUTES_SCRIPT =
- "importPackage(Packages.net.shibboleth.idp.attribute.resolver.impl.ad);\n" + TEST_ATTRIBUTE_NAME
- + " = res = new JscriptAttribute(\"" + TEST_ATTRIBUTE_NAME + "\");\n" + "values = "
- + 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 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 = resolutionContext.getClass().getClassLoader();\n"
- + "claz = clazloader.loadClass(\"net.shibboleth.idp.attribute.resolver.AttributeResolutionContext\");\n"
- + "parent = resolutionContext.getParent();\n" + "child = parent.getSubcontext(claz);\n"
- + TEST_ATTRIBUTE_NAME + ".addValue(child);\n";
-
- private static final String TEST_FAIL_SCRIPT =
- "importPackage(Packages.net.shibboleth.idp.attribute.resolver.impl.ad);\n" + " flibby.nonexistant();";
[... 110 lines stripped ...]
More information about the commits
mailing list