You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mock_datasource_manager.go 10 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. // Code generated by MockGen. DO NOT EDIT.
  18. // Source: datasource_manager.go
  19. // Package mock is a generated GoMock package.
  20. package mock
  21. import (
  22. context "context"
  23. sql "database/sql"
  24. reflect "reflect"
  25. gomock "github.com/golang/mock/gomock"
  26. datasource "github.com/seata/seata-go/pkg/datasource/sql/datasource"
  27. types "github.com/seata/seata-go/pkg/datasource/sql/types"
  28. branch "github.com/seata/seata-go/pkg/protocol/branch"
  29. message "github.com/seata/seata-go/pkg/protocol/message"
  30. rm "github.com/seata/seata-go/pkg/rm"
  31. )
  32. // MockDataSourceManager is a mock of DataSourceManager interface
  33. type MockDataSourceManager struct {
  34. ctrl *gomock.Controller
  35. recorder *MockDataSourceManagerMockRecorder
  36. }
  37. // MockDataSourceManagerMockRecorder is the mock recorder for MockDataSourceManager
  38. type MockDataSourceManagerMockRecorder struct {
  39. mock *MockDataSourceManager
  40. }
  41. // NewMockDataSourceManager creates a new mock instance
  42. func NewMockDataSourceManager(ctrl *gomock.Controller) *MockDataSourceManager {
  43. mock := &MockDataSourceManager{ctrl: ctrl}
  44. mock.recorder = &MockDataSourceManagerMockRecorder{mock}
  45. return mock
  46. }
  47. // EXPECT returns an object that allows the caller to indicate expected use
  48. func (m *MockDataSourceManager) EXPECT() *MockDataSourceManagerMockRecorder {
  49. return m.recorder
  50. }
  51. // RegisterResource mocks base method
  52. func (m *MockDataSourceManager) RegisterResource(resource rm.Resource) error {
  53. m.ctrl.T.Helper()
  54. ret := m.ctrl.Call(m, "RegisterResource", resource)
  55. ret0, _ := ret[0].(error)
  56. return ret0
  57. }
  58. // RegisterResource indicates an expected call of RegisterResource
  59. func (mr *MockDataSourceManagerMockRecorder) RegisterResource(resource interface{}) *gomock.Call {
  60. mr.mock.ctrl.T.Helper()
  61. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterResource", reflect.TypeOf((*MockDataSourceManager)(nil).RegisterResource), resource)
  62. }
  63. // UnregisterResource mocks base method
  64. func (m *MockDataSourceManager) UnregisterResource(resource rm.Resource) error {
  65. m.ctrl.T.Helper()
  66. ret := m.ctrl.Call(m, "UnregisterResource", resource)
  67. ret0, _ := ret[0].(error)
  68. return ret0
  69. }
  70. // UnregisterResource indicates an expected call of UnregisterResource
  71. func (mr *MockDataSourceManagerMockRecorder) UnregisterResource(resource interface{}) *gomock.Call {
  72. mr.mock.ctrl.T.Helper()
  73. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterResource", reflect.TypeOf((*MockDataSourceManager)(nil).UnregisterResource), resource)
  74. }
  75. // GetManagedResources mocks base method
  76. func (m *MockDataSourceManager) GetManagedResources() map[string]rm.Resource {
  77. m.ctrl.T.Helper()
  78. ret := m.ctrl.Call(m, "GetManagedResources")
  79. ret0, _ := ret[0].(map[string]rm.Resource)
  80. return ret0
  81. }
  82. // GetManagedResources indicates an expected call of GetManagedResources
  83. func (mr *MockDataSourceManagerMockRecorder) GetManagedResources() *gomock.Call {
  84. mr.mock.ctrl.T.Helper()
  85. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetManagedResources", reflect.TypeOf((*MockDataSourceManager)(nil).GetManagedResources))
  86. }
  87. // BranchRollback mocks base method
  88. func (m *MockDataSourceManager) BranchRollback(ctx context.Context, req message.BranchRollbackRequest) (branch.BranchStatus, error) {
  89. m.ctrl.T.Helper()
  90. ret := m.ctrl.Call(m, "BranchRollback", ctx, req)
  91. ret0, _ := ret[0].(branch.BranchStatus)
  92. ret1, _ := ret[1].(error)
  93. return ret0, ret1
  94. }
  95. // BranchRollback indicates an expected call of BranchRollback
  96. func (mr *MockDataSourceManagerMockRecorder) BranchRollback(ctx, req interface{}) *gomock.Call {
  97. mr.mock.ctrl.T.Helper()
  98. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BranchRollback", reflect.TypeOf((*MockDataSourceManager)(nil).BranchRollback), ctx, req)
  99. }
  100. // BranchCommit mocks base method
  101. func (m *MockDataSourceManager) BranchCommit(ctx context.Context, req message.BranchCommitRequest) (branch.BranchStatus, error) {
  102. m.ctrl.T.Helper()
  103. ret := m.ctrl.Call(m, "BranchCommit", ctx, req)
  104. ret0, _ := ret[0].(branch.BranchStatus)
  105. ret1, _ := ret[1].(error)
  106. return ret0, ret1
  107. }
  108. // BranchCommit indicates an expected call of BranchCommit
  109. func (mr *MockDataSourceManagerMockRecorder) BranchCommit(ctx, req interface{}) *gomock.Call {
  110. mr.mock.ctrl.T.Helper()
  111. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BranchCommit", reflect.TypeOf((*MockDataSourceManager)(nil).BranchCommit), ctx, req)
  112. }
  113. // LockQuery mocks base method
  114. func (m *MockDataSourceManager) LockQuery(ctx context.Context, req message.GlobalLockQueryRequest) (bool, error) {
  115. m.ctrl.T.Helper()
  116. ret := m.ctrl.Call(m, "LockQuery", ctx, req)
  117. ret0, _ := ret[0].(bool)
  118. ret1, _ := ret[1].(error)
  119. return ret0, ret1
  120. }
  121. // LockQuery indicates an expected call of LockQuery
  122. func (mr *MockDataSourceManagerMockRecorder) LockQuery(ctx, req interface{}) *gomock.Call {
  123. mr.mock.ctrl.T.Helper()
  124. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LockQuery", reflect.TypeOf((*MockDataSourceManager)(nil).LockQuery), ctx, req)
  125. }
  126. // BranchRegister mocks base method
  127. func (m *MockDataSourceManager) BranchRegister(ctx context.Context, clientId string, req message.BranchRegisterRequest) (int64, error) {
  128. m.ctrl.T.Helper()
  129. ret := m.ctrl.Call(m, "BranchRegister", ctx, clientId, req)
  130. ret0, _ := ret[0].(int64)
  131. ret1, _ := ret[1].(error)
  132. return ret0, ret1
  133. }
  134. // BranchRegister indicates an expected call of BranchRegister
  135. func (mr *MockDataSourceManagerMockRecorder) BranchRegister(ctx, clientId, req interface{}) *gomock.Call {
  136. mr.mock.ctrl.T.Helper()
  137. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BranchRegister", reflect.TypeOf((*MockDataSourceManager)(nil).BranchRegister), ctx, clientId, req)
  138. }
  139. // BranchReport mocks base method
  140. func (m *MockDataSourceManager) BranchReport(ctx context.Context, req message.BranchReportRequest) error {
  141. m.ctrl.T.Helper()
  142. ret := m.ctrl.Call(m, "BranchReport", ctx, req)
  143. ret0, _ := ret[0].(error)
  144. return ret0
  145. }
  146. // BranchReport indicates an expected call of BranchReport
  147. func (mr *MockDataSourceManagerMockRecorder) BranchReport(ctx, req interface{}) *gomock.Call {
  148. mr.mock.ctrl.T.Helper()
  149. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BranchReport", reflect.TypeOf((*MockDataSourceManager)(nil).BranchReport), ctx, req)
  150. }
  151. // CreateTableMetaCache mocks base method
  152. func (m *MockDataSourceManager) CreateTableMetaCache(ctx context.Context, resID string, dbType types.DBType, db *sql.DB) (datasource.TableMetaCache, error) {
  153. m.ctrl.T.Helper()
  154. ret := m.ctrl.Call(m, "CreateTableMetaCache", ctx, resID, dbType, db)
  155. ret0, _ := ret[0].(datasource.TableMetaCache)
  156. ret1, _ := ret[1].(error)
  157. return ret0, ret1
  158. }
  159. // CreateTableMetaCache indicates an expected call of CreateTableMetaCache
  160. func (mr *MockDataSourceManagerMockRecorder) CreateTableMetaCache(ctx, resID, dbType, db interface{}) *gomock.Call {
  161. mr.mock.ctrl.T.Helper()
  162. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateTableMetaCache", reflect.TypeOf((*MockDataSourceManager)(nil).CreateTableMetaCache), ctx, resID, dbType, db)
  163. }
  164. // MockTableMetaCache is a mock of TableMetaCache interface
  165. type MockTableMetaCache struct {
  166. ctrl *gomock.Controller
  167. recorder *MockTableMetaCacheMockRecorder
  168. }
  169. // MockTableMetaCacheMockRecorder is the mock recorder for MockTableMetaCache
  170. type MockTableMetaCacheMockRecorder struct {
  171. mock *MockTableMetaCache
  172. }
  173. // NewMockTableMetaCache creates a new mock instance
  174. func NewMockTableMetaCache(ctrl *gomock.Controller) *MockTableMetaCache {
  175. mock := &MockTableMetaCache{ctrl: ctrl}
  176. mock.recorder = &MockTableMetaCacheMockRecorder{mock}
  177. return mock
  178. }
  179. // EXPECT returns an object that allows the caller to indicate expected use
  180. func (m *MockTableMetaCache) EXPECT() *MockTableMetaCacheMockRecorder {
  181. return m.recorder
  182. }
  183. // Init mocks base method
  184. func (m *MockTableMetaCache) Init(ctx context.Context, conn *sql.DB) error {
  185. m.ctrl.T.Helper()
  186. ret := m.ctrl.Call(m, "Init", ctx, conn)
  187. ret0, _ := ret[0].(error)
  188. return ret0
  189. }
  190. // Init indicates an expected call of Init
  191. func (mr *MockTableMetaCacheMockRecorder) Init(ctx, conn interface{}) *gomock.Call {
  192. mr.mock.ctrl.T.Helper()
  193. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockTableMetaCache)(nil).Init), ctx, conn)
  194. }
  195. // GetTableMeta mocks base method
  196. func (m *MockTableMetaCache) GetTableMeta(table string) (types.TableMeta, error) {
  197. m.ctrl.T.Helper()
  198. ret := m.ctrl.Call(m, "GetTableMeta", table)
  199. ret0, _ := ret[0].(types.TableMeta)
  200. ret1, _ := ret[1].(error)
  201. return ret0, ret1
  202. }
  203. // GetTableMeta indicates an expected call of GetTableMeta
  204. func (mr *MockTableMetaCacheMockRecorder) GetTableMeta(table interface{}) *gomock.Call {
  205. mr.mock.ctrl.T.Helper()
  206. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTableMeta", reflect.TypeOf((*MockTableMetaCache)(nil).GetTableMeta), table)
  207. }
  208. // Destroy mocks base method
  209. func (m *MockTableMetaCache) Destroy() error {
  210. m.ctrl.T.Helper()
  211. ret := m.ctrl.Call(m, "Destroy")
  212. ret0, _ := ret[0].(error)
  213. return ret0
  214. }
  215. // Destroy indicates an expected call of Destroy
  216. func (mr *MockTableMetaCacheMockRecorder) Destroy() *gomock.Call {
  217. mr.mock.ctrl.T.Helper()
  218. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Destroy", reflect.TypeOf((*MockTableMetaCache)(nil).Destroy))
  219. }