Author: kelvingoodson
Date: Tue Jul 27 10:24:41 2010
New Revision: 979633
URL: http://svn.apache.org/viewvc?rev=979633&view=rev
Log:
improve pd info for interface contract mapping and fix up failing ASM tests due
to previous error message output changes
Modified:
tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java
tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
Modified:
tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java?rev=979633&r1=979632&r2=979633&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
(original)
+++
tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
Tue Jul 27 10:24:41 2010
@@ -216,6 +216,7 @@ public class InterfaceContractMapperImpl
source.getName() +
" target = " +
target.getName());
+ audit.appendSeperator();
}
return false;
}
@@ -226,6 +227,7 @@ public class InterfaceContractMapperImpl
source.getName() +
" target = " +
target.getName());
+ audit.appendSeperator();
}
return false;
}
@@ -236,6 +238,7 @@ public class InterfaceContractMapperImpl
source.isNonBlocking() +
" target = " +
target.isNonBlocking());
+ audit.appendSeperator();
}
return false;
}
@@ -276,6 +279,7 @@ public class InterfaceContractMapperImpl
if (!isCompatible(targetOutputType, sourceOutputType, passByValue,
audit)) {
if (audit != null){
audit.append(" output types");
+ audit.appendSeperator();
}
return false;
}
@@ -283,6 +287,7 @@ public class InterfaceContractMapperImpl
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
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
if (!found) {
if (audit != null){
audit.append("Fault types incompatible");
+ audit.appendSeperator();
}
return false;
}
@@ -377,8 +384,10 @@ public class InterfaceContractMapperImpl
.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;
}
Modified:
tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java?rev=979633&r1=979632&r2=979633&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java
(original)
+++
tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java
Tue Jul 27 10:24:41 2010
@@ -25,13 +25,19 @@ package org.apache.tuscany.sca.interface
*
*/
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();
Modified:
tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java?rev=979633&r1=979632&r2=979633&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
(original)
+++
tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
Tue Jul 27 10:24:41 2010
@@ -497,6 +497,7 @@ public class EndpointReferenceBinderImpl
" " +
epIntent.toString() +
" ");
+ matchAudit.appendSeperator();
return false;
}
}
@@ -550,6 +551,7 @@ public class EndpointReferenceBinderImpl
(noEndpointReferencePolicies) &&
(noEndpointPolicies)) {
matchAudit.append("Match because there are no intents or policies
");
+ matchAudit.appendSeperator();
return true;
}
@@ -620,6 +622,7 @@ public class EndpointReferenceBinderImpl
// 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
// 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
// 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
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
" and " +
epLanguage +
" ");
+ matchAudit.appendSeperator();
return false;
}
@@ -702,10 +710,12 @@ public class EndpointReferenceBinderImpl
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
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
// 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
matchAudit.append("Match because the interface contract mapper
succeeded ");
}
+ matchAudit.appendSeperator();
+
return match;
}