[java-shib-attribute] 01/04: JSSH-71 Remove the impact of the DestructableComponent Interface
Codeberg
noreply at shibboleth.net
Fri May 22 15:55:02 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch dev/JSSH-71
in repository java-shib-attribute.
View the commit online:
https://codeberg.org/Shibboleth/java-shib-attribute/commit/d55b128adb94da2a0c58f90f9ced3570d61cfb8e
commit d55b128adb94da2a0c58f90f9ced3570d61cfb8e
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Fri May 22 16:43:19 2026 +0100
JSSH-71 Remove the impact of the DestructableComponent Interface
https://shibboleth.atlassian.net/browse/JSSH-71
Remove all tests on destroyed state
---
.../filter/matcher/impl/ScriptedMatcherTest.java | 26 +++------
.../logic/impl/AbstractComposedMatcherTest.java | 14 +----
.../filter/matcher/logic/impl/AndMatcherTest.java | 8 ---
.../filter/matcher/logic/impl/NotMatcherTest.java | 8 ---
.../filter/matcher/logic/impl/OrMatcherTest.java | 17 ------
.../policyrule/impl/ScriptedPolicyRuleTest.java | 20 -------
.../logic/impl/AbstractComposedPolicyRuleTest.java | 14 +----
.../filter/tests/AttributeFilterPolicyTest.java | 23 ++------
.../tests/AttributeValueFilterPolicyTest.java | 63 ++--------------------
.../resolver/ad/impl/PrescopedAtributeTest.java | 25 ++-------
.../resolver/ad/impl/RegexAtributeTest.java | 27 ++--------
.../resolver/ad/impl/ScopedAttributeTest.java | 25 ++-------
.../ad/impl/StaticAttributeDefinitionTest.java | 27 ----------
.../ad/mapped/impl/MappedAttributeTest.java | 16 ------
.../resolver/dc/impl/StaticDataConnectorTest.java | 10 ----
.../resolver/impl/AttributeResolverImplTest.java | 17 ------
16 files changed, 27 insertions(+), 313 deletions(-)
diff --git a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/impl/ScriptedMatcherTest.java b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/impl/ScriptedMatcherTest.java
index 604800590..0e3c7813d 100644
--- a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/impl/ScriptedMatcherTest.java
+++ b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/impl/ScriptedMatcherTest.java
@@ -14,7 +14,12 @@
package net.shibboleth.idp.attribute.filter.matcher.impl;
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNotSame;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
import java.util.Set;
@@ -28,7 +33,6 @@ import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
import net.shibboleth.shared.annotation.constraint.NonnullBeforeTest;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
import net.shibboleth.shared.component.UnmodifiableComponentException;
import net.shibboleth.shared.scripting.EvaluableScript;
@@ -186,24 +190,6 @@ public class ScriptedMatcherTest extends AbstractMatcherPolicyRuleTest {
} catch (final UnmodifiableComponentException e) {
thrown = true;
}
-
- matcher.destroy();
-
- thrown = false;
- try {
- matcher.initialize();
- } catch (final DestroyedComponentException e) {
- thrown = true;
- }
- assertTrue(thrown, "getMatchingValues after destroy");
-
- thrown = false;
- try {
- matcher.getMatchingValues(attribute, filterContext);
- } catch (final DestroyedComponentException e) {
- thrown = true;
- }
- assertTrue(thrown, "getMatchingValues after destroy");
}
@SuppressWarnings("unlikely-arg-type")
diff --git a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AbstractComposedMatcherTest.java b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AbstractComposedMatcherTest.java
index 5aefb88c9..9c2ba9a6a 100644
--- a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AbstractComposedMatcherTest.java
+++ b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AbstractComposedMatcherTest.java
@@ -33,7 +33,6 @@ import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.AbstractInitializableComponent;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.DestructableComponent;
import net.shibboleth.shared.component.InitializableComponent;
@@ -49,17 +48,6 @@ public class AbstractComposedMatcherTest {
firstList.add(new TestMatcher());
}
- matcher.destroy();
-
- boolean thrown = false;
- try {
- matcher.initialize();
- } catch (final DestroyedComponentException e) {
- thrown = true;
- }
-
- assertTrue(thrown, "Initialize after destroy");
-
for (int i = 0; i < 2; i++) {
firstList.add(new TestMatcher());
}
@@ -67,7 +55,7 @@ public class AbstractComposedMatcherTest {
assertEquals(firstList.size(), matcher.getComposedMatchers().size());
- thrown = false;
+ boolean thrown = false;
try {
matcher.getComposedMatchers().add(new TestMatcher());
} catch (final UnsupportedOperationException e) {
diff --git a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java
index 9b6884719..33be5bb86 100644
--- a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java
+++ b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java
@@ -34,7 +34,6 @@ import net.shibboleth.idp.attribute.filter.matcher.impl.AbstractMatcherPolicyRul
import net.shibboleth.idp.attribute.filter.matcher.impl.MockValuePredicateMatcher;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
import net.shibboleth.shared.logic.PredicateSupport;
@@ -83,13 +82,6 @@ public class AndMatcherTest extends AbstractMatcherPolicyRuleTest {
assertEquals(result.size(), 1);
assertTrue(result.contains(value2));
- matcher.destroy();
- try {
- matcher.getMatchingValues(attribute, filterContext);
- fail();
- } catch (final DestroyedComponentException e) {
- // expect this
- }
}
@Test public void testFails() throws Exception {
diff --git a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/NotMatcherTest.java b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/NotMatcherTest.java
index 7e67474f8..fc62f2f1b 100644
--- a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/NotMatcherTest.java
+++ b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/NotMatcherTest.java
@@ -80,14 +80,6 @@ public class NotMatcherTest extends AbstractMatcherPolicyRuleTest {
assert result != null;
assertEquals(result.size(), 1);
assertTrue(result.contains(value3));
- matcher.destroy();
- try {
- matcher.getMatchingValues(attribute, filterContext);
- fail();
- } catch (final DestroyedComponentException e) {
- // expect this
- }
-
final OrMatcher orMatcher =
OrMatcherTest.newOrMatcher(CollectionSupport.listOf(new MockValuePredicateMatcher(equalValue1()),
new MockValuePredicateMatcher(equalValue2()), new MockValuePredicateMatcher(equalValue3())));
diff --git a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java
index 68cbdb437..72e288b6f 100644
--- a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java
+++ b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java
@@ -36,7 +36,6 @@ import net.shibboleth.idp.attribute.filter.matcher.impl.AbstractMatcherPolicyRul
import net.shibboleth.idp.attribute.filter.matcher.impl.MockValuePredicateMatcher;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
import net.shibboleth.shared.logic.PredicateSupport;
@@ -87,22 +86,6 @@ public class OrMatcherTest extends AbstractMatcherPolicyRuleTest {
assertEquals(result.size(), 2);
assertTrue(result.contains(value2) && result.contains(value1));
- matcher.destroy();
- try {
- matcher.getMatchingValues(attribute, filterContext);
- fail();
- } catch (final DestroyedComponentException e) {
- // expect this
- }
-
- matcher = newOrMatcher(CollectionSupport.emptyList());
- matcher.setId("test");
- try {
- matcher.initialize();
- fail();
- } catch (final ComponentInitializationException ex) {
- // OK
- }
}
@Test public void testRegressionGetValues() throws ComponentInitializationException {
diff --git a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/impl/ScriptedPolicyRuleTest.java b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/impl/ScriptedPolicyRuleTest.java
index bdeb44d88..dd13d14a7 100644
--- a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/impl/ScriptedPolicyRuleTest.java
+++ b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/impl/ScriptedPolicyRuleTest.java
@@ -29,7 +29,6 @@ import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
import net.shibboleth.idp.attribute.filter.matcher.impl.AbstractMatcherPolicyRuleTest;
import net.shibboleth.shared.annotation.constraint.NonnullBeforeTest;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
import net.shibboleth.shared.component.UnmodifiableComponentException;
import net.shibboleth.shared.scripting.EvaluableScript;
@@ -139,25 +138,6 @@ public class ScriptedPolicyRuleTest extends AbstractMatcherPolicyRuleTest {
} catch (final UnmodifiableComponentException e) {
thrown = true;
}
-
- rule.destroy();
-
- thrown = false;
- try {
- rule.initialize();
- } catch (final DestroyedComponentException e) {
- thrown = true;
- }
- assertTrue(thrown, "init after destroy");
-
- thrown = false;
- try {
- rule.matches(filterContext);
- } catch (final DestroyedComponentException e) {
- thrown = true;
- }
- assertTrue(thrown, "matches after destroy");
-
}
@SuppressWarnings({ "unlikely-arg-type", "null" })
diff --git a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AbstractComposedPolicyRuleTest.java b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AbstractComposedPolicyRuleTest.java
index d4cadc8ce..753034995 100644
--- a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AbstractComposedPolicyRuleTest.java
+++ b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AbstractComposedPolicyRuleTest.java
@@ -30,7 +30,6 @@ import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.AbstractInitializableComponent;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.DestructableComponent;
import net.shibboleth.shared.component.InitializableComponent;
import net.shibboleth.shared.primitive.LoggerFactory;
@@ -48,17 +47,6 @@ public class AbstractComposedPolicyRuleTest {
firstList.add(new TestMatcher());
}
- rule.destroy();
-
- boolean thrown = false;
- try {
- rule.initialize();
- } catch (final DestroyedComponentException e) {
- thrown = true;
- }
-
- assertTrue(thrown, "Initialize after destroy");
-
for (int i = 0; i < 2;i++) {
firstList.add(new TestMatcher());
}
@@ -66,7 +54,7 @@ public class AbstractComposedPolicyRuleTest {
assertEquals(firstList.size(), rule.getComposedRules().size());
- thrown = false;
+ boolean thrown = false;
try {
rule.getComposedRules().add(new TestMatcher());
} catch (final UnsupportedOperationException e) {
diff --git a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/tests/AttributeFilterPolicyTest.java b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/tests/AttributeFilterPolicyTest.java
index 76ac856e8..07fefe8f2 100644
--- a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/tests/AttributeFilterPolicyTest.java
+++ b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/tests/AttributeFilterPolicyTest.java
@@ -19,6 +19,10 @@ import java.util.List;
import javax.annotation.Nonnull;
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.IdPAttributeSupport;
import net.shibboleth.idp.attribute.StringAttributeValue;
@@ -34,14 +38,9 @@ import net.shibboleth.shared.annotation.constraint.NonnullBeforeTest;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
import net.shibboleth.shared.logic.ConstraintViolationException;
-import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
/** {@link AttributeFilterPolicy} unit test. */
@SuppressWarnings("javadoc")
public class AttributeFilterPolicyTest {
@@ -122,20 +121,6 @@ public class AttributeFilterPolicyTest {
Assert.assertFalse(policyMatcher.isDestroyed(), "Initialized");
Assert.assertFalse(valueMatcher.isDestroyed(), "Initialized");
- policy.destroy();
- policyMatcher.destroy();
- valueMatcher.destroy();
- Assert.assertTrue(policy.isDestroyed(), "Destroyed");
- Assert.assertTrue(policyMatcher.isDestroyed(), "Destroyed");
- Assert.assertTrue(valueMatcher.isDestroyed(), "Destroyed");
-
- boolean thrown = false;
- try {
- policy.initialize();
- } catch (final DestroyedComponentException e) {
- thrown = true;
- }
- Assert.assertTrue(thrown, "Destroyed");
}
@Test public void testAttributeValuePolicies() throws ComponentInitializationException {
diff --git a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/tests/AttributeValueFilterPolicyTest.java b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/tests/AttributeValueFilterPolicyTest.java
index f4b95bbac..d10448b9d 100644
--- a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/tests/AttributeValueFilterPolicyTest.java
+++ b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/tests/AttributeValueFilterPolicyTest.java
@@ -17,6 +17,9 @@ package net.shibboleth.idp.attribute.filter.tests;
import java.util.Arrays;
import java.util.Collection;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.IdPAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
@@ -28,12 +31,8 @@ import net.shibboleth.idp.attribute.filter.context.AttributeFilterWorkContext;
import net.shibboleth.idp.attribute.filter.testing.MockMatcher;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UnmodifiableComponentException;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
/**
* Tests for {@link AttributeRule}
*/
@@ -62,19 +61,6 @@ public class AttributeValueFilterPolicyTest {
Assert.assertFalse(policy.isDestroyed(), "Initialized - not destroyed");
Assert.assertFalse(matcher.isDestroyed(), "Initialized - not destroyed");
- policy.destroy();
- matcher.destroy();
- Assert.assertTrue(policy.isDestroyed(), "Destroyed");
- Assert.assertTrue(matcher.isDestroyed(), "Destroyed");
-
- boolean thrown = false;
- try {
- policy.initialize();
- } catch (final DestroyedComponentException e) {
- thrown = true;
- }
- Assert.assertTrue(thrown, "initialize after destroy");
-
}
@Test public void testAttributeId() throws ComponentInitializationException {
@@ -112,24 +98,6 @@ public class AttributeValueFilterPolicyTest {
}
Assert.assertEquals(policy.getAttributeId(), "ID", "Get Attribute ID");
- policy.destroy();
-
- try {
- policy.getAttributeId();
- Assert.fail("GetAttributeId after destroy");
- } catch (final DestroyedComponentException e) {
- // expected
- }
-
- policy = new AttributeRule();
- policy.destroy();
-
- try {
- policy.setAttributeId("foo");
- Assert.fail("SetAttributeId after destroy");
- } catch (final DestroyedComponentException e) {
- // expected
- }
}
@@ -163,23 +131,6 @@ public class AttributeValueFilterPolicyTest {
policy.setMatcher(Matcher.MATCHES_ALL);
policy.setIsDenyRule(false);
policy.initialize();
- policy.destroy();
- thrown = false;
- try {
- policy.setMatcher(Matcher.MATCHES_NONE);
- } catch (final UnmodifiableComponentException | DestroyedComponentException e) {
- thrown = true;
- }
- Assert.assertTrue(thrown, "setMatchingPermittedValues after destroy");
-
- thrown = false;
- try {
- policy.getMatcher();
- } catch (DestroyedComponentException e) {
- thrown = true;
- }
- Assert.assertTrue(thrown, "isMatchingPermittedValues after destroy");
-
}
@Test public void testApply() throws ComponentInitializationException, AttributeFilterException {
@@ -234,14 +185,6 @@ public class AttributeValueFilterPolicyTest {
Assert.assertTrue(result.contains(cStringAttributeValue));
Assert.assertNull(workCtx.getPermittedIdPAttributeValues().get(ATTR_NAME));
- policy.destroy();
-
- try {
- policy.apply(attribute1, context);
- Assert.fail("validate after destroy");
- } catch (DestroyedComponentException e) {
- // expected
- }
}
}
\ No newline at end of file
diff --git a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/PrescopedAtributeTest.java b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/PrescopedAtributeTest.java
index ae186cae2..baf03d407 100644
--- a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/PrescopedAtributeTest.java
+++ b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/PrescopedAtributeTest.java
@@ -14,7 +14,10 @@
package net.shibboleth.idp.attribute.resolver.ad.impl;
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
import java.util.ArrayList;
import java.util.Collection;
@@ -42,7 +45,6 @@ import net.shibboleth.idp.attribute.resolver.testing.TestSources;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.collection.LazySet;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
/**
@@ -250,24 +252,5 @@ public class PrescopedAtributeTest {
assertEquals(attrDef.getScopeDelimiter(), DELIMITER);
- attrDef.destroy();
- try {
- attrDef.initialize();
- fail("Init after destroy");
- } catch (final DestroyedComponentException e) {
- // OK
- }
- try {
- attrDef.resolve(new AttributeResolutionContext());
- fail("Resolve after destroy");
- } catch (final DestroyedComponentException e) {
- // OK
- }
- try {
- attrDef.setScopeDelimiter(DELIMITER);
- fail("Set Delimiter after destroy");
- } catch (final DestroyedComponentException e) {
- // OK
- }
}
}
diff --git a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/RegexAtributeTest.java b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/RegexAtributeTest.java
index d33f31e43..7b5fec37a 100644
--- a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/RegexAtributeTest.java
+++ b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/RegexAtributeTest.java
@@ -14,7 +14,10 @@
package net.shibboleth.idp.attribute.resolver.ad.impl;
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
import java.util.ArrayList;
import java.util.Collection;
@@ -42,9 +45,7 @@ import net.shibboleth.idp.attribute.resolver.testing.TestSources;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.collection.LazySet;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
-import net.shibboleth.shared.component.UnmodifiableComponentException;
/**
* Test for regex attribute definitions.
@@ -214,25 +215,5 @@ public class RegexAtributeTest {
attrDef.initialize();
assertEquals(attrDef.getRegularExpression(), TestSources.CONNECTOR_ATTRIBUTE_VALUE_REGEXP_PATTERN);
-
- attrDef.destroy();
- try {
- attrDef.initialize();
- fail("Init after destroy");
- } catch (final DestroyedComponentException e) {
- // OK
- }
- try {
- attrDef.setRegularExpression(TestSources.CONNECTOR_ATTRIBUTE_VALUE_REGEXP_PATTERN);
- fail("setRegExp after destroy");
- } catch (final UnmodifiableComponentException | DestroyedComponentException e) {
- // OK
- }
- try {
- attrDef.resolve(new AttributeResolutionContext());
- fail("Resolve after destroy");
- } catch (final DestroyedComponentException e) {
- // OK
- }
}
}
diff --git a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScopedAttributeTest.java b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScopedAttributeTest.java
index 5a200b2db..472dd9a4e 100644
--- a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScopedAttributeTest.java
+++ b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScopedAttributeTest.java
@@ -14,7 +14,10 @@
package net.shibboleth.idp.attribute.resolver.ad.impl;
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
import java.util.ArrayList;
import java.util.Arrays;
@@ -44,7 +47,6 @@ import net.shibboleth.idp.attribute.resolver.testing.TestSources;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.collection.LazySet;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
/**
@@ -240,25 +242,6 @@ public class ScopedAttributeTest {
assertEquals(attrDef.getScope(), TEST_SCOPE);
- attrDef.destroy();
- try {
- attrDef.initialize();
- fail("Init after destroy");
- } catch (final DestroyedComponentException e) {
- // OK
- }
- try {
- attrDef.resolve(new AttributeResolutionContext());
- fail("Resolve after destroy");
- } catch (final DestroyedComponentException e) {
- // OK
- }
- try {
- attrDef.setScope(TEST_SCOPE);
- fail("Set Delimiter after destroy");
- } catch (final DestroyedComponentException e) {
- // OK
- }
}
}
diff --git a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/StaticAttributeDefinitionTest.java b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/StaticAttributeDefinitionTest.java
index 48251a82c..b675ecebd 100644
--- a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/StaticAttributeDefinitionTest.java
+++ b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/StaticAttributeDefinitionTest.java
@@ -29,7 +29,6 @@ import net.shibboleth.idp.attribute.resolver.ResolutionException;
import net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext;
import net.shibboleth.idp.attribute.resolver.context.AttributeResolverWorkContext;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
import net.shibboleth.shared.component.UnmodifiableComponentException;
@@ -83,32 +82,6 @@ public class StaticAttributeDefinitionTest {
} catch (UnmodifiableComponentException e) {
// OK
}
-
- attrDef.destroy();
-
- try {
- attrDef.initialize();
- fail();
- } catch (DestroyedComponentException e) {
- //OK
- }
-
- try {
- attrDef.setValue(new IdPAttribute("other"));
- fail();
- } catch (UnmodifiableComponentException e) {
- // OK
- } catch (DestroyedComponentException e) {
- //OK
- }
-
- try {
- attrDef.resolve(new AttributeResolutionContext());
- fail();
- } catch (DestroyedComponentException e) {
- // OK
- }
-
}
}
diff --git a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/mapped/impl/MappedAttributeTest.java b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/mapped/impl/MappedAttributeTest.java
index 519a3362f..7e8b0c295 100644
--- a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/mapped/impl/MappedAttributeTest.java
+++ b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/mapped/impl/MappedAttributeTest.java
@@ -37,7 +37,6 @@ import net.shibboleth.idp.attribute.resolver.testing.TestSources;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.collection.LazySet;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
/** Test the mapped attribute type. */
@SuppressWarnings("javadoc")
@@ -75,21 +74,6 @@ public class MappedAttributeTest {
definition.initialize();
- definition.destroy();
- try {
- definition.initialize();
- fail("init a torn down mapper?");
- } catch (final DestroyedComponentException e) {
- // expected this
- }
-
- try {
- definition.resolve(new AttributeResolutionContext());
- fail("resolve a torn down mapper?");
- } catch (final DestroyedComponentException e) {
- // expected this
- }
-
}
@Test public void noAttributeValues() throws Exception {
diff --git a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/impl/StaticDataConnectorTest.java b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/impl/StaticDataConnectorTest.java
index d14d9d3e7..44560ca0f 100644
--- a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/impl/StaticDataConnectorTest.java
+++ b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/impl/StaticDataConnectorTest.java
@@ -34,7 +34,6 @@ import net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext;
import net.shibboleth.idp.attribute.resolver.context.AttributeResolverWorkContext;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
import net.shibboleth.shared.component.UnmodifiableComponentException;
@@ -109,15 +108,6 @@ public class StaticDataConnectorTest {
} catch (UnmodifiableComponentException ex) {
// OK
}
-
- connector.destroy();
-
- try {
- connector.resolve(new AttributeResolutionContext());
- fail();
- } catch (DestroyedComponentException e) {
- //OK
- }
}
}
diff --git a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImplTest.java b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImplTest.java
index a1aa6f847..9eb0c98e4 100644
--- a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImplTest.java
+++ b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImplTest.java
@@ -59,7 +59,6 @@ import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.collection.LazySet;
import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.primitive.LoggerFactory;
/** Test case for {@link AttributeResolverImpl}. */
@@ -96,22 +95,6 @@ public class AttributeResolverImplTest {
assertTrue(resolver.getAttributeDefinitions().containsKey("foo"));
assertEquals(resolver.getDataConnectors().size(), 1);
assertTrue(resolver.getDataConnectors().containsKey("bar"));
-
- attrDef.destroy();
- resolver.destroy();
- dataCon.destroy();
- assertTrue(attrDef.isInitialized());
- assertTrue(attrDef.isDestroyed());
- assertTrue(dataCon.isInitialized());
- assertTrue(dataCon.isDestroyed());
-
- try {
- resolver.initialize();
- fail();
- } catch (final DestroyedComponentException e) {
- // OK
- }
-
}
/**
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list