This is an automated email from the ASF dual-hosted git repository. gk pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/turbine-core.git
commit 306fff6b7e7221fd73b1f223054aefe2756a9a26 Author: Georg Kallidis <[email protected]> AuthorDate: Thu Nov 16 16:05:13 2023 +0100 Ignore eclipse annotation generated folders. Disable (comment) experimental settings in test classes. Adjust changes.xml. --- .gitignore | 2 ++ src/changes/changes.xml | 7 +++---- .../actions/VelocityActionWithExtendedServiceInjection.java | 11 +++++++---- .../apache/turbine/services/ServiceWithServiceInjection.java | 8 ++++---- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 6a849b47..74171835 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ logs *.ser *torque.usersettings.properties +/.apt_generated/ +/.apt_generated_tests/ diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 9db804c2..cddcf8fd 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -26,10 +26,9 @@ <body> <release version="5.2-SNAPSHOT" date="in Git"> <action type="add" dev="gk"> - Provide mechanism to allow auto loading of Turbine (and Fulcrum) services. - If a "known" service is extending FieldAnnotatedTurbineBaseService and MethodAnnotatedTurbineBaseService this service could declare in fields and methods more Turbine services - either by annotating them with @TurbineService or autoload a service, which has class level annotation @TurbineService, if itself is annotated as TurbineService. - This allows for delegated calls to Turbine services. + Provide mechanism to allow auto loading of Turbine (and Fulcrum) services. If a "known" service is extending FieldAnnotatedTurbineBaseService or + MethodAnnotatedTurbineBaseService it could declare fields and methods with more Turbine annotations. + Examples are annotating a service with @TurbineService or autoload a service, which has class level annotation @TurbineService, if the callingclass itself is TurbineService annotated. </action> <action type="add" dev="gk"> New service DateTimeFormatterService and tool DateTimeFormatterTool, which allow date time formatting with locale and zone configuration. diff --git a/src/test/org/apache/turbine/modules/actions/VelocityActionWithExtendedServiceInjection.java b/src/test/org/apache/turbine/modules/actions/VelocityActionWithExtendedServiceInjection.java index 75a16f47..9aec0ba3 100644 --- a/src/test/org/apache/turbine/modules/actions/VelocityActionWithExtendedServiceInjection.java +++ b/src/test/org/apache/turbine/modules/actions/VelocityActionWithExtendedServiceInjection.java @@ -30,16 +30,19 @@ import org.apache.turbine.services.ServiceWithServiceInjection; import org.apache.velocity.context.Context; /** - * Annnotating even an assembler as TurbineService on class level we could omit annotations for fields if class is a Turbine service. + * Annnotating even an assembler as TurbineService on class level we could omit + * annotations for fields if class is a Turbine service. + * + * This would be quite experimental. */ -@TurbineService +//@TurbineService public class VelocityActionWithExtendedServiceInjection extends VelocityAction { private static Log log = LogFactory.getLog(VelocityActionWithExtendedServiceInjection.class); // Test for class level SERVICE_NAME in ServiceWithServiceInjection - // Annotation could be omitted as the class is annotated - // @TurbineService + // Annotation could be omitted as the class is annotated could be omitted + @TurbineService private ServiceWithServiceInjection serviceWithServiceInjection; diff --git a/src/test/org/apache/turbine/services/ServiceWithServiceInjection.java b/src/test/org/apache/turbine/services/ServiceWithServiceInjection.java index 5ab0b64d..0b801ea4 100644 --- a/src/test/org/apache/turbine/services/ServiceWithServiceInjection.java +++ b/src/test/org/apache/turbine/services/ServiceWithServiceInjection.java @@ -36,11 +36,11 @@ import org.apache.turbine.annotation.TurbineService; @TurbineService( ServiceWithServiceInjection.SERVICE_NAME ) public class ServiceWithServiceInjection extends MethodAnnotatedTurbineBaseService implements Initializable /* ServiceWithService */ { - - String ROLE = ServiceWithServiceInjection.class.getName(); - + // will be checked before ROLE static final String SERVICE_NAME = "ServiceWithService"; + String ROLE = ServiceWithServiceInjection.class.getName(); + private static Log log = LogFactory.getLog(ServiceWithServiceInjection.class); // Test for implicit SERVICE_NAME @@ -53,7 +53,7 @@ public class ServiceWithServiceInjection extends MethodAnnotatedTurbineBaseServi // Test for method injected class level SERVICE_NAME // Annotation could be omitted as the class is annotated - // @TurbineService + @TurbineService public void setServiceWithServiceInjection2(ServiceWithServiceInjection2 serviceWithServiceInjection) { serviceWithServiceInjection2 = serviceWithServiceInjection; }
