1 | package gov.va.med.edp.dao.rpc;
|
---|
2 |
|
---|
3 | import junit.framework.TestCase;
|
---|
4 | import gov.va.med.edp.rpc.AbstractVistaLinkConnectionTest;
|
---|
5 |
|
---|
6 | import java.util.HashMap;
|
---|
7 | import java.util.ArrayList;
|
---|
8 | import java.util.List;
|
---|
9 |
|
---|
10 | /**
|
---|
11 | * TODO: document VistaLinkServerPackageVersionDaoTest
|
---|
12 | */
|
---|
13 | public class VistaLinkServerPackageVersionDaoTest extends AbstractVistaLinkConnectionTest {
|
---|
14 | private VistaLinkServerPackageVersionDao dao;
|
---|
15 |
|
---|
16 | protected String getStationNumber() {
|
---|
17 | return "500";
|
---|
18 | }
|
---|
19 |
|
---|
20 | protected void setUp() throws Exception {
|
---|
21 | super.setUp();
|
---|
22 |
|
---|
23 | dao = new VistaLinkServerPackageVersionDao();
|
---|
24 | dao.setConnectionFactoryLocator(mockConnectionFactoryLocator);
|
---|
25 | dao.afterPropertiesSet();
|
---|
26 | }
|
---|
27 |
|
---|
28 | public void testExecuteCommand() {
|
---|
29 | expectVistaLinkAppProxyConnection(VistaLinkBigBoardDao.EDPTRACKING_APPLICATION_USER);
|
---|
30 |
|
---|
31 | HashMap multiple = new HashMap();
|
---|
32 | multiple.put("command", "initTracking");
|
---|
33 |
|
---|
34 | List params = new ArrayList();
|
---|
35 | params.add("0^" + getStationNumber());
|
---|
36 | params.add(multiple);
|
---|
37 | expectRpcAndReturn(VistaLinkBigBoardDao.EDPS_BOARD_CONTEXT, VistaLinkBigBoardDao.EDP_CONTROLLER_BOARD_RPC, params, "<user foo=\"bar\" version=\"0.4-T4-SNAPSHOT\"/>");
|
---|
38 |
|
---|
39 | replay();
|
---|
40 |
|
---|
41 | String result = dao.getServerPackageVersion(getStationNumber());
|
---|
42 | assertEquals("0.4-T4-SNAPSHOT", result);
|
---|
43 |
|
---|
44 | verify();
|
---|
45 | }
|
---|
46 | }
|
---|