01: package com.mockrunner.test.jdbc;
02:
03: import java.util.HashMap;
04:
05: import junit.framework.TestCase;
06:
07: import com.mockrunner.jdbc.ParameterSets;
08:
09: public class ParameterSetsTest extends TestCase {
10: public void testParameterSets() {
11: ParameterSets sets = new ParameterSets("testsql");
12: assertEquals("testsql", sets.getSQLStatement());
13: assertEquals(0, sets.getNumberParameterSets());
14: assertNull(sets.getParameterSet(0));
15: HashMap parameters = new HashMap();
16: sets.addParameterSet(parameters);
17: assertEquals(1, sets.getNumberParameterSets());
18: assertSame(parameters, sets.getParameterSet(0));
19: assertNull(sets.getParameterSet(1));
20: sets.addParameterSet(parameters);
21: assertEquals(2, sets.getNumberParameterSets());
22: assertSame(parameters, sets.getParameterSet(1));
23: assertNull(sets.getParameterSet(2));
24: }
25: }
|