1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-03-18 12:15:23 -04:00

relocate mocks

This commit is contained in:
Darien Raymond
2018-10-23 22:27:45 +02:00
parent 0c6fc2b946
commit 5fc606ce9d
4 changed files with 100 additions and 2 deletions

83
testing/mocks/dns.go Normal file
View File

@@ -0,0 +1,83 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: v2ray.com/core/features/dns (interfaces: Client)
// Package mocks is a generated GoMock package.
package mocks
import (
gomock "github.com/golang/mock/gomock"
net "net"
reflect "reflect"
)
// MockDNSClient is a mock of Client interface
type MockDNSClient struct {
ctrl *gomock.Controller
recorder *MockDNSClientMockRecorder
}
// MockDNSClientMockRecorder is the mock recorder for MockDNSClient
type MockDNSClientMockRecorder struct {
mock *MockDNSClient
}
// NewMockDNSClient creates a new mock instance
func NewMockDNSClient(ctrl *gomock.Controller) *MockDNSClient {
mock := &MockDNSClient{ctrl: ctrl}
mock.recorder = &MockDNSClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockDNSClient) EXPECT() *MockDNSClientMockRecorder {
return m.recorder
}
// Close mocks base method
func (m *MockDNSClient) Close() error {
ret := m.ctrl.Call(m, "Close")
ret0, _ := ret[0].(error)
return ret0
}
// Close indicates an expected call of Close
func (mr *MockDNSClientMockRecorder) Close() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockDNSClient)(nil).Close))
}
// LookupIP mocks base method
func (m *MockDNSClient) LookupIP(arg0 string) ([]net.IP, error) {
ret := m.ctrl.Call(m, "LookupIP", arg0)
ret0, _ := ret[0].([]net.IP)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LookupIP indicates an expected call of LookupIP
func (mr *MockDNSClientMockRecorder) LookupIP(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LookupIP", reflect.TypeOf((*MockDNSClient)(nil).LookupIP), arg0)
}
// Start mocks base method
func (m *MockDNSClient) Start() error {
ret := m.ctrl.Call(m, "Start")
ret0, _ := ret[0].(error)
return ret0
}
// Start indicates an expected call of Start
func (mr *MockDNSClientMockRecorder) Start() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockDNSClient)(nil).Start))
}
// Type mocks base method
func (m *MockDNSClient) Type() interface{} {
ret := m.ctrl.Call(m, "Type")
ret0, _ := ret[0].(interface{})
return ret0
}
// Type indicates an expected call of Type
func (mr *MockDNSClientMockRecorder) Type() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Type", reflect.TypeOf((*MockDNSClient)(nil).Type))
}

97
testing/mocks/proxy.go Normal file
View File

@@ -0,0 +1,97 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: v2ray.com/core/proxy (interfaces: Inbound,Outbound)
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
gomock "github.com/golang/mock/gomock"
reflect "reflect"
net "v2ray.com/core/common/net"
vio "v2ray.com/core/common/vio"
routing "v2ray.com/core/features/routing"
internet "v2ray.com/core/transport/internet"
)
// MockProxyInbound is a mock of Inbound interface
type MockProxyInbound struct {
ctrl *gomock.Controller
recorder *MockProxyInboundMockRecorder
}
// MockProxyInboundMockRecorder is the mock recorder for MockProxyInbound
type MockProxyInboundMockRecorder struct {
mock *MockProxyInbound
}
// NewMockProxyInbound creates a new mock instance
func NewMockProxyInbound(ctrl *gomock.Controller) *MockProxyInbound {
mock := &MockProxyInbound{ctrl: ctrl}
mock.recorder = &MockProxyInboundMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockProxyInbound) EXPECT() *MockProxyInboundMockRecorder {
return m.recorder
}
// Network mocks base method
func (m *MockProxyInbound) Network() net.NetworkList {
ret := m.ctrl.Call(m, "Network")
ret0, _ := ret[0].(net.NetworkList)
return ret0
}
// Network indicates an expected call of Network
func (mr *MockProxyInboundMockRecorder) Network() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Network", reflect.TypeOf((*MockProxyInbound)(nil).Network))
}
// Process mocks base method
func (m *MockProxyInbound) Process(arg0 context.Context, arg1 net.Network, arg2 internet.Connection, arg3 routing.Dispatcher) error {
ret := m.ctrl.Call(m, "Process", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(error)
return ret0
}
// Process indicates an expected call of Process
func (mr *MockProxyInboundMockRecorder) Process(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Process", reflect.TypeOf((*MockProxyInbound)(nil).Process), arg0, arg1, arg2, arg3)
}
// MockProxyOutbound is a mock of Outbound interface
type MockProxyOutbound struct {
ctrl *gomock.Controller
recorder *MockProxyOutboundMockRecorder
}
// MockProxyOutboundMockRecorder is the mock recorder for MockProxyOutbound
type MockProxyOutboundMockRecorder struct {
mock *MockProxyOutbound
}
// NewMockProxyOutbound creates a new mock instance
func NewMockProxyOutbound(ctrl *gomock.Controller) *MockProxyOutbound {
mock := &MockProxyOutbound{ctrl: ctrl}
mock.recorder = &MockProxyOutboundMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockProxyOutbound) EXPECT() *MockProxyOutboundMockRecorder {
return m.recorder
}
// Process mocks base method
func (m *MockProxyOutbound) Process(arg0 context.Context, arg1 *vio.Link, arg2 internet.Dialer) error {
ret := m.ctrl.Call(m, "Process", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// Process indicates an expected call of Process
func (mr *MockProxyOutboundMockRecorder) Process(arg0, arg1, arg2 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Process", reflect.TypeOf((*MockProxyOutbound)(nil).Process), arg0, arg1, arg2)
}