diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-08-25 11:45:53 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-08-25 11:45:53 +0000 |
commit | e3dda746338a080bc89ded6e782e9e374a64bf90 (patch) | |
tree | edf07943dbc7cee0f49840427b7e6abb82749860 /sca-java-2.x/trunk/modules/assembly/src | |
parent | ff5a82cbb87463dc07adfe04c851ad47b36e9b23 (diff) |
Add auditing to callback compatibility testing
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1161519 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly/src')
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java | 14 |
1 files changed, 10 insertions, 4 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 17b41c30a2..7e51e38aaf 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 @@ -388,7 +388,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { if (source.getInterface() == target.getInterface()) { return ignoreCallback - || isCallbackCompatible(source, target, silent); + || isCallbackCompatible(source, target, silent, audit); } if (source.getInterface() == null || target.getInterface() == null) { @@ -398,7 +398,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { if (source.getInterface().isDynamic() || target.getInterface().isDynamic()) { return ignoreCallback - || isCallbackCompatible(source, target, silent); + || isCallbackCompatible(source, target, silent, audit); } if (source.getInterface().isRemotable() != target.getInterface() @@ -448,7 +448,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { } } - return ignoreCallback || isCallbackCompatible(source, target, silent); + return ignoreCallback || isCallbackCompatible(source, target, silent, audit); } /* @@ -476,13 +476,15 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { - protected boolean isCallbackCompatible(InterfaceContract source, InterfaceContract target, boolean silent) + protected boolean isCallbackCompatible(InterfaceContract source, InterfaceContract target, boolean silent, Audit audit) throws IncompatibleInterfaceContractException { if (source.getCallbackInterface() == null && target.getCallbackInterface() == null) { return true; } if (source.getCallbackInterface() == null || target.getCallbackInterface() == null) { if (!silent) { + audit.append("Callback interface doesn't match as one of the callback interfaces is null"); + audit.appendSeperator(); throw new IncompatibleInterfaceContractException("Callback interface doesn't match as one of the callback interfaces is null", source, target); } else { return false; @@ -494,6 +496,8 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { getOperation(target.getCallbackInterface().getOperations(), operation.getName()); if (targetOperation == null) { if (!silent) { + audit.append("Callback operation not found on target " + operation.getName()); + audit.appendSeperator(); throw new IncompatibleInterfaceContractException("Callback operation not found on target", source, target, null, targetOperation); } else { @@ -504,6 +508,8 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { // FIXME: for remotable operation, only compare name for now if (!operation.equals(targetOperation)) { if (!silent) { + audit.append("Target callback operation is not compatible " + operation.getName()); + audit.appendSeperator(); throw new IncompatibleInterfaceContractException("Target callback operation is not compatible", source, target, operation, targetOperation); } else { |