agenttestcases

package
v0.3.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const StoreURL = "http://store:5000"

StoreURL is used to connect to the agent underlying store.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
	NewMock   func(t *testing.T, agentURL string) *http.Server
	NewClient func(agentURL string) (client.AgentClient, error)

	Client client.AgentClient
}

Factory wraps functions to create a client and a mock agent. After its creation, the client is stored in the factory to avoid re-creating it in every test.

func (Factory) RunAgentClientTests

func (f Factory) RunAgentClientTests(t *testing.T)

RunAgentClientTests runs the test suite for an agent client.

func (Factory) TestCreateMap

func (f Factory) TestCreateMap(t *testing.T)

TestCreateMap tests what happens when creating a map with various inputs.

func (Factory) TestCreateMapHandlesWrongInitArgs

func (f Factory) TestCreateMapHandlesWrongInitArgs(t *testing.T)

TestCreateMapHandlesWrongInitArgs tests the client's ability to handle a CreateMap request when the provided arguments do not match those of the 'init' function.

func (Factory) TestCreateMapOK

func (f Factory) TestCreateMapOK(t *testing.T)

TestCreateMapOK tests the client's ability to handle a CreateMap request.

func (Factory) TestCreateMapWithBadRefs

func (f Factory) TestCreateMapWithBadRefs(t *testing.T)

TestCreateMapWithBadRefs tests the client's ability to handle a CreateMap request when the provided reference is ill formatted.

func (Factory) TestCreateMapWithRefs

func (f Factory) TestCreateMapWithRefs(t *testing.T)

TestCreateMapWithRefs tests the client's ability to handle a CreateMap request when one or multiple references are passed.

func (Factory) TestCreateSegment

func (f Factory) TestCreateSegment(t *testing.T)

TestCreateSegment tests what happens when creating a link with various inputs.

func (Factory) TestCreateSegmentHandlesWrongAction

func (f Factory) TestCreateSegmentHandlesWrongAction(t *testing.T)

TestCreateSegmentHandlesWrongAction tests the client's ability to handle a CreateSegment request when the provided action does not exist.

func (Factory) TestCreateSegmentHandlesWrongActionArgs

func (f Factory) TestCreateSegmentHandlesWrongActionArgs(t *testing.T)

TestCreateSegmentHandlesWrongActionArgs tests the client's ability to handle a CreateSegment request when the provided action's arguments do not match the actual ones.

func (Factory) TestCreateSegmentHandlesWrongLinkHash

func (f Factory) TestCreateSegmentHandlesWrongLinkHash(t *testing.T)

TestCreateSegmentHandlesWrongLinkHash tests the client's ability to handle a CreateSegment request when the provided parent's linkHash does not exist.

func (Factory) TestCreateSegmentHandlesWrongProcess

func (f Factory) TestCreateSegmentHandlesWrongProcess(t *testing.T)

TestCreateSegmentHandlesWrongProcess tests the client's ability to handle a CreateSegment request when the provided process does not exist.

func (Factory) TestCreateSegmentOK

func (f Factory) TestCreateSegmentOK(t *testing.T)

TestCreateSegmentOK tests the client's ability to handle a CreateSegment request.

func (Factory) TestCreateSegmentWithBadRefs

func (f Factory) TestCreateSegmentWithBadRefs(t *testing.T)

TestCreateSegmentWithBadRefs tests the client's ability to handle a CreateSegment request when a reference is passed.

func (Factory) TestCreateSegmentWithRefs

func (f Factory) TestCreateSegmentWithRefs(t *testing.T)

TestCreateSegmentWithRefs tests the client's ability to handle a CreateSegment request when a reference is passed.

func (Factory) TestFindSegments

func (f Factory) TestFindSegments(t *testing.T)

TestFindSegments tests what happens when finding segments with various filters.

func (Factory) TestFindSegmentsLimit

func (f Factory) TestFindSegmentsLimit(t *testing.T)

TestFindSegmentsLimit tests the client's ability to handle a FindSegment request when a limit is set in the filter, and when this liit is set to -1

func (Factory) TestFindSegmentsLinkHashes

func (f Factory) TestFindSegmentsLinkHashes(t *testing.T)

