-
Notifications
You must be signed in to change notification settings - Fork 345
/
Copy pathmockRunner.go
50 lines (38 loc) · 1.07 KB
/
mockRunner.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*----------------------------------------------------------------
* Copyright (c) ThoughtWorks, Inc.
* Licensed under the Apache License, Version 2.0
* See LICENSE in the project root for license information.
*----------------------------------------------------------------*/
package refactor
import (
"net"
"github.com/getgauge/gauge-proto/go/gauge_messages"
"github.com/getgauge/gauge/runner"
)
type mockRunner struct {
response *gauge_messages.Message
}
func (r *mockRunner) ExecuteAndGetStatus(m *gauge_messages.Message) *gauge_messages.ProtoExecutionResult {
return nil
}
func (r *mockRunner) ExecuteMessageWithTimeout(m *gauge_messages.Message) (*gauge_messages.Message, error) {
return r.response, nil
}
func (r *mockRunner) Alive() bool {
return true
}
func (r *mockRunner) Kill() error {
return nil
}
func (r *mockRunner) Connection() net.Conn {
return nil
}
func (r *mockRunner) IsMultithreaded() bool {
return false
}
func (r *mockRunner) Info() *runner.RunnerInfo {
return &runner.RunnerInfo{Killed: false}
}
func (r *mockRunner) Pid() int {
return 0
}