enginetesting

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpectedGraphs

type ExpectedGraphs struct {
	Dataflow, Deployment []any
}

func (ExpectedGraphs) AssertEqual

func (expect ExpectedGraphs) AssertEqual(t *testing.T, sol solution.Solution)

type MockKB

type MockKB struct {
	mock.Mock
}

func (*MockKB) AddEdgeTemplate

func (m *MockKB) AddEdgeTemplate(template *knowledgebase.EdgeTemplate) error

func (*MockKB) AddResourceTemplate

func (m *MockKB) AddResourceTemplate(template *knowledgebase.ResourceTemplate) error

func (*MockKB) AllPaths

func (m *MockKB) AllPaths(from, to construct.ResourceId) ([][]*knowledgebase.ResourceTemplate, error)

func (*MockKB) Edges

func (*MockKB) GetAllowedNamespacedResourceIds

func (m *MockKB) GetAllowedNamespacedResourceIds(
	ctx knowledgebase.DynamicValueContext,
	resourceId construct.ResourceId,
) ([]construct.ResourceId, error)

func (*MockKB) GetClassification

func (m *MockKB) GetClassification(id construct.ResourceId) knowledgebase.Classification

func (*MockKB) GetEdgeTemplate

func (m *MockKB) GetEdgeTemplate(from, to construct.ResourceId) *knowledgebase.EdgeTemplate

func (*MockKB) GetFunctionality

func (m *MockKB) GetFunctionality(id construct.ResourceId) knowledgebase.Functionality

func (*MockKB) GetModel

func (m *MockKB) GetModel(model string) *knowledgebase.Model

func (*MockKB) GetPathSatisfactionsFromEdge

func (m *MockKB) GetPathSatisfactionsFromEdge(
	source, target construct.ResourceId,
) ([]knowledgebase.EdgePathSatisfaction, error)

func (*MockKB) GetResourcePropertyType

func (m *MockKB) GetResourcePropertyType(resource construct.ResourceId, propertyName string) string

func (*MockKB) GetResourceTemplate

func (m *MockKB) GetResourceTemplate(id construct.ResourceId) (*knowledgebase.ResourceTemplate, error)

func (*MockKB) GetResourcesNamespaceResource

func (m *MockKB) GetResourcesNamespaceResource(resource *construct.Resource) (construct.ResourceId, error)

func (*MockKB) HasDirectPath

func (m *MockKB) HasDirectPath(from, to construct.ResourceId) bool

func (*MockKB) HasFunctionalPath

func (m *MockKB) HasFunctionalPath(from, to construct.ResourceId) bool

func (*MockKB) ListResources

func (m *MockKB) ListResources() []*knowledgebase.ResourceTemplate

type MockSolution

type MockSolution struct {
	mock.Mock
	KB MockKB
}

func (*MockSolution) Constraints

func (m *MockSolution) Constraints() *constraints.Constraints

func (*MockSolution) Context

func (m *MockSolution) Context() context.Context

func (*MockSolution) DataflowGraph

func (m *MockSolution) DataflowGraph() construct.Graph

func (*MockSolution) DeploymentGraph

func (m *MockSolution) DeploymentGraph() construct.Graph

func (*MockSolution) GetDecisions

func (m *MockSolution) GetDecisions() []solution.SolveDecision

func (*MockSolution) GlobalTag

func (m *MockSolution) GlobalTag() string

func (*MockSolution) KnowledgeBase

func (m *MockSolution) KnowledgeBase() knowledgebase.TemplateKB

func (*MockSolution) OperationalView

func (m *MockSolution) OperationalView() solution.OperationalView

func (*MockSolution) Outputs

func (m *MockSolution) Outputs() map[string]construct.Output

func (*MockSolution) RawView

func (m *MockSolution) RawView() construct.Graph

func (*MockSolution) RecordDecision

func (m *MockSolution) RecordDecision(d solution.SolveDecision)

type TestSolution

type TestSolution struct {
	mock.Mock

	KB     MockKB
	Constr constraints.Constraints
	// contains filtered or unexported fields
}

func NewTestSolution

func NewTestSolution() *TestSolution

func (*TestSolution) Constraints

func (sol *TestSolution) Constraints() *constraints.Constraints

func (*TestSolution) Context

func (sol *TestSolution) Context() context.Context

func (*TestSolution) DataflowChanges

func (sol *TestSolution) DataflowChanges() *graphtest.GraphChanges

func (*TestSolution) DataflowGraph

func (sol *TestSolution) DataflowGraph() construct.Graph

func (*TestSolution) DeploymentChanges

func (sol *TestSolution) DeploymentChanges() *graphtest.GraphChanges

func (*TestSolution) DeploymentGraph

func (sol *TestSolution) DeploymentGraph() construct.Graph

func (*TestSolution) GetDecisions

func (sol *TestSolution) GetDecisions() []solution.SolveDecision

func (*TestSolution) GlobalTag

func (sol *TestSolution) GlobalTag() string

func (*TestSolution) KnowledgeBase

func (sol *TestSolution) KnowledgeBase() knowledgebase.TemplateKB

func (*TestSolution) LoadState

func (sol *TestSolution) LoadState(t *testing.T, initGraph ...any)

func (*TestSolution) OperationalView

func (sol *TestSolution) OperationalView() solution.OperationalView

func (*TestSolution) Outputs

func (sol *TestSolution) Outputs() map[string]construct.Output

func (*TestSolution) RawView

func (sol *TestSolution) RawView() construct.Graph

func (*TestSolution) RecordDecision

func (sol *TestSolution) RecordDecision(d solution.SolveDecision)

func (*TestSolution) UseEmptyTemplates

func (sol *TestSolution) UseEmptyTemplates()

Jump to

Keyboard shortcuts

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