123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- package mock
- import (
- "github.com/qor5/admin/worker"
- "sync"
- )
- var _ worker.QorJobInterface = &QorJobInterfaceMock{}
- type QorJobInterfaceMock struct {
-
- AddLogFunc func(s string) error
-
- AddLogfFunc func(format string, a ...interface{}) error
-
- GetJobInfoFunc func() (*worker.JobInfo, error)
-
- SetProgressFunc func(v uint) error
-
- SetProgressTextFunc func(s string) error
-
- calls struct {
-
- AddLog []struct {
-
- S string
- }
-
- AddLogf []struct {
-
- Format string
-
- A []interface{}
- }
-
- GetJobInfo []struct {
- }
-
- SetProgress []struct {
-
- V uint
- }
-
- SetProgressText []struct {
-
- S string
- }
- }
- lockAddLog sync.RWMutex
- lockAddLogf sync.RWMutex
- lockGetJobInfo sync.RWMutex
- lockSetProgress sync.RWMutex
- lockSetProgressText sync.RWMutex
- }
- func (mock *QorJobInterfaceMock) AddLog(s string) error {
- if mock.AddLogFunc == nil {
- panic("QorJobInterfaceMock.AddLogFunc: method is nil but QorJobInterface.AddLog was just called")
- }
- callInfo := struct {
- S string
- }{
- S: s,
- }
- mock.lockAddLog.Lock()
- mock.calls.AddLog = append(mock.calls.AddLog, callInfo)
- mock.lockAddLog.Unlock()
- return mock.AddLogFunc(s)
- }
- func (mock *QorJobInterfaceMock) AddLogCalls() []struct {
- S string
- } {
- var calls []struct {
- S string
- }
- mock.lockAddLog.RLock()
- calls = mock.calls.AddLog
- mock.lockAddLog.RUnlock()
- return calls
- }
- func (mock *QorJobInterfaceMock) AddLogf(format string, a ...interface{}) error {
- if mock.AddLogfFunc == nil {
- panic("QorJobInterfaceMock.AddLogfFunc: method is nil but QorJobInterface.AddLogf was just called")
- }
- callInfo := struct {
- Format string
- A []interface{}
- }{
- Format: format,
- A: a,
- }
- mock.lockAddLogf.Lock()
- mock.calls.AddLogf = append(mock.calls.AddLogf, callInfo)
- mock.lockAddLogf.Unlock()
- return mock.AddLogfFunc(format, a...)
- }
- func (mock *QorJobInterfaceMock) AddLogfCalls() []struct {
- Format string
- A []interface{}
- } {
- var calls []struct {
- Format string
- A []interface{}
- }
- mock.lockAddLogf.RLock()
- calls = mock.calls.AddLogf
- mock.lockAddLogf.RUnlock()
- return calls
- }
- func (mock *QorJobInterfaceMock) GetJobInfo() (*worker.JobInfo, error) {
- if mock.GetJobInfoFunc == nil {
- panic("QorJobInterfaceMock.GetJobInfoFunc: method is nil but QorJobInterface.GetJobInfo was just called")
- }
- callInfo := struct {
- }{}
- mock.lockGetJobInfo.Lock()
- mock.calls.GetJobInfo = append(mock.calls.GetJobInfo, callInfo)
- mock.lockGetJobInfo.Unlock()
- return mock.GetJobInfoFunc()
- }
- func (mock *QorJobInterfaceMock) GetJobInfoCalls() []struct {
- } {
- var calls []struct {
- }
- mock.lockGetJobInfo.RLock()
- calls = mock.calls.GetJobInfo
- mock.lockGetJobInfo.RUnlock()
- return calls
- }
- func (mock *QorJobInterfaceMock) SetProgress(v uint) error {
- if mock.SetProgressFunc == nil {
- panic("QorJobInterfaceMock.SetProgressFunc: method is nil but QorJobInterface.SetProgress was just called")
- }
- callInfo := struct {
- V uint
- }{
- V: v,
- }
- mock.lockSetProgress.Lock()
- mock.calls.SetProgress = append(mock.calls.SetProgress, callInfo)
- mock.lockSetProgress.Unlock()
- return mock.SetProgressFunc(v)
- }
- func (mock *QorJobInterfaceMock) SetProgressCalls() []struct {
- V uint
- } {
- var calls []struct {
- V uint
- }
- mock.lockSetProgress.RLock()
- calls = mock.calls.SetProgress
- mock.lockSetProgress.RUnlock()
- return calls
- }
- func (mock *QorJobInterfaceMock) SetProgressText(s string) error {
- if mock.SetProgressTextFunc == nil {
- panic("QorJobInterfaceMock.SetProgressTextFunc: method is nil but QorJobInterface.SetProgressText was just called")
- }
- callInfo := struct {
- S string
- }{
- S: s,
- }
- mock.lockSetProgressText.Lock()
- mock.calls.SetProgressText = append(mock.calls.SetProgressText, callInfo)
- mock.lockSetProgressText.Unlock()
- return mock.SetProgressTextFunc(s)
- }
- func (mock *QorJobInterfaceMock) SetProgressTextCalls() []struct {
- S string
- } {
- var calls []struct {
- S string
- }
- mock.lockSetProgressText.RLock()
- calls = mock.calls.SetProgressText
- mock.lockSetProgressText.RUnlock()
- return calls
- }
|