ss412g | 07ef76d | 2019-08-12 17:26:40 +0300 | [diff] [blame] | 1 | // |
| 2 | // Copyright 2019 AT&T Intellectual Property |
| 3 | // Copyright 2019 Nokia |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | // you may not use this file except in compliance with the License. |
| 7 | // 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 | |
| 18 | package mocks |
| 19 | |
| 20 | import ( |
| 21 | "e2mgr/logger" |
| 22 | "e2mgr/rmrCgo" |
| 23 | "github.com/stretchr/testify/mock" |
| 24 | ) |
| 25 | |
| 26 | type RmrMessengerMock struct { |
| 27 | mock.Mock |
| 28 | } |
| 29 | |
| 30 | func (m *RmrMessengerMock) Init(port string, maxMsgSize int, flags int, logger *logger.Logger) *rmrCgo.RmrMessenger{ |
| 31 | args := m.Called(port, maxMsgSize, flags, logger) |
| 32 | return args.Get(0).(*rmrCgo.RmrMessenger) |
| 33 | } |
| 34 | |
ss412g | de19068 | 2019-10-24 09:29:26 +0300 | [diff] [blame] | 35 | func (m *RmrMessengerMock) SendMsg(msg *rmrCgo.MBuf) (*rmrCgo.MBuf, error){ |
| 36 | args := m.Called(msg) |
ss412g | 07ef76d | 2019-08-12 17:26:40 +0300 | [diff] [blame] | 37 | return args.Get(0).(*rmrCgo.MBuf), args.Error(1) |
| 38 | } |
| 39 | |
| 40 | func (m *RmrMessengerMock) RecvMsg() (*rmrCgo.MBuf, error){ |
ss412g | de19068 | 2019-10-24 09:29:26 +0300 | [diff] [blame] | 41 | args := m.Called() |
ss412g | 07ef76d | 2019-08-12 17:26:40 +0300 | [diff] [blame] | 42 | return args.Get(0).(*rmrCgo.MBuf), args.Error(1) |
| 43 | } |
| 44 | |
| 45 | func (m *RmrMessengerMock) RtsMsg(msg *rmrCgo.MBuf){ |
| 46 | m.Called( ) |
| 47 | } |
| 48 | |
| 49 | func (m *RmrMessengerMock) FreeMsg(){ |
| 50 | m.Called( ) |
| 51 | } |
| 52 | |
| 53 | func (m *RmrMessengerMock) IsReady() bool{ |
| 54 | args := m.Called( ) |
| 55 | return args.Bool(0) |
| 56 | } |
| 57 | |
| 58 | func (m *RmrMessengerMock) Close(){ |
| 59 | m.Called( ) |
| 60 | } |