001 package com.mockrunner.connector; 002 003 import java.util.List; 004 005 import com.mockrunner.base.BaseTestCase; 006 007 /** 008 * Delegator for {@link com.mockrunner.connector.ConnectorTestModule}. You can 009 * subclass this adapter or use {@link com.mockrunner.connector.ConnectorTestModule} 010 * directly (so your test case can use another base class). 011 * This adapter extends {@link com.mockrunner.base.BaseTestCase}. 012 * It can be used if you want to use several modules in conjunction. 013 * <b>This class is generated from the {@link com.mockrunner.connector.ConnectorTestModule} 014 * and should not be edited directly</b>. 015 */ 016 public abstract class ConnectorTestCaseAdapter extends BaseTestCase 017 { 018 private ConnectorTestModule connectorTestModule; 019 020 public ConnectorTestCaseAdapter() 021 { 022 023 } 024 025 public ConnectorTestCaseAdapter(String name) 026 { 027 super(name); 028 } 029 030 protected void tearDown() throws Exception 031 { 032 super.tearDown(); 033 connectorTestModule = null; 034 } 035 036 /** 037 * Creates the {@link com.mockrunner.connector.ConnectorTestModule}. If you 038 * overwrite this method, you must call <code>super.setUp()</code>. 039 */ 040 protected void setUp() throws Exception 041 { 042 super.setUp(); 043 connectorTestModule = createConnectorTestModule(getConnectorMockObjectFactory()); 044 } 045 046 /** 047 * Gets the {@link com.mockrunner.connector.ConnectorTestModule}. 048 * @return the {@link com.mockrunner.connector.ConnectorTestModule} 049 */ 050 protected ConnectorTestModule getConnectorTestModule() 051 { 052 return connectorTestModule; 053 } 054 055 /** 056 * Sets the {@link com.mockrunner.connector.ConnectorTestModule}. 057 * @param connectorTestModule the {@link com.mockrunner.connector.ConnectorTestModule} 058 */ 059 protected void setConnectorTestModule(ConnectorTestModule connectorTestModule) 060 { 061 this.connectorTestModule = connectorTestModule; 062 } 063 064 /** 065 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#verifyConnectionClosed} 066 */ 067 protected void verifyConnectionClosed() 068 { 069 connectorTestModule.verifyConnectionClosed(); 070 } 071 072 /** 073 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#getInteractionHandler} 074 */ 075 protected InteractionHandler getInteractionHandler() 076 { 077 return connectorTestModule.getInteractionHandler(); 078 } 079 080 /** 081 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#getInteractionList} 082 */ 083 protected List getInteractionList() 084 { 085 return connectorTestModule.getInteractionList(); 086 } 087 088 /** 089 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#getCreatedIndexedRecords(String)} 090 */ 091 protected List getCreatedIndexedRecords(String recordName) 092 { 093 return connectorTestModule.getCreatedIndexedRecords(recordName); 094 } 095 096 /** 097 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#getCreatedIndexedRecords} 098 */ 099 protected List getCreatedIndexedRecords() 100 { 101 return connectorTestModule.getCreatedIndexedRecords(); 102 } 103 104 /** 105 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#getCreatedMappedRecords(String)} 106 */ 107 protected List getCreatedMappedRecords(String recordName) 108 { 109 return connectorTestModule.getCreatedMappedRecords(recordName); 110 } 111 112 /** 113 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#getCreatedMappedRecords} 114 */ 115 protected List getCreatedMappedRecords() 116 { 117 return connectorTestModule.getCreatedMappedRecords(); 118 } 119 120 /** 121 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#verifyAllInteractionsClosed} 122 */ 123 protected void verifyAllInteractionsClosed() 124 { 125 connectorTestModule.verifyAllInteractionsClosed(); 126 } 127 128 /** 129 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#verifyInteractionClosed(int)} 130 */ 131 protected void verifyInteractionClosed(int index) 132 { 133 connectorTestModule.verifyInteractionClosed(index); 134 } 135 136 /** 137 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#verifyNumberCreatedIndexedRecords(int)} 138 */ 139 protected void verifyNumberCreatedIndexedRecords(int expected) 140 { 141 connectorTestModule.verifyNumberCreatedIndexedRecords(expected); 142 } 143 144 /** 145 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#verifyNumberCreatedIndexedRecords(String, int)} 146 */ 147 protected void verifyNumberCreatedIndexedRecords(String recordName, int expected) 148 { 149 connectorTestModule.verifyNumberCreatedIndexedRecords(recordName, expected); 150 } 151 152 /** 153 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#verifyNumberCreatedMappedRecords(int)} 154 */ 155 protected void verifyNumberCreatedMappedRecords(int expected) 156 { 157 connectorTestModule.verifyNumberCreatedMappedRecords(expected); 158 } 159 160 /** 161 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#verifyNumberCreatedMappedRecords(String, int)} 162 */ 163 protected void verifyNumberCreatedMappedRecords(String recordName, int expected) 164 { 165 connectorTestModule.verifyNumberCreatedMappedRecords(recordName, expected); 166 } 167 168 /** 169 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#verifyLocalTransactionCommitted} 170 */ 171 protected void verifyLocalTransactionCommitted() 172 { 173 connectorTestModule.verifyLocalTransactionCommitted(); 174 } 175 176 /** 177 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#verifyLocalTransactionNotCommitted} 178 */ 179 protected void verifyLocalTransactionNotCommitted() 180 { 181 connectorTestModule.verifyLocalTransactionNotCommitted(); 182 } 183 184 /** 185 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#verifyLocalTransactionRolledBack} 186 */ 187 protected void verifyLocalTransactionRolledBack() 188 { 189 connectorTestModule.verifyLocalTransactionRolledBack(); 190 } 191 192 /** 193 * Delegates to {@link com.mockrunner.connector.ConnectorTestModule#verifyLocalTransactionNotRolledBack} 194 */ 195 protected void verifyLocalTransactionNotRolledBack() 196 { 197 connectorTestModule.verifyLocalTransactionNotRolledBack(); 198 } 199 }