01: package com.mockrunner.test;
02:
03: import com.mockrunner.base.BaseTestCase;
04: import com.mockrunner.mock.connector.cci.ConnectorMockObjectFactory;
05: import com.mockrunner.mock.ejb.EJBMockObjectFactory;
06: import com.mockrunner.mock.jdbc.JDBCMockObjectFactory;
07: import com.mockrunner.mock.jms.JMSMockObjectFactory;
08: import com.mockrunner.mock.web.ActionMockObjectFactory;
09: import com.mockrunner.mock.web.WebMockObjectFactory;
10:
11: public class ExtendedBaseTestCaseTest extends BaseTestCase {
12: private ActionMockObjectFactory actionMockFactory;
13: private JDBCMockObjectFactory jdbcMockFactory;
14: private EJBMockObjectFactory ejbMockFactory;
15: private ConnectorMockObjectFactory connectorMockFactory;
16: private JMSMockObjectFactory jmsMockFactory;
17:
18: protected void setUp() throws Exception {
19: super .setUp();
20: actionMockFactory = new ActionMockObjectFactory() {
21: };
22: jdbcMockFactory = new JDBCMockObjectFactory() {
23: };
24: ejbMockFactory = new EJBMockObjectFactory() {
25: };
26: connectorMockFactory = new ConnectorMockObjectFactory() {
27: };
28: jmsMockFactory = new JMSMockObjectFactory() {
29: };
30: }
31:
32: protected void tearDown() throws Exception {
33: super .tearDown();
34: actionMockFactory = null;
35: jdbcMockFactory = null;
36: ejbMockFactory = null;
37: connectorMockFactory = null;
38: jmsMockFactory = null;
39: }
40:
41: public void testGetFactories() {
42: assertSame(actionMockFactory, getActionMockObjectFactory());
43: assertSame(actionMockFactory, getWebMockObjectFactory());
44: assertSame(jdbcMockFactory, getJDBCMockObjectFactory());
45: assertSame(ejbMockFactory, getEJBMockObjectFactory());
46: assertSame(connectorMockFactory,
47: getConnectorMockObjectFactory());
48: assertSame(jmsMockFactory, getJMSMockObjectFactory());
49: }
50:
51: protected ActionMockObjectFactory createActionMockObjectFactory() {
52: return actionMockFactory;
53: }
54:
55: protected ConnectorMockObjectFactory createConnectorMockObjectFactory() {
56: return connectorMockFactory;
57: }
58:
59: protected EJBMockObjectFactory createEJBMockObjectFactory() {
60: return ejbMockFactory;
61: }
62:
63: protected JDBCMockObjectFactory createJDBCMockObjectFactory() {
64: return jdbcMockFactory;
65: }
66:
67: protected JMSMockObjectFactory createJMSMockObjectFactory() {
68: return jmsMockFactory;
69: }
70:
71: protected WebMockObjectFactory createWebMockObjectFactory() {
72: return actionMockFactory;
73: }
74: }
|