diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly')
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Compatibility.java (renamed from sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/ConversationSequence.java) | 14 | ||||
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java | 13 | ||||
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java | 195 | ||||
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java | 12 | ||||
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java | 101 | ||||
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java | 16 | ||||
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly/src/test/java/org/apache/tuscany/sca/interfacedef/impl/ContractCompatibilityTestCase.java | 19 |
7 files changed, 187 insertions, 183 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/ConversationSequence.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Compatibility.java index 247a432330..e05a05476a 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/ConversationSequence.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Compatibility.java @@ -16,14 +16,14 @@ * specific language governing permissions and limitations * under the License. */ - package org.apache.tuscany.sca.interfacedef; /** - * Enum of the Conversation Sequence values. - * - * @version $Rev$ $Date$ + * Types of compatibility */ -public enum ConversationSequence { - CONVERSATION_NONE, CONVERSATION_START, CONVERSATION_CONTINUE, CONVERSATION_END -} +public enum Compatibility { + SUPERSET, // The source is a superset of the target + SUBSET, // The source is a subset of the target + MUTUAL, // The source is the same set as the target + INCOMPATIBLE // The source is not compatible with the target +}
\ No newline at end of file diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java index cab7057b57..a0659bd68f 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java @@ -57,19 +57,6 @@ public interface Interface extends Cloneable, PolicySubject { */ boolean isRemotableSet(); - // FIXME: [rfeng] We need to re-consider the conversational as an intent - /** - * Test if the interface is conversational - * @return - */ - boolean isConversational(); - - /** - * Set whether the interface is conversational - * @param conversational - */ - void setConversational(boolean conversational); - /** * Returns the operations defined on this interface. * diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java index 8dfeb29833..7a917e5560 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java @@ -26,64 +26,9 @@ package org.apache.tuscany.sca.interfacedef; */ public interface InterfaceContractMapper { /** - * Check the compatibility of the source and the target interface contracts. - * <p> - * A wire may only connect a source to a target if the target implements an - * interface that is compatible with the interface required by the source. - * The source and the target are compatible if: <p/> - * <ol> - * <li>the source interface and the target interface MUST either both be - * remotable or they are both local - * <li>the methods on the target interface MUST be the same as or be a - * superset of the methods in the interface specified on the source - * <li>compatibility for the individual method is defined as compatibility - * of the signature, that is method name, input types, and output types MUST - * BE the same. - * <li>the order of the input and output types also MUST BE the same. - * <li>the set of Faults and Exceptions expected by the source MUST BE the - * same or be a superset of those specified by the service. - * <li>other specified attributes of the two interfaces MUST match, - * including Scope and Callback interface - * </ol> - * <p/> - * <p> - * This relationship implies that the source contract is a subset of the target - * contract - ie all the operations of the source must be present in the target, but - * the target can in principle contain additional operations not present in the - * source - * </p> - * <p> - * Please note this test is not symmetric: the success of isCompatible(A, B) - * does NOT imply isCompatible(B, A) - * * @param source The source interface contract * @param target The target interface contract - * @return true if the source contract can be supported by the target - * contract - */ - boolean isCompatible(InterfaceContract source, InterfaceContract target); - - /** - * Check that two interface contracts are equal. The contracts are equal if the two contracts have the - * same set of operations, with each operation having the same signature. - * @param source - the source contract - * @param target - the target contract - * @return - */ - boolean isEqual(InterfaceContract source, InterfaceContract target); - - /** - * Check that two interfaces are equal. The interfaces are equal if the two interfaces have the - * same set of operations, with each operation having the same signature. - * @param source an interface - * @param target a second interface - * @return true if the two interfaces are equal, otherwise return false - */ - public boolean isEqual(Interface source, Interface target); - - /** - * @param source - * @param target + * @param compatibility The compatibility style * @param ignoreCallback * @param silent * @return @@ -91,6 +36,7 @@ public interface InterfaceContractMapper { */ boolean checkCompatibility(InterfaceContract source, InterfaceContract target, + Compatibility compatibility, boolean ignoreCallback, boolean silent) throws IncompatibleInterfaceContractException; @@ -106,34 +52,149 @@ public interface InterfaceContractMapper { * * @param source The source data type * @param target The target data type - * @return + * @param passByValue A flag to indicate how the compatibility is checked + * <ul> + * <li>true: Check the two types as compatible "by-value" (can be copied) + * <li>false: Check the two types as compatible "by-reference" (can be assigned) + * </ul> + * @return true if the source data type is the same or subtype of the target data type */ - boolean isCompatible(DataType<?> source, DataType<?> target, boolean remotable); + boolean isCompatible(DataType<?> source, DataType<?> target, boolean passByValue); /** - * Check if source operation is compatible with the target operation + * Check if source operation is compatible with the target operation. A source operation is + * compatible with the target operation means the following: + * + * <ol> + * <li>compatibility for the two operations is defined as compatibility + * of the signature, i.e., the operation name, the input types, and the output types are the same + * + * <li>the order of the input and output types of the source operation is the same as the order of + * the input and output types for the corresponding target operation + * <li>the set of Faults and Exceptions expected by the source operation is the same as or is + * a SUPERSET of the set of Faults and Exceptions specified by the corresponding target operation + * </ol> + * + * Simply speaking, any request from the source operation can be processed by the target operation and + * the normal response or fault/exception from the target operation can be handled by the source operation. + * + * Please note this compatibility check is NOT symmetric. * * @param source The source operation * @param target The target operation + * @param compatibilityType TODO * @return true if the source operation is compatible with the target * operation */ - boolean isCompatible(Operation source, Operation target, boolean remotable); + boolean isCompatible(Operation source, Operation target, Compatibility compatibilityType); /** - * @param source - * @param target - * @return + * An interface A is a Compatible Subset of a second interface B if and only if all of points 1 through 6 + * in the following list apply: + * <ol> + * <li>interfaces A and B are either both remotable or else both local + * <li>the set of operations in interface A is the same as or is a subset of the set of operations in + * interface B + * <li>compatibility for individual operations of the interfaces A and B is defined as compatibility + * of the signature, i.e., the operation name, the input types, and the output types are the same + * <li>the order of the input and output types for each operation in interface A is the same as the + * order of the input and output types for the corresponding operation in interface B + * <li>the set of Faults and Exceptions expected by each operation in interface A is the same as or is + * a superset of the set of Faults and Exceptions specified by the corresponding operation in interface B + * <li>for checking the compatibility of 2 remotable interfaces which are in different interface + * languages, both are mapped to WSDL 1.1 (if not already WSDL 1.1) and compatibility checking is done + * between the WSDL 1.1 mapped interfaces.<br> + * For checking the compatibility of 2 local interfaces which are in different interface languages, the + * method of checking compatibility is defined by the specifications which define those interface types, + * which must define mapping rules for the 2 interface types concerned. + * + * </ol> + * + * <b>The callback interfaces are not considered her.</b> + * + * @param source The source interface + * @param target The target interface + * @return true if the source interface is a compatible subset of the target interface + */ + boolean isCompatibleSubset(Interface source, Interface target); + + /** + * An interface A is a Compatible Subset of a second interface B if and only if all of points 1 through 7 + * in the following list apply: + * <ol> + * <li>interfaces A and B are either both remotable or else both local + * <li>the set of operations in interface A is the same as or is a subset of the set of operations in + * interface B + * <li>compatibility for individual operations of the interfaces A and B is defined as compatibility + * of the signature, i.e., the operation name, the input types, and the output types are the same + * <li>the order of the input and output types for each operation in interface A is the same as the + * order of the input and output types for the corresponding operation in interface B + * <li>the set of Faults and Exceptions expected by each operation in interface A is the same as or is + * a superset of the set of Faults and Exceptions specified by the corresponding operation in interface B + * <li>for checking the compatibility of 2 remotable interfaces which are in different interface + * languages, both are mapped to WSDL 1.1 (if not already WSDL 1.1) and compatibility checking is done + * between the WSDL 1.1 mapped interfaces.<br> + * For checking the compatibility of 2 local interfaces which are in different interface languages, the + * method of checking compatibility is defined by the specifications which define those interface types, + * which must define mapping rules for the 2 interface types concerned. + * <li>if either interface A or interface B declares a callback interface then both interface + * A and interface B declare callback interfaces and the callback interface declared on interface B is a + * compatible subset of the callback interface declared on interface A, according to points 1 through 6 + * above + * </ol> + * + * @param source The source interface contract + * @param target The target interface contract + * @return true if the source interface contract is a compatible subset of the target interface contract */ - boolean isCompatible(Interface source, Interface target); + boolean isCompatibleSubset(InterfaceContract source, InterfaceContract target); /** - * Map the source operation to a compatible operation in the target - * interface + * Check that two interfaces are mutually compatible. The interfaces are mutually compatible if the two + * interfaces have the same set of operations, with each operation having the same signature (name, input + * types, output types and fault/exception types). + * + * @param source an interface + * @param target a second interface + * @return true if the two interfaces are mutually compatible, otherwise return false + */ + public boolean isMutuallyCompatible(Interface source, Interface target); + + /** + * An interface A is Compatible with a second interface B if and only if all of points 1 through 7 in the + * following list apply:<p> + * <ol> + * <li>interfaces A and B are either both remotable or else both local + * <li>the set of operations in interface A is the same as the set of operations in interface B + * <li>compatibility for individual operations of the interfaces A and B is defined as compatibility + * of the signature, i.e., the operation name, the input types, and the output types are the same + * <li>the order of the input and output types for each operation in interface A is the same as the + * order of the input and output types for the corresponding operation in interface B + * <li>the set of Faults and Exceptions expected by each operation in interface A is the + * same as the set of Faults and Exceptions specified by the corresponding operation in interface B + * <li>for checking the compatibility of 2 remotable interfaces which are in different interface + * languages, both are mapped to WSDL 1.1 (if not already WSDL 1.1) and compatibility checking is done + * between the WSDL 1.1 mapped interfaces. + * <br>For checking the compatibility of 2 local interfaces which are in different interface languages, + * the method of checking compatibility is defined by the specifications which define those interface types, + * which must define mapping rules for the 2 interface types concerned. + * <li>if either interface A or interface B declares a callback interface then both interface + * A and interface B declare callback interfaces and the callback interface declared on interface A is + * compatible with the callback interface declared on interface B, according to points 1 through 6 above + * + * @param source - the source interface contract + * @param target - the target interface contract + * @return true if the source and target interface contracts are mutually compatible + */ + boolean isMutuallyCompatible(InterfaceContract source, InterfaceContract target); + + /** + * Map the source operation to a compatible operation in the target interface * * @param target The target interface * @param source The source operation - * @return A compatible operation + * @return A compatible operation if the target interface is compatible superset of the source interface */ Operation map(Interface target, Operation source); + } diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java index 55f00b82c8..773c7be0f7 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java @@ -111,18 +111,6 @@ public interface Operation extends Cloneable, PolicySubject { void setInterface(Interface interfaze); /** - * Get the sequence of the conversation - * @return - */ - ConversationSequence getConversationSequence(); - - /** - * Set the sequence of conversation for the operation - * @param sequence - */ - void setConversationSequence(ConversationSequence sequence); - - /** * Indicate if the operation is non-blocking * @return */ 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 03a39bc840..dc1c0c0a4e 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 @@ -21,6 +21,7 @@ package org.apache.tuscany.sca.interfacedef.impl; import java.util.List; +import org.apache.tuscany.sca.interfacedef.Compatibility; import org.apache.tuscany.sca.interfacedef.DataType; import org.apache.tuscany.sca.interfacedef.IncompatibleInterfaceContractException; import org.apache.tuscany.sca.interfacedef.Interface; @@ -33,24 +34,24 @@ import org.apache.tuscany.sca.interfacedef.Operation; */ public class InterfaceContractMapperImpl implements InterfaceContractMapper { - public boolean isCompatible(DataType source, DataType target, boolean remotable) { + public boolean isCompatible(DataType source, DataType target, boolean passByValue) { if (source == target) { return true; } - if (!remotable) { + if (!passByValue) { if (source == null || target == null) { return false; } // For local case return target.getPhysical().isAssignableFrom(source.getPhysical()); } else { - // FIXME: How to test if two remotable data type is compatible? - // return target.getLogical().equals(source.getLogical()); + // FIXME: [rfeng] How to test if two remotable data type is compatible? + // We will need to understand the different typing system used by the databindings + // We should probably delegate to some extensions here return true; } } - /** * Check that two interface contracts are equal. The contracts are equal if the two contracts have the @@ -60,21 +61,21 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { * @param target * @return */ - public boolean isEqual(InterfaceContract source, InterfaceContract target) { - // Are the forward interfaces equal? - if( isEqual( source.getInterface(), target.getInterface()) ) { - // Is there a Callback interface? - if( source.getCallbackInterface() == null && target.getCallbackInterface() == null ) { - return true; - } else { - if( isEqual( source.getCallbackInterface(), target.getCallbackInterface()) ) { - return true; - } // end if - } // end if - } // end if - return false; + public boolean isMutuallyCompatible(InterfaceContract source, InterfaceContract target) { + // Are the forward interfaces equal? + if (isMutuallyCompatible(source.getInterface(), target.getInterface())) { + // Is there a Callback interface? + if (source.getCallbackInterface() == null && target.getCallbackInterface() == null) { + return true; + } else { + if (isMutuallyCompatible(source.getCallbackInterface(), target.getCallbackInterface())) { + return true; + } // end if + } // end if + } // end if + return false; } // end method isEqual - + /** * Check that two interfaces are equal. The interfaces are equal if the two interfaces have the * same set of operations, with each operation having the same signature. @@ -82,13 +83,13 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { * @param target * @return */ - public boolean isEqual(Interface source, Interface target) { + public boolean isMutuallyCompatible(Interface source, Interface target) { if (source == target) { // Shortcut for performance return true; } // end if if (source == null || target == null) { - return false; + return false; } // end if if (source.isDynamic() || target.isDynamic()) { @@ -98,26 +99,23 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { if (source.isRemotable() != target.isRemotable()) { return false; } - if (source.isConversational() != target.isConversational()) { + if (source.getOperations().size() != target.getOperations().size()) { return false; } - if( source.getOperations().size() != target.getOperations().size() ) { - return false; - } for (Operation operation : source.getOperations()) { Operation targetOperation = getOperation(target.getOperations(), operation.getName()); if (targetOperation == null) { return false; } - if (!isCompatible(operation, targetOperation, source.isRemotable())) { + if (!isCompatible(operation, targetOperation, Compatibility.SUBSET)) { return false; } } return true; } // end method isEqual - public boolean isCompatible(Operation source, Operation target, boolean remotable) { + public boolean isCompatible(Operation source, Operation target, Compatibility compatibilityType) { if (source == target) { return true; } @@ -135,6 +133,8 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { return false; } + boolean remotable = source.getInterface().isRemotable(); + // if (source.getInterface().isRemotable()) { // return true; // } @@ -212,22 +212,23 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { public boolean checkCompatibility(InterfaceContract source, InterfaceContract target, + Compatibility compatibility, boolean ignoreCallback, boolean silent) throws IncompatibleInterfaceContractException { if (source == target) { // Shortcut for performance return true; } - - if (source == null || target == null){ + + if (source == null || target == null) { return false; } - - if (source.getInterface() == target.getInterface()){ + + if (source.getInterface() == target.getInterface()) { return ignoreCallback || isCallbackCompatible(source, target, silent); } - - if (source.getInterface() == null || target.getInterface() == null){ + + if (source.getInterface() == null || target.getInterface() == null) { return false; } @@ -242,13 +243,6 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { return false; } } - if (source.getInterface().isConversational() != target.getInterface().isConversational()) { - if (!silent) { - throw new IncompatibleInterfaceContractException("Interaction scopes do not match", source, target); - } else { - return false; - } - } for (Operation operation : source.getInterface().getOperations()) { Operation targetOperation = map(target.getInterface(), operation); @@ -261,7 +255,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { } if (!source.getInterface().isRemotable()) { // FIXME: for remotable operation, only compare name for now - if (!isCompatible(operation, targetOperation, false)) { + if (!isCompatible(operation, targetOperation, Compatibility.SUBSET)) { if (!silent) { throw new IncompatibleInterfaceContractException("Target operations are not compatible", source, target); @@ -275,8 +269,8 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { return ignoreCallback || isCallbackCompatible(source, target, silent); } - - protected boolean isCallbackCompatible(InterfaceContract source, InterfaceContract target, boolean silent) throws IncompatibleInterfaceContractException { + protected boolean isCallbackCompatible(InterfaceContract source, InterfaceContract target, boolean silent) + throws IncompatibleInterfaceContractException { if (source.getCallbackInterface() == null && target.getCallbackInterface() == null) { return true; } @@ -288,14 +282,6 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { } } - if (source.getCallbackInterface().isConversational() != target.getCallbackInterface().isConversational()) { - if (!silent) { - throw new IncompatibleInterfaceContractException("Interaction scopes do not match", source, target); - } else { - return false; - } - } - for (Operation operation : source.getCallbackInterface().getOperations()) { Operation targetOperation = getOperation(target.getCallbackInterface().getOperations(), operation.getName()); @@ -322,7 +308,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { return true; } - public boolean isCompatible(Interface source, Interface target) { + public boolean isCompatibleSubset(Interface source, Interface target) { if (source == target) { // Shortcut for performance return true; @@ -338,25 +324,22 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { if (source.isRemotable() != target.isRemotable()) { return false; } - if (source.isConversational() != target.isConversational()) { - return false; - } for (Operation operation : source.getOperations()) { Operation targetOperation = getOperation(target.getOperations(), operation.getName()); if (targetOperation == null) { return false; } - if (!isCompatible(operation, targetOperation, source.isRemotable())) { + if (!isCompatible(operation, targetOperation, Compatibility.SUBSET)) { return false; } } return true; } - public boolean isCompatible(InterfaceContract source, InterfaceContract target) { + public boolean isCompatibleSubset(InterfaceContract source, InterfaceContract target) { try { - return checkCompatibility(source, target, false, false); + return checkCompatibility(source, target, Compatibility.SUBSET, false, false); } catch (IncompatibleInterfaceContractException e) { return false; } @@ -379,7 +362,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { return null; } else { for (Operation op : target.getOperations()) { - if (isCompatible(source, op, target.isRemotable())) { + if (isCompatible(source, op, Compatibility.SUBSET)) { return op; } } diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java index 26144e92cb..48eb9e42d4 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java @@ -26,7 +26,6 @@ import java.util.concurrent.ConcurrentHashMap; import javax.xml.namespace.QName; -import org.apache.tuscany.sca.interfacedef.ConversationSequence; import org.apache.tuscany.sca.interfacedef.DataType; import org.apache.tuscany.sca.interfacedef.Interface; import org.apache.tuscany.sca.interfacedef.Operation; @@ -49,7 +48,6 @@ public class OperationImpl implements Operation { private DataType<List<DataType>> inputType; private List<DataType> faultTypes; private Interface interfaze; - private ConversationSequence conversationSequence = ConversationSequence.CONVERSATION_NONE; private boolean nonBlocking; private boolean wrapperStyle; private WrapperInfo wrapper; @@ -146,20 +144,6 @@ public class OperationImpl implements Operation { } /** - * @return the conversationSequence - */ - public ConversationSequence getConversationSequence() { - return conversationSequence; - } - - /** - * @param conversationSequence the conversationSequence to set - */ - public void setConversationSequence(ConversationSequence conversationSequence) { - this.conversationSequence = conversationSequence; - } - - /** * @return the nonBlocking */ public boolean isNonBlocking() { diff --git a/sca-java-2.x/trunk/modules/assembly/src/test/java/org/apache/tuscany/sca/interfacedef/impl/ContractCompatibilityTestCase.java b/sca-java-2.x/trunk/modules/assembly/src/test/java/org/apache/tuscany/sca/interfacedef/impl/ContractCompatibilityTestCase.java index acdaae799e..603d393e5c 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/test/java/org/apache/tuscany/sca/interfacedef/impl/ContractCompatibilityTestCase.java +++ b/sca-java-2.x/trunk/modules/assembly/src/test/java/org/apache/tuscany/sca/interfacedef/impl/ContractCompatibilityTestCase.java @@ -29,6 +29,7 @@ import java.util.Map; import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.interfacedef.Compatibility; import org.apache.tuscany.sca.interfacedef.DataType; import org.apache.tuscany.sca.interfacedef.IncompatibleInterfaceContractException; import org.apache.tuscany.sca.interfacedef.Interface; @@ -58,7 +59,7 @@ public class ContractCompatibilityTestCase { public void testNoOperation() throws Exception { InterfaceContract source = new MockContract("FooContract"); InterfaceContract target = new MockContract("FooContract"); - mapper.checkCompatibility(source, target, false, false); + mapper.checkCompatibility(source, target, Compatibility.SUBSET, false, false); } @Test @@ -73,7 +74,7 @@ public class ContractCompatibilityTestCase { Map<String, Operation> targetOperations = new HashMap<String, Operation>(); targetOperations.put("op1", opSource2); target.getInterface().getOperations().addAll(targetOperations.values()); - mapper.checkCompatibility(source, target, false, false); + mapper.checkCompatibility(source, target, Compatibility.SUBSET, false, false); } @Test @@ -89,7 +90,7 @@ public class ContractCompatibilityTestCase { targetOperations.put("op2", opSource2); target.getInterface().getOperations().addAll(targetOperations.values()); try { - mapper.checkCompatibility(source, target, false, false); + mapper.checkCompatibility(source, target, Compatibility.SUBSET, false, false); fail(); } catch (IncompatibleInterfaceContractException e) { // expected @@ -118,7 +119,7 @@ public class ContractCompatibilityTestCase { Map<String, Operation> targetOperations = new HashMap<String, Operation>(); targetOperations.put("op1", opTarget); target.getInterface().getOperations().addAll(targetOperations.values()); - mapper.checkCompatibility(source, target, false, false); + mapper.checkCompatibility(source, target, Compatibility.SUBSET, false, false); } @Test @@ -144,7 +145,7 @@ public class ContractCompatibilityTestCase { targetOperations.put("op1", opTarget); target.getInterface().getOperations().addAll(targetOperations.values()); try { - mapper.checkCompatibility(source, target, false, false); + mapper.checkCompatibility(source, target, Compatibility.SUBSET, false, false); fail(); } catch (IncompatibleInterfaceContractException e) { // expected @@ -202,7 +203,7 @@ public class ContractCompatibilityTestCase { Map<String, Operation> targetOperations = new HashMap<String, Operation>(); targetOperations.put("op1", opTarget); target.getInterface().getOperations().addAll(targetOperations.values()); - mapper.checkCompatibility(source, target, false, false); + mapper.checkCompatibility(source, target, Compatibility.SUBSET, false, false); } /** @@ -250,7 +251,7 @@ public class ContractCompatibilityTestCase { targetOperations.put("op1", opTarget); target.getInterface().getOperations().addAll(targetOperations.values()); try { - mapper.checkCompatibility(source, target, false, false); + mapper.checkCompatibility(source, target, Compatibility.SUBSET, false, false); fail(); } catch (IncompatibleInterfaceContractException e) { // expected @@ -279,7 +280,7 @@ public class ContractCompatibilityTestCase { Map<String, Operation> targetOperations = new HashMap<String, Operation>(); targetOperations.put("op1", opTarget); target.getInterface().getOperations().addAll(targetOperations.values()); - mapper.checkCompatibility(source, target, false, false); + mapper.checkCompatibility(source, target, Compatibility.SUBSET, false, false); } @Test @@ -299,7 +300,7 @@ public class ContractCompatibilityTestCase { Map<String, Operation> targetOperations = new HashMap<String, Operation>(); targetOperations.put("op1", opTarget); target.getInterface().getOperations().addAll(targetOperations.values()); - mapper.checkCompatibility(source, target, false, false); + mapper.checkCompatibility(source, target, Compatibility.SUBSET, false, false); } /** |