juju: github.com/juju/juju/service/common/testing Index | Files

package testing

import "github.com/juju/juju/service/common/testing"

Index

Package Files

fake.go

type FakeService Uses

type FakeService struct {
    *FakeServiceData
    common.Service

    DataDir string
}

FakeService is a Service implementation for testing.

func NewFakeService Uses

func NewFakeService(name string, conf common.Conf) *FakeService

NewFakeService returns a new FakeService.

func (*FakeService) Conf Uses

func (ss *FakeService) Conf() common.Conf

Conf implements Service.

func (*FakeService) Exists Uses

func (ss *FakeService) Exists() (bool, error)

Exists implements Service.

func (*FakeService) Install Uses

func (ss *FakeService) Install() error

Install implements Service.

func (*FakeService) InstallCommands Uses

func (ss *FakeService) InstallCommands() ([]string, error)

InstallCommands implements Service.

func (*FakeService) Installed Uses

func (ss *FakeService) Installed() (bool, error)

Installed implements Service.

func (*FakeService) Name Uses

func (ss *FakeService) Name() string

Name implements Service.

func (*FakeService) Remove Uses

func (ss *FakeService) Remove() error

Remove implements Service.

func (*FakeService) Running Uses

func (ss *FakeService) Running() (bool, error)

Running implements Service.

func (*FakeService) Start Uses

func (ss *FakeService) Start() error

Start implements Service.

func (*FakeService) StartCommands Uses

func (ss *FakeService) StartCommands() ([]string, error)

StartCommands implements Service.

func (*FakeService) Stop Uses

func (ss *FakeService) Stop() error

Stop implements Service.

func (*FakeService) WriteService Uses

func (ss *FakeService) WriteService() error

WriteService implements UpgradableService.

type FakeServiceData Uses

type FakeServiceData struct {
    testing.Stub
    // contains filtered or unexported fields
}

FakeServiceData holds the results of Service method calls.

func NewFakeServiceData Uses

func NewFakeServiceData(names ...string) *FakeServiceData

NewFakeServiceData returns a new FakeServiceData.

func (*FakeServiceData) GetInstalled Uses

func (f *FakeServiceData) GetInstalled(name string) ServiceInfo

GetInstalled returns the installed service that matches name. If name is not found, the method panics.

func (*FakeServiceData) Installed Uses

func (f *FakeServiceData) Installed() []ServiceInfo

Installed returns a copy of the list of installed Services

func (*FakeServiceData) InstalledNames Uses

func (f *FakeServiceData) InstalledNames() []string

InstalledNames returns a copy of the list of the installed names.

func (*FakeServiceData) Removed Uses

func (f *FakeServiceData) Removed() []ServiceInfo

Removed returns a copy of the list of removed Services

func (*FakeServiceData) SetStatus Uses

func (f *FakeServiceData) SetStatus(name, status string) error

SetStatus updates the status of the named service.

type ServiceInfo Uses

type ServiceInfo interface {
    Name() string
    Conf() common.Conf
}

Package testing imports 6 packages (graph). Updated 2019-08-29. Refresh now. Tools for package owners.