[1240] | 1 | package gov.va.med.edp.rpc;
|
---|
| 2 |
|
---|
| 3 | import junit.framework.TestCase;
|
---|
| 4 |
|
---|
| 5 | public class VistaLinkDaoSupportTest extends TestCase {
|
---|
| 6 |
|
---|
| 7 | public void testDefaultConstruction() {
|
---|
| 8 | VistaLinkDaoSupport dao = new VistaLinkDaoSupport();
|
---|
| 9 | dao.afterPropertiesSet();
|
---|
| 10 | assertNotNull(dao.getConnectionFactoryLocator());
|
---|
| 11 | assertNotNull(dao.getRpcTemplate());
|
---|
| 12 | assertTrue(dao.getConnectionFactoryLocator() instanceof InstitutionMappingConnectionFactoryLocator);
|
---|
| 13 | assertSame(dao.getConnectionFactoryLocator(), dao.getRpcTemplate().getConnectionFactoryLocator());
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | public void testSetConnectionFactoryLocator() {
|
---|
| 17 | VistaLinkDaoSupport dao = new VistaLinkDaoSupport();
|
---|
| 18 | dao.setConnectionFactoryLocator(new MockConnectionFactoryLocator());
|
---|
| 19 | dao.afterPropertiesSet();
|
---|
| 20 | assertNotNull(dao.getConnectionFactoryLocator());
|
---|
| 21 | assertNotNull(dao.getRpcTemplate());
|
---|
| 22 | assertTrue(dao.getConnectionFactoryLocator() instanceof MockConnectionFactoryLocator);
|
---|
| 23 | assertSame(dao.getConnectionFactoryLocator(), dao.getRpcTemplate().getConnectionFactoryLocator());
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | public void testSetRpcTemplate() {
|
---|
| 27 | VistaLinkRpcTemplate t = new VistaLinkRpcTemplate(new MockConnectionFactoryLocator());
|
---|
| 28 | VistaLinkDaoSupport dao = new VistaLinkDaoSupport();
|
---|
| 29 | dao.setRpcTemplate(t);
|
---|
| 30 | dao.afterPropertiesSet();
|
---|
| 31 | assertSame(t, dao.getRpcTemplate());
|
---|
| 32 | assertSame(t.getConnectionFactoryLocator(), dao.getConnectionFactoryLocator());
|
---|
| 33 | }
|
---|
| 34 | }
|
---|