This is an automated email from the ASF dual-hosted git repository.
cbrisson pushed a commit to branch VELOCITY-952
in repository https://gitbox.apache.org/repos/asf/velocity-engine.git
The following commit(s) were added to refs/heads/VELOCITY-952 by this push:
new c163ef79 Ensure that we are calling the overridden methods
c163ef79 is described below
commit c163ef791b58bd19a9d513d3536c61a0843e4723
Author: Claude Brisson <[email protected]>
AuthorDate: Mon Aug 26 11:18:54 2024 +0200
Ensure that we are calling the overridden methods
---
.../velocity/test/issues/Velocity952TestCase.java | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git
a/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/Velocity952TestCase.java
b/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/Velocity952TestCase.java
index 55dda8ae..8d310309 100755
---
a/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/Velocity952TestCase.java
+++
b/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/Velocity952TestCase.java
@@ -46,13 +46,48 @@ public class Velocity952TestCase extends BaseTestCase
assertEquals(TimeZone.class, getOffset.getDeclaringClass());
}
+ public interface Foo
+ {
+ default String foo() { return "foo"; }
+ }
+
+ public static class Bar implements Foo
+ {
+ @Override
+ public String foo()
+ {
+ return "bar";
+ }
+ }
+
+ public static class Baz extends Bar
+ {
+ @Override
+ public String foo()
+ {
+ return "baz";
+ }
+ }
+
protected void setUpContext(VelocityContext context)
{
context.put("tz", TimeZone.getDefault());
+ context.put("bar", new Bar());
+ context.put("baz", new Baz());
}
public void testEnd2End()
{
assertEvalEquals("3600000", "$tz.getOffset(1)");
}
+
+ public void testBar()
+ {
+ assertEvalEquals("bar", "$bar.foo()");
+ }
+
+ public void testBaz()
+ {
+ assertEvalEquals("baz", "$baz.foo()");
+ }
}