blob: dc4fa15b46bb3f70c423e1fc72c37cdb7d72bc9a [file] [log] [blame]
ss412g07ef76d2019-08-12 17:26:40 +03001//
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
18package mocks
19
20import (
21 "e2mgr/logger"
22 "e2mgr/rmrCgo"
23 "github.com/stretchr/testify/mock"
24)
25
26type RmrMessengerMock struct {
27 mock.Mock
28}
29
30func (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
ss412gde190682019-10-24 09:29:26 +030035func (m *RmrMessengerMock) SendMsg(msg *rmrCgo.MBuf) (*rmrCgo.MBuf, error){
36 args := m.Called(msg)
ss412g07ef76d2019-08-12 17:26:40 +030037 return args.Get(0).(*rmrCgo.MBuf), args.Error(1)
38}
39
40func (m *RmrMessengerMock) RecvMsg() (*rmrCgo.MBuf, error){
ss412gde190682019-10-24 09:29:26 +030041 args := m.Called()
ss412g07ef76d2019-08-12 17:26:40 +030042 return args.Get(0).(*rmrCgo.MBuf), args.Error(1)
43}
44
45func (m *RmrMessengerMock) RtsMsg(msg *rmrCgo.MBuf){
46 m.Called( )
47}
48
49func (m *RmrMessengerMock) FreeMsg(){
50 m.Called( )
51}
52
53func (m *RmrMessengerMock) IsReady() bool{
54 args := m.Called( )
55 return args.Bool(0)
56}
57
58func (m *RmrMessengerMock) Close(){
59 m.Called( )
60}