diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-21 19:52:18 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-21 19:52:18 +0000 |
commit | 3f90e370637330c034affe6cb89922bcdf265f77 (patch) | |
tree | 954bc4760a2a76c57c8005f08547002febb2b23b /java/sca/modules/policy-xml | |
parent | 99f810244bf4d4eb18f6c3830b5026ad35f205ea (diff) |
Change the name from parent to qualifiableIntent for Intent model
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@746573 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/policy-xml')
2 files changed, 9 insertions, 5 deletions
diff --git a/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java b/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java index ffbceeaa12..d87921dbbf 100644 --- a/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java +++ b/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java @@ -149,7 +149,7 @@ public class IntentProcessor extends BaseStAXArtifactProcessor implements StAXAr intent.setDefaultQualifiedIntent(qualified); } intent.getQualifiedIntents().add(qualified); - qualified.setParent(intent); + qualified.setQualifiableIntent(intent); current = qualified; } break; @@ -171,6 +171,10 @@ public class IntentProcessor extends BaseStAXArtifactProcessor implements StAXAr reader.next(); } } + // REVIEW: [rfeng] What's going to happen if there is only one qualified intent + if (intent.getQualifiedIntents().size() == 1) { + intent.setDefaultQualifiedIntent(intent.getQualifiedIntents().get(0)); + } return intent; } @@ -277,7 +281,7 @@ public class IntentProcessor extends BaseStAXArtifactProcessor implements StAXAr private void resolveQualifiedIntent(Intent qualifed, ModelResolver resolver) throws ContributionResolveException { if (qualifed != null) { //resolve the qualifiable intent - Intent parent = qualifed.getParent(); + Intent parent = qualifed.getQualifiableIntent(); if (parent == null) { return; } @@ -288,7 +292,7 @@ public class IntentProcessor extends BaseStAXArtifactProcessor implements StAXAr // Lets try to resolve them first. if (!resolved.isUnresolved() || resolved != qualifed) { - qualifed.setParent(resolved); + qualifed.setQualifiableIntent(resolved); } else { error("QualifiableIntentNotFound", resolver, parent, qualifed); //throw new ContributionResolveException("Qualifiable Intent - " + qualifiableIntent diff --git a/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java b/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java index 0e35d31f00..34e7e44939 100644 --- a/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java +++ b/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java @@ -203,7 +203,7 @@ public class ReadDocumentTestCase { assertTrue(intentTable.get(confidentiality_transport) instanceof Intent); Intent qualifiedIntent = (Intent)intentTable.get(new QName(namespace, "confidentiality.transport")); assertNull(qualifiedIntent.getDescription()); - assertNotNull(qualifiedIntent.getParent().getDescription()); + assertNotNull(qualifiedIntent.getQualifiableIntent().getDescription()); PolicySet secureReliablePolicySet = policySetTable.get(secureReliablePolicy); PolicySet secureMessagingPolicySet = policySetTable.get(secureMessagingPolicies); @@ -253,7 +253,7 @@ public class ReadDocumentTestCase { //testing if policy intents have been linked have property been linked up assertNotNull(profileIntent.getRequiredIntents().get(0).getDescription()); - assertNotNull(qualifiedIntent.getParent().getDescription()); + assertNotNull(qualifiedIntent.getQualifiableIntent().getDescription()); assertEquals(secureReliablePolicySet.getProvidedIntents().get(1).getName(), integrity); assertNotNull(secureReliablePolicySet.getProvidedIntents().get(1).getDescription()); |