TestFindSegmentsLinkHashes tests the client's ability to handle a FindSegment request when LinkHashes are set in the filter.

func (Factory) TestFindSegmentsMapIDs

func (f Factory) TestFindSegmentsMapIDs(t *testing.T)

TestFindSegmentsMapIDs tests the client's ability to handle a FindSegment request when a map ID is set in the filter.

func (Factory) TestFindSegmentsNoMatch

func (f Factory) TestFindSegmentsNoMatch(t *testing.T)

TestFindSegmentsNoMatch tests the client's ability to handle a FindSegment request when no segment is found.

func (Factory) TestFindSegmentsNotFound

func (f Factory) TestFindSegmentsNotFound(t *testing.T)

TestFindSegmentsNotFound tests the client's ability to handle a FindSegment request when no segment is found.

func (Factory) TestFindSegmentsOK

func (f Factory) TestFindSegmentsOK(t *testing.T)

TestFindSegmentsOK tests the client's ability to handle a FindSegment request.

func (Factory) TestFindSegmentsTags

func (f Factory) TestFindSegmentsTags(t *testing.T)

TestFindSegmentsTags tests the client's ability to handle a FindSegment request when tags are set in the filter.

func (Factory) TestGetInfo

func (f Factory) TestGetInfo(t *testing.T)

TestGetInfo tests what happens when getting an agent's infos.

func (Factory) TestGetInfoOK

func (f Factory) TestGetInfoOK(t *testing.T)

TestGetInfoOK tests the client's ability to handle a GetInfo request.

func (Factory) TestGetMapIds

func (f Factory) TestGetMapIds(t *testing.T)

TestGetMapIds tests what happens when finding map ids with varisou filters.

func (Factory) TestGetMapIdsLimit

func (f Factory) TestGetMapIdsLimit(t *testing.T)

TestGetMapIdsLimit tests the client's ability to handle a GetMapIds request when a limit is set in the filter and when the limit is set to -1

func (Factory) TestGetMapIdsNoMatch

func (f Factory) TestGetMapIdsNoMatch(t *testing.T)

TestGetMapIdsNoMatch tests the client's ability to handle a GetMapIds request when no mapID is found.

func (Factory) TestGetMapIdsOK

func (f Factory) TestGetMapIdsOK(t *testing.T)

TestGetMapIdsOK tests the client's ability to handle a GetMapIds request.

func (Factory) TestGetProcess

func (f Factory) TestGetProcess(t *testing.T)

TestGetProcess tests what happens when getting informations about a process.

func (Factory) TestGetProcessNotFound

func (f Factory) TestGetProcessNotFound(t *testing.T)

TestGetProcessNotFound tests the client's ability to handle a FindSegment request when no process is found.

func (Factory) TestGetProcessOK

func (f Factory) TestGetProcessOK(t *testing.T)

TestGetProcessOK tests the client's ability to handle a GetProcess request.

func (Factory) TestGetProcesses

func (f Factory) TestGetProcesses(t *testing.T)

TestGetProcesses tests what happens whengetting all the processes from an agent.

func (Factory) TestGetProcessesOK

func (f Factory) TestGetProcessesOK(t *testing.T)

TestGetProcessesOK tests the client's ability to handle a GetProcesses request.

func (Factory) TestGetSegment

func (f Factory) TestGetSegment(t *testing.T)

TestGetSegment tests what happens when getting a segment.

func (Factory) TestGetSegmentNotFound

func (f Factory) TestGetSegmentNotFound(t *testing.T)

TestGetSegmentNotFound tests the client's ability to handle a GetSegment request when the queried linkHash does not exist.

func (Factory) TestGetSegmentOK

func (f Factory) TestGetSegmentOK(t *testing.T)

TestGetSegmentOK tests the client's ability to handle a GetSegment request.

func (Factory) TestUploadProcess added in v0.3.0

func (f Factory) TestUploadProcess(t *testing.T)

TestUploadProcess tests what happens when uploading a process with various inputs.

func (Factory) TestUploadProcessOK added in v0.3.0

func (f Factory) TestUploadProcessOK(t *testing.T)

TestUploadProcessOK tests the client's ability to handle a CreateMap request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL