summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkelvingoodson <kelvingoodson@13f79535-47bb-0310-9956-ffa450edef68>2010-07-27 10:24:41 +0000
committerkelvingoodson <kelvingoodson@13f79535-47bb-0310-9956-ffa450edef68>2010-07-27 10:24:41 +0000
commit6bcc94ef5e610abb085097ea59f7ba671c03933b (patch)
treed7fda9a1b8927f4a78ac5c2f7105b647d30070b2
parente1ac47593af2b7e377aaffe3183d4d29658a6e88 (diff)
improve pd info for interface contract mapping and fix up failing ASM tests due to previous error message output changes
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@979633 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java9
-rw-r--r--sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java8
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java14
3 files changed, 30 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
index f0f46dd41e..7af12bb7d0 100644
--- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
+++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
@@ -216,6 +216,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
source.getName() +
" target = " +
target.getName());
+ audit.appendSeperator();
}
return false;
}
@@ -226,6 +227,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
source.getName() +
" target = " +
target.getName());
+ audit.appendSeperator();
}
return false;
}
@@ -236,6 +238,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
source.isNonBlocking() +
" target = " +
target.isNonBlocking());
+ audit.appendSeperator();
}
return false;
}
@@ -276,6 +279,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
if (!isCompatible(targetOutputType, sourceOutputType, passByValue, audit)) {
if (audit != null){
audit.append(" output types");
+ audit.appendSeperator();
}
return false;
}
@@ -283,6 +287,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
if (sourceInputType.size() != targetInputType.size()) {
if (audit != null){
audit.append("different number of input types");
+ audit.appendSeperator();
}
return false;
}
@@ -292,6 +297,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
if (!isCompatible(sourceInputType.get(i), targetInputType.get(i), passByValue, audit)) {
if (audit != null){
audit.append(" input types");
+ audit.appendSeperator();
}
return false;
}
@@ -313,6 +319,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
if (!found) {
if (audit != null){
audit.append("Fault types incompatible");
+ audit.appendSeperator();
}
return false;
}
@@ -377,8 +384,10 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
.isRemotable()) {
if (!silent) {
audit.append("Remotable settings do not match: "+ source + "," + target); // TODO see if serialization is sufficient
+ audit.appendSeperator();
throw new IncompatibleInterfaceContractException(
"Remotable settings do not match", source, target);
+
} else {
return false;
}
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java
index 0830860409..343d369fdb 100644
--- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java
+++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java
@@ -25,13 +25,19 @@ package org.apache.tuscany.sca.interfacedef.util;
*
*/
public class Audit {
+
+ public static final String seperator = "|||";
private StringBuffer buf;
public Audit() {
this.buf = new StringBuffer();
}
public void append(String str) {
- buf.append("||| " + str);
+ buf.append(str);
+ }
+
+ public void appendSeperator() {
+ buf.append(seperator);
}
public String toString() {
return buf.toString();
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
index 9bcdfa03ac..dfeebe2ec6 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
@@ -497,6 +497,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
" " +
epIntent.toString() +
" ");
+ matchAudit.appendSeperator();
return false;
}
}
@@ -550,6 +551,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
(noEndpointReferencePolicies) &&
(noEndpointPolicies)) {
matchAudit.append("Match because there are no intents or policies ");
+ matchAudit.appendSeperator();
return true;
}
@@ -620,6 +622,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
// if there are unresolved intents the service and reference don't match
if (eprIntents.size() > 0){
matchAudit.append("No match because there are unresolved intents " + eprIntents.toString() + " ");
+ matchAudit.appendSeperator();
return false;
}
@@ -627,6 +630,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
// they match
if (noEndpointPolicies && noEndpointReferencePolicies){
matchAudit.append("Match because the intents are resolved and there are no policy sets ");
+ matchAudit.appendSeperator();
return true;
}
@@ -634,11 +638,13 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
// the don't match
if (noEndpointPolicies && !noEndpointReferencePolicies) {
matchAudit.append("No match because there are policy sets at the endpoint reference but not at the endpoint ");
+ matchAudit.appendSeperator();
return false;
}
if (!noEndpointPolicies && noEndpointReferencePolicies){
matchAudit.append("No match because there are policy sets at the endpoint but not at the endpoint reference ");
+ matchAudit.appendSeperator();
return false;
}
@@ -648,6 +654,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
Set<PolicySet> servicePolicySet = new HashSet<PolicySet>(endpoint.getPolicySets());
if(referencePolicySet.equals(servicePolicySet)){
matchAudit.append("Match because the policy sets on both sides are eactly the same ");
+ matchAudit.appendSeperator();
return true;
}
@@ -680,6 +687,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
" and " +
epLanguage +
" ");
+ matchAudit.appendSeperator();
return false;
}
@@ -702,10 +710,12 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
if (!match){
matchAudit.append("No match because the language specific matching failed ");
+ matchAudit.appendSeperator();
endpointReference.getPolicySets().clear();
endpointReference.getPolicySets().addAll(originalPolicySets);
} else {
matchAudit.append("Match because the language specific matching succeeded ");
+ matchAudit.appendSeperator();
}
return match;
@@ -768,6 +778,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
if (endpointReference.getReference().getInterfaceContract() == null){
matchAudit.append("Match because there is no interface contract on the reference ");
+ matchAudit.appendSeperator();
return true;
}
@@ -779,6 +790,7 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
// live with this for the case where there is no central matching of references
// to services. Any errors will be detected when the message flows.
matchAudit.append("Match because the endpoint is remote and we don't have a copy of it's interface contract ");
+ matchAudit.appendSeperator();
return true;
}
@@ -792,6 +804,8 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
matchAudit.append("Match because the interface contract mapper succeeded ");
}
+ matchAudit.appendSeperator();
+
return match;
}