/** * Create a new {@link Invoker} instance for invoking a Service in the test ServiceDomain. * @param serviceName The target Service name. Can be a serialized {@link QName}. Can also * include the operation name e.g. "OrderManagementService.createOrder". * @return The invoker instance. */ public Invoker newInvoker(String serviceName) { return newInvoker(createQName(serviceName)); }
/** * Create a new {@link Invoker} instance for invoking a Service in the test ServiceDomain. * @param serviceName The target Service name. Can be a serialized {@link QName}. Can also * include the operation name e.g. "OrderManagementService.createOrder". * @return The invoker instance. */ public Invoker newInvoker(String serviceName) { return newInvoker(createQName(serviceName)); }
private void setInvokers(Class<?> clazz) throws IllegalAccessException { if (Object.class.equals(clazz) || clazz == null) { return; } Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { if (field.getType() == Invoker.class) { ServiceOperation serviceOp = field.getAnnotation(ServiceOperation.class); if (serviceOp == null) { Assert.fail("Invoker property '" + field.getName() + "' on test class '" + _testInstance.getClass().getName() + "' needs to be annotated with a @ServiceOperation."); } Invoker invoker = _testKit.newInvoker(serviceOp.value()); if (invoker == null) { Assert.fail("Invoker property '" + field.getName() + "' on test class '" + _testInstance.getClass().getName() + "' contains an a @ServiceOperation defining an unknown Service Operation value '" + serviceOp.value() + "'."); } setValue(field, invoker); } } setInvokers(clazz.getSuperclass()); } }
private void setInvokers(Class<?> clazz) throws IllegalAccessException { if (Object.class.equals(clazz) || clazz == null) { return; } Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { if (field.getType() == Invoker.class) { ServiceOperation serviceOp = field.getAnnotation(ServiceOperation.class); if (serviceOp == null) { Assert.fail("Invoker property '" + field.getName() + "' on test class '" + _testInstance.getClass().getName() + "' needs to be annotated with a @ServiceOperation."); } Invoker invoker = _testKit.newInvoker(serviceOp.value()); if (invoker == null) { Assert.fail("Invoker property '" + field.getName() + "' on test class '" + _testInstance.getClass().getName() + "' contains an a @ServiceOperation defining an unknown Service Operation value '" + serviceOp.value() + "'."); } setValue(field, invoker); } } setInvokers(clazz.getSuperclass()); } }