1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

relocate mocks

This commit is contained in:
Darien Raymond 2018-10-23 22:27:45 +02:00
parent 0c6fc2b946
commit 5fc606ce9d
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
4 changed files with 100 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import (
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"v2ray.com/core/common/session"
"v2ray.com/core/features/mocks"
"v2ray.com/core/testing/mocks"
)
func TestSimpleRouter(t *testing.T) {

View File

@ -2,4 +2,5 @@ package core
//go:generate go get -u github.com/golang/mock/gomock
//go:generate go install github.com/golang/mock/mockgen
//go:generate mockgen -package mocks -destination v2ray.com/core/features/mocks/dns.go v2ray.com/core/features/dns Client
//go:generate mockgen -package mocks -destination v2ray.com/core/testing/mocks/dns.go -mock_names Client=MockDNSClient v2ray.com/core/features/dns Client
//go:generate mockgen -package mocks -destination v2ray.com/core/testing/mocks/proxy.go -mock_names Inbound=MockProxyInbound,Outbound=MockProxyOutbound v2ray.com/core/proxy Inbound,Outbound

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)
}