}
@Test
public void getArgsWithObjectParameters() {
ActionSignature sig = new BaseActionSignature(1, "testAction", new Class[] { String.class, Integer.class,
Double.class, Date.class, SomeUserDefinedType.class, Long.class }, new Annotation[][] { { createParam("p1") },
{ createParam("p2") }, { createParam("p3") }, { createParam("p4") }, { createParam("p5") },
{ createParam("p6") } }, new Annotation[]{});
SomeUserDefinedType userDefinedType = new SomeUserDefinedType();
Map<String, Object> parameterMap = new HashMap<String, Object>();
parameterMap.put("p1", "hello");
parameterMap.put("p2", 123);
parameterMap.put("p3", 1.23);
parameterMap.put("p4", Date.valueOf("2011-03-01"));
parameterMap.put("p5", userDefinedType);
parameterMap.put("p6", 123456L);
Class<?>[] paramTypes = sig.parameterTypes();
assertEquals(6, paramTypes.length);
assertEquals(String.class, paramTypes[0]);
assertEquals(Integer.class, paramTypes[1]);
assertEquals(Double.class, paramTypes[2]);
assertEquals(Date.class, paramTypes[3]);
assertEquals(SomeUserDefinedType.class, paramTypes[4]);
assertEquals(Long.class, paramTypes[5]);
Object[] args = sig.getArgs(parameterMap, null);
assertEquals(6, args.length);
assertEquals("hello", args[0]);
assertEquals(123, args[1]);
assertEquals(1.23, args[2]);
assertEquals(Date.valueOf("2011-03-01"), args[3]);