fabric8-wit: github.com/fabric8-services/fabric8-wit/test Index | Files | Directories

package test

import "github.com/fabric8-services/fabric8-wit/test"

This file was generated by counterfeiter

Index

Package Files

account.go bench_suite.go common.go doc.go login.go remote_test_data.go

Variables

var TestIdentity = account.Identity{
    ID:       uuid.NewV4(),
    Username: "TestDeveloper",
    User:     TestUser,
}

TestIdentity only creates in memory obj for testing purposes

var TestIdentity2 = account.Identity{
    ID:       uuid.NewV4(),
    Username: "TestDeveloper2",
    User:     TestUser2,
}

TestIdentity2 only creates in memory obj for testing purposes

var TestObserverIdentity = account.Identity{
    ID:       uuid.NewV4(),
    Username: "TestObserver",
    User:     TestUser,
}

TestObserverIdentity only creates in memory obj for testing purposes

var TestOversizedNameObj = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
var TestUser = account.User{
    ID:       uuid.NewV4(),
    Email:    "testdeveloper@testalm.io",
    FullName: "Test Developer",
}

TestUser only creates in memory obj for testing purposes

var TestUser2 = account.User{
    ID:       uuid.NewV4(),
    Email:    "testdeveloper2@testalm.io",
    FullName: "Test Developer 2",
}

TestUser2 only creates in memory obj for testing purposes. This TestUser2 can be used to verify that some entity created by TestUser can be later updated or deleted (or not) by another user.

func CreateRandomValidTestName Uses

func CreateRandomValidTestName(name string) string

CreateRandomValidTestName functions creates a valid lenght name

func CreateTestIdentity Uses

func CreateTestIdentity(db *gorm.DB, username, providerType string) (*account.Identity, error)

CreateTestIdentity creates an identity with the given `username` in the database. For testing purpose only.

func CreateTestIdentityForAccountIdentity Uses

func CreateTestIdentityForAccountIdentity(db *gorm.DB, identity *account.Identity) error

CreateTestIdentityForAccountIdentity creates an account.Identity in the database. For testing purpose only. This function unlike CreateTestIdentity() allows to create an Identity with pre-defined ID.

func LoadTestData Uses

func LoadTestData(filename string, provider TestDataProvider) ([]byte, error)

LoadTestData attempt to load test data from local disk unless; * It does not exist or, * Variable REFRESH_DATA is present in ENV

Data is stored under examples/test This is done to avoid always depending on remote systems, but also with an option to refresh/retest against the 'current' remote system data without manual copy/paste

func Run Uses

func Run(b *testing.B, suite BenchingSuite)

Run takes a testing suite and runs all of the benchmarks attached to it.

func ServiceAsServiceAccountUser Uses

func ServiceAsServiceAccountUser(serviceName string, u account.Identity) *goa.Service

ServiceAsServiceAccountUser generates the minimal service needed to satisfy the condition of being a service account.

func ServiceAsSpaceUser Uses

func ServiceAsSpaceUser(serviceName string, u account.Identity, authzSrv authz.AuthzService) *goa.Service

ServiceAsSpaceUser creates a new service and fill the context with input Identity and space authz service

func ServiceAsUser Uses

func ServiceAsUser(serviceName string, u account.Identity) *goa.Service

ServiceAsUser creates a new service and fill the context with input Identity

func ServiceAsUserWithAuthz Uses

func ServiceAsUserWithAuthz(serviceName string, key interface{}, u account.Identity, authorizationPayload token.AuthorizationPayload) *goa.Service

ServiceAsUserWithAuthz creates a new service and fill the context with input Identity and resource authorization information

func WithAuthz Uses

func WithAuthz(ctx context.Context, key interface{}, ident account.Identity, authz token.AuthorizationPayload) context.Context

WithAuthz fills the context with token Token is filled using input Identity object and resource authorization information

func WithIdentity Uses

func WithIdentity(ctx context.Context, ident account.Identity) context.Context

WithIdentity fills the context with token Token is filled using input Identity object

func WithServiceAccountAuthz Uses

func WithServiceAccountAuthz(ctx context.Context, key interface{}, ident account.Identity) context.Context

WithServiceAccountAuthz fills the context with token Token is filled using input Identity object and resource authorization information

type AfterBenchmark Uses

type AfterBenchmark interface {
    AfterBenchmark(suiteName, testName string)
}

AfterBenchmark has a function to be executed right after the benchmark finishes and receives the suite and benchmark names as input

type BeforeBenchmark Uses

type BeforeBenchmark interface {
    BeforeBenchmark(suiteName, testName string)
}

BeforeBenchmark has a function to be executed right before the benchmark starts and receives the suite and benchmark names as input

type BenchingSuite Uses

type BenchingSuite interface {
    B() *testing.B
    SetB(*testing.B)
}

BenchingSuite can store and return the current *testing.B context generated by 'go test -bench=.'.

type SetupAllSuite Uses

type SetupAllSuite interface {
    SetupSuite()
}

SetupAllSuite has a SetupSuite method, which will run before the benchmarks in the suite are run.

type SetupBenchmarkSuite Uses

type SetupBenchmarkSuite interface {
    SetupBenchmark()
}

SetupBenchmarkSuite has a SetupBenchmark method, which will run before each benchmark in the suite.

type Suite Uses

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

Suite is a basic testing suite with methods for storing and retrieving the current *testing.B context.

func (*Suite) B Uses

func (suite *Suite) B() *testing.B

B retrieves the current *testing.B context.

func (*Suite) SetB Uses

func (suite *Suite) SetB(b *testing.B)

SetB sets the current *testing.B context.

type TearDownAllSuite Uses

type TearDownAllSuite interface {
    TearDownSuite()
}

TearDownAllSuite has a TearDownSuite method, which will run after all the benchmarks in the suite have been run.

type TearDownBenchmarkSuite Uses

type TearDownBenchmarkSuite interface {
    TearDownBenchmark()
}

TearDownBenchmarkSuite has a TearDownBenchmark method, which will run after each benchmark in the suite.

type TestDataProvider Uses

type TestDataProvider func() ([]byte, error)

TestDataProvider defines the simple funcion for returning data from a remote provider

Directories

PathSynopsis
testfixturePackage testfixture helps you bootstrap test scenarios very effectively.
token

Package test imports 25 packages (graph) and is imported by 6 packages. Updated 2017-10-23. Refresh now. Tools for package owners.