geirm 2002/07/24 15:02:46
Modified: src/java/org/apache/velocity/test Tag: VEL_1_3_BRANCH
IntrospectorTestCase3.java
Log:
Added test for overload with primitive args. :/
Revision Changes Path
No revision
No revision
1.1.2.3 +27 -2
jakarta-velocity/src/java/org/apache/velocity/test/Attic/IntrospectorTestCase3.java
Index: IntrospectorTestCase3.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/Attic/IntrospectorTestCase3.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- IntrospectorTestCase3.java 14 Jul 2002 22:04:09 -0000 1.1.2.2
+++ IntrospectorTestCase3.java 24 Jul 2002 22:02:46 -0000 1.1.2.3
@@ -100,6 +100,8 @@
*/
Object[] listIntInt = { new ArrayList(), new Integer(1), new Integer(2) };
+ Object[] listLongList = { new ArrayList(), new Long(1), new ArrayList() };
+ Object[] listLongInt = { new ArrayList(), new Long(1), new Integer(2) };
Object[] intInt = { new Integer(1), new Integer(2) };
Object[] longInt = { new Long(1), new Integer(2) };
Object[] longLong = { new Long(1), new Long(2) };
@@ -122,11 +124,22 @@
assertTrue(result.equals("ll"));
+ /*
+ * test overloading with primitives
+ */
+
method = RuntimeSingleton.getIntrospector().getMethod(
MethodProvider.class, "ll", longLong);
result = (String) method.invoke(mp, longLong);
assertTrue(result.equals("ll"));
+
+ method = RuntimeSingleton.getIntrospector().getMethod(
+ MethodProvider.class, "lll", listLongList);
+ result = (String) method.invoke(mp, listLongList);
+
+ assertTrue(result.equals("lll"));
+
}
public static class MethodProvider
@@ -141,10 +154,22 @@
return "lii";
}
- public String lll(List s, long p, long d)
+ public String lll(List s, long p, List d)
{
return "lll";
}
+
+
+ public String lll(List s, long p, int d)
+ {
+ return "lli";
+ }
+
+ public String lll(List s, long p)
+ {
+ return "Listl";
+ }
+
public String ll(long p, long d)
{
return "ll";
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>