01: /*
02: * User: Michael Rettig
03: * Date: Sep 20, 2002
04: * Time: 8:28:26 PM
05: */
06: package net.sourceforge.jaxor.parser.tests;
07:
08: import junit.framework.TestCase;
09: import net.sourceforge.jaxor.parser.Param;
10: import net.sourceforge.jaxor.parser.ParamList;
11:
12: public class ParamListTest extends TestCase {
13:
14: private ParamList _list;
15:
16: protected void setUp() throws Exception {
17: _list = new ParamList();
18: }
19:
20: public void testToStringMethod() {
21: _list.add(create());
22: assertEquals("final type name", _list.getMethodParams());
23: }
24:
25: public void testToStringMethodWithMultipleParams() {
26: _list.add(create());
27: _list.add(create());
28: assertEquals("final type name, final type name", _list
29: .getMethodParams());
30: }
31:
32: public void testEmptyMethod() {
33: assertEquals("new Object[]{}", _list.toArray());
34: }
35:
36: public void testToArrayMethod() {
37: _list.add(create());
38: assertEquals("new Object[]{name}", _list.toArray());
39: }
40:
41: public void testToMultiArrayMethod() {
42: _list.add(create());
43: _list.add(create());
44: assertEquals("new Object[]{name, name}", _list.toArray());
45: }
46:
47: private Param create() {
48: Param param = new Param();
49: param.setName("name");
50: param.setType("type");
51: return param;
52: }
53: }
|