package testutil

import "github.com/mesos/mesos-go/api/v0/testutil"

Collection of resources for teting mesos artifacts.

Index

Types

type MockMesosClient

type MockMesosClient struct {
	// contains filtered or unexported fields
}

MockMesosClient Http client to communicate with mesos processes (master,sched,exec)

func NewMockMesosClient

func NewMockMesosClient(t *testing.T, pid *upid.UPID) *MockMesosClient

func (*MockMesosClient) SendMessage

func (c *MockMesosClient) SendMessage(targetPid *upid.UPID, message proto.Message)

sendMessage Mocks sending event messages to a processes such as master, sched or exec.

type MockMesosHttpServer

type MockMesosHttpServer struct {
	PID  *upid.UPID
	Addr string
	// contains filtered or unexported fields
}

MockMesosHttpProcess represents a remote http process: master or slave.

func NewMockMasterHttpServer

func NewMockMasterHttpServer(t *testing.T, handler func(rsp http.ResponseWriter, req *http.Request)) *MockMesosHttpServer

func NewMockSlaveHttpServer

func NewMockSlaveHttpServer(t *testing.T, handler func(rsp http.ResponseWriter, req *http.Request)) *MockMesosHttpServer

func (*MockMesosHttpServer) Close

func (s *MockMesosHttpServer) Close()

func (*MockMesosHttpServer) On

func (m *MockMesosHttpServer) On(uri string) When

type When

type When interface {
	Do(http.HandlerFunc)
}

type WhenFunc

type WhenFunc func(http.HandlerFunc)

func (WhenFunc) Do

func (w WhenFunc) Do(f http.HandlerFunc)

Source Files

testingutil.go

Version
v0.0.11 (latest)
Published
May 15, 2020
Platform
linux/amd64
Imports
14 packages
Last checked
2 hours ago

Tools for package owners.