summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/sca/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilDuplicateRemotableTestCase.java64
1 files changed, 31 insertions, 33 deletions
diff --git a/java/sca/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilDuplicateRemotableTestCase.java b/java/sca/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilDuplicateRemotableTestCase.java
index c0b1443207..0879d00b12 100644
--- a/java/sca/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilDuplicateRemotableTestCase.java
+++ b/java/sca/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilDuplicateRemotableTestCase.java
@@ -97,7 +97,7 @@ public class JavaInterfaceUtilDuplicateRemotableTestCase {
assertEquals("getTime", method.getName());
assertEquals(1, method.getParameterTypes().length);
assertEquals(String.class, method.getParameterTypes()[0]);
- }
+ }
/**
* Test to get the getTime(int) method from the GMTTimeService
@@ -126,7 +126,6 @@ public class JavaInterfaceUtilDuplicateRemotableTestCase {
assertEquals(Integer.TYPE, method.getParameterTypes()[0]);
}
-
/**
* Test to get the getTime() method from the LocalTimeService on the
* TimeServiceImpl class
@@ -160,37 +159,6 @@ public class JavaInterfaceUtilDuplicateRemotableTestCase {
}
/**
- * Creates a new operation with the specified name and parameter types
- *
- * @param name The name of the operation
- * @param operationInterface The interface to which the operation belongs
- * @param parameterTypes The types of the parameters for this operation
- * @return An operation with the specified name and parameter types
- */
- private static Operation newOperation(String name, Class<?> operationInterface, Class<?>... parameterTypes) {
- // Create and set the operation name
- Operation operation = new OperationImpl();
- operation.setName(name);
-
- // Make the operation remotable
- Interface iface = new InterfaceImpl();
- iface.setRemotable(true);
- operation.setInterface(iface);
-
- // Construct the parameters
- List<DataType> types = new ArrayList<DataType>();
- DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
- for (Class<?> parameterType : parameterTypes) {
- DataType type = new DataTypeImpl<Class>(parameterType, Object.class);
- types.add(type);
- }
- operation.setInputType(inputType);
-
- // Return the created operation
- return operation;
- }
-
- /**
* Test case that validates that a @Remotable interface with Overloaded operations
* is detected.
*
@@ -219,7 +187,37 @@ public class JavaInterfaceUtilDuplicateRemotableTestCase {
}
}
+ /**
+ * Creates a new operation with the specified name and parameter types
+ *
+ * @param name The name of the operation
+ * @param operationInterface The interface to which the operation belongs
+ * @param parameterTypes The types of the parameters for this operation
+ * @return An operation with the specified name and parameter types
+ */
+ private static Operation newOperation(String name, Class<?> operationInterface, Class<?>... parameterTypes) {
+ // Create and set the operation name
+ Operation operation = new OperationImpl();
+ operation.setName(name);
+ // Make the operation remotable
+ Interface iface = new InterfaceImpl();
+ iface.setRemotable(true);
+ operation.setInterface(iface);
+
+ // Construct the parameters
+ List<DataType> types = new ArrayList<DataType>();
+ DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
+ for (Class<?> parameterType : parameterTypes) {
+ DataType type = new DataTypeImpl<Class>(parameterType, Object.class);
+ types.add(type);
+ }
+ operation.setInputType(inputType);
+
+ // Return the created operation
+ return operation;
+ }
+
/**
* Sample @Remotable interface that has an overloaded operation which is not
* allowed according to the SCA Assembly Specification.