summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/builder/src
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-09-14 15:57:34 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-09-14 15:57:34 +0000
commitf83e5aa85897c109caee089ad5cf06237b860f01 (patch)
treec80f00ac68fa9a2e5110dfcb5f67806ff27b1eee /sca-java-2.x/trunk/modules/builder/src
parentc7c5fe2e6091d5e1abacd7d65ff94051327d88cd (diff)
TUSCANY-3631 - re-enable the test basic auth test case. The issue was that the appliesTo processing wasn't removing policy sets from Endpoints/EndpointReferences it was just removing them from the Service/Reference models. The Endpoint/EndpointReference versions are used to drive the runtime processing.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@996966 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/builder/src')
-rw-r--r--sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
index 132cfa5656..1c958f70d4 100644
--- a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
+++ b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
@@ -96,18 +96,22 @@ public class PolicyAppliesToBuilderImpl extends PolicyAttachmentBuilderImpl {
for (ComponentService componentService : component.getServices()) {
for (Endpoint ep : componentService.getEndpoints()) {
- checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)ep.getService(), ep.getService().getPolicySets());
+ List<PolicySet> policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)ep.getService(), ep.getService().getPolicySets());
+ ep.getPolicySets().removeAll(policySetsToRemove);
if (ep.getBinding() instanceof PolicySubject) {
- checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)ep.getBinding(), ((PolicySubject)ep.getBinding()).getPolicySets());
+ policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)ep.getBinding(), ((PolicySubject)ep.getBinding()).getPolicySets());
+ ep.getPolicySets().removeAll(policySetsToRemove);
}
}
}
for (ComponentReference componentReference : component.getReferences()) {
for (EndpointReference epr : componentReference.getEndpointReferences()) {
- checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)epr.getReference(), epr.getReference().getPolicySets());
+ List<PolicySet> policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)epr.getReference(), epr.getReference().getPolicySets());
+ epr.getPolicySets().removeAll(policySetsToRemove);
if (epr.getBinding() instanceof PolicySubject) {
- checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)epr.getBinding(), ((PolicySubject)epr.getBinding()).getPolicySets());
+ policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)epr.getBinding(), ((PolicySubject)epr.getBinding()).getPolicySets());
+ epr.getPolicySets().removeAll(policySetsToRemove);
}
}
}
@@ -133,7 +137,7 @@ public class PolicyAppliesToBuilderImpl extends PolicyAttachmentBuilderImpl {
* @return
* @throws Exception
*/
- private void checkAppliesToSubject(Document document, Map<PolicySet, List<PolicySubject>> appliesToSubjects, Composite composite, PolicySubject policySubject, List<PolicySet> policySets) throws Exception {
+ private List<PolicySet> checkAppliesToSubject(Document document, Map<PolicySet, List<PolicySubject>> appliesToSubjects, Composite composite, PolicySubject policySubject, List<PolicySet> policySets) throws Exception {
List<PolicySet> policySetsToRemove = new ArrayList<PolicySet>();
for (PolicySet policySet : policySets){
@@ -170,6 +174,7 @@ public class PolicyAppliesToBuilderImpl extends PolicyAttachmentBuilderImpl {
}
- policySets.removeAll(policySetsToRemove);
+ policySets.removeAll(policySetsToRemove);
+ return policySetsToRemove;
}
}