本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/api/applications/fakes.FakeApplicationRepository類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeApplicationRepository類的具體用法?Golang FakeApplicationRepository怎麽用?Golang FakeApplicationRepository使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeApplicationRepository類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
"github.com/cloudfoundry/cli/cf/models"
"github.com/cloudfoundry/cli/cf/requirements"
testApplication "github.com/cloudfoundry/cli/cf/api/applications/fakes"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("DeaApplication", func() {
var (
req requirements.DEAApplicationRequirement
ui *testterm.FakeUI
appRepo *testApplication.FakeApplicationRepository
appName string
)
BeforeEach(func() {
appName = "fake-app-name"
ui = &testterm.FakeUI{}
appRepo = &testApplication.FakeApplicationRepository{}
req = requirements.NewDEAApplicationRequirement(appName, ui, appRepo)
})
Describe("GetApplication", func() {
It("returns an empty application", func() {
Expect(req.GetApplication()).To(Equal(models.Application{}))
})
示例2:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Push Command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
manifestRepo *testmanifest.FakeManifestRepository
starter *appCmdFakes.FakeApplicationStarter
stopper *appCmdFakes.FakeApplicationStopper
serviceBinder *serviceCmdFakes.FakeAppBinder
appRepo *testApplication.FakeApplicationRepository
domainRepo *testapi.FakeDomainRepository
routeRepo *testapi.FakeRouteRepository
stackRepo *testStacks.FakeStackRepository
serviceRepo *testapi.FakeServiceRepo
wordGenerator *testwords.FakeWordGenerator
requirementsFactory *testreq.FakeReqFactory
authRepo *testapi.FakeAuthenticationRepository
actor *fakeactors.FakePushActor
app_files *fakeappfiles.FakeAppFiles
zipper *fakeappfiles.FakeZipper
OriginalCommandStart command_registry.Command
OriginalCommandStop command_registry.Command
OriginalCommandServiceBind command_registry.Command
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
示例3:
"github.com/cloudfoundry/cli/cf/configuration/core_config"
"github.com/cloudfoundry/cli/cf/errors"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CopySource", func() {
var (
ui *testterm.FakeUI
config core_config.ReadWriter
requirementsFactory *testreq.FakeReqFactory
authRepo *testapi.FakeAuthenticationRepository
appRepo *testApplication.FakeApplicationRepository
copyAppSourceRepo *testCopyApplication.FakeCopyApplicationSourceRepository
spaceRepo *testapi.FakeSpaceRepository
orgRepo *testorg.FakeOrganizationRepository
appRestarter *testcmd.FakeApplicationRestarter
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true}
authRepo = &testapi.FakeAuthenticationRepository{}
appRepo = &testApplication.FakeApplicationRepository{}
copyAppSourceRepo = &testCopyApplication.FakeCopyApplicationSourceRepository{}
spaceRepo = &testapi.FakeSpaceRepository{}
orgRepo = &testorg.FakeOrganizationRepository{}
appRestarter = &testcmd.FakeApplicationRestarter{}
示例4:
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/cf/commands/application"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("env command", func() {
var (
ui *testterm.FakeUI
app models.Application
appRepo *testApplication.FakeApplicationRepository
configRepo core_config.ReadWriter
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
app = models.Application{}
app.Name = "my-app"
appRepo = &testApplication.FakeApplicationRepository{}
appRepo.ReadReturns.App = app
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true}
})
示例5:
"github.com/cloudfoundry/cli/cf/models"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("set-env command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
app models.Application
appRepo *testApplication.FakeApplicationRepository
requirementsFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("set-env").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
app = models.Application{}
app.Name = "my-app"
示例6:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
"github.com/cloudfoundry/cli/testhelpers/maker"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("scale command", func() {
var (
requirementsFactory *testreq.FakeReqFactory
restarter *testcmd.FakeApplicationRestarter
appRepo *testApplication.FakeApplicationRepository
ui *testterm.FakeUI
config core_config.ReadWriter
cmd *Scale
app models.Application
)
BeforeEach(func() {
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true}
restarter = &testcmd.FakeApplicationRestarter{}
appRepo = &testApplication.FakeApplicationRepository{}
ui = new(testterm.FakeUI)
config = testconfig.NewRepositoryWithDefaults()
cmd = NewScale(ui, config, restarter, appRepo)
})
Describe("requirements", func() {
示例7:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
"github.com/cloudfoundry/cli/testhelpers/maker"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("scale command", func() {
var (
requirementsFactory *testreq.FakeReqFactory
restarter *testcmd.FakeApplicationRestarter
appRepo *testApplication.FakeApplicationRepository
ui *testterm.FakeUI
config core_config.Repository
app models.Application
OriginalCommand command_registry.Command
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.Config = config
//inject fake 'command dependency' into registry
command_registry.Register(restarter)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("scale").SetDependency(deps, pluginCall))
}
示例8:
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("start command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
defaultAppForStart = models.Application{}
defaultInstanceResponses = [][]models.AppInstanceFields{}
defaultInstanceErrorCodes = []string{"", ""}
requirementsFactory *testreq.FakeReqFactory
logsForTail []*events.LogMessage
logRepo *testapi.FakeLogsNoaaRepository
oldLogsForTail []*logmessage.LogMessage
oldLogsRepo *testapi.FakeOldLogsRepository
appInstancesRepo *testAppInstanaces.FakeAppInstancesRepository
appRepo *testApplication.FakeApplicationRepository
OriginalAppCommand command_registry.Command
deps command_registry.Dependency
displayApp *testcmd.FakeAppDisplayer
)
updateCommandDependency := func(oldLogs api.OldLogsRepository) {
deps.Ui = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetLogsNoaaRepository(logRepo)
deps.RepoLocator = deps.RepoLocator.SetOldLogsRepository(oldLogs)
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
示例9:
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("delete app command", func() {
var (
ui *testterm.FakeUI
app models.Application
configRepo core_config.Repository
appRepo *testApplication.FakeApplicationRepository
routeRepo *testapi.FakeRouteRepository
requirementsFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.RepoLocator = deps.RepoLocator.SetRouteRepository(routeRepo)
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
app = models.Application{}
示例10:
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/cf/commands/application"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("stop command", func() {
var (
ui *testterm.FakeUI
app models.Application
appRepo *testApplication.FakeApplicationRepository
requirementsFactory *testreq.FakeReqFactory
config core_config.ReadWriter
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
appRepo = &testApplication.FakeApplicationRepository{}
requirementsFactory = &testreq.FakeReqFactory{}
})
runCommand := func(args ...string) bool {
return testcmd.RunCommand(NewStop(ui, config, appRepo), args, requirementsFactory)
}
示例11:
package requirements_test
import (
testApplication "github.com/cloudfoundry/cli/cf/api/applications/fakes"
"github.com/cloudfoundry/cli/cf/errors"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/cloudfoundry/cli/cf/requirements"
testassert "github.com/cloudfoundry/cli/testhelpers/assert"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("ApplicationRequirement", func() {
var ui *testterm.FakeUI
var appRepo *testApplication.FakeApplicationRepository
BeforeEach(func() {
ui = new(testterm.FakeUI)
appRepo = &testApplication.FakeApplicationRepository{}
})
It("succeeds when an app with the given name exists", func() {
app := models.Application{}
app.Name = "my-app"
app.Guid = "my-app-guid"
appRepo.ReadReturns(app, nil)
appReq := NewApplicationRequirement("foo", ui, appRepo)
Expect(appReq.Execute()).To(BeTrue())
示例12:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/command_registry"
"github.com/cloudfoundry/cli/cf/commands/application"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("stop command", func() {
var (
ui *testterm.FakeUI
app models.Application
appRepo *testApplication.FakeApplicationRepository
requirementsFactory *testreq.FakeReqFactory
config core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.Config = config
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("stop").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
appRepo = &testApplication.FakeApplicationRepository{}
示例13:
"github.com/cloudfoundry/cli/cf/errors"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CopySource", func() {
var (
ui *testterm.FakeUI
config core_config.Repository
requirementsFactory *testreq.FakeReqFactory
authRepo *testapi.FakeAuthenticationRepository
appRepo *testApplication.FakeApplicationRepository
copyAppSourceRepo *testCopyApplication.FakeCopyApplicationSourceRepository
spaceRepo *testapi.FakeSpaceRepository
orgRepo *testorg.FakeOrganizationRepository
appRestarter *testcmd.FakeApplicationRestarter
OriginalCommand command_registry.Command
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetAuthenticationRepository(authRepo)
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)
deps.RepoLocator = deps.RepoLocator.SetCopyApplicationSourceRepository(copyAppSourceRepo)
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
deps.Config = config
示例14:
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Push Command", func() {
var (
ui *testterm.FakeUI
configRepo core_config.Repository
manifestRepo *testmanifest.FakeManifestRepository
starter *testcmd.FakeApplicationStarter
stopper *testcmd.FakeApplicationStopper
serviceBinder *testcmd.FakeAppBinder
appRepo *testApplication.FakeApplicationRepository
domainRepo *testapi.FakeDomainRepository
routeRepo *testapi.FakeRouteRepository
stackRepo *testStacks.FakeStackRepository
serviceRepo *testapi.FakeServiceRepo
wordGenerator *testwords.FakeWordGenerator
requirementsFactory *testreq.FakeReqFactory
authRepo *testapi.FakeAuthenticationRepository
actor *fakeactors.FakePushActor
app_files *fakeappfiles.FakeAppFiles
zipper *fakeappfiles.FakeZipper
OriginalCommandStart command_registry.Command
OriginalCommandStop command_registry.Command
OriginalCommandServiceBind command_registry.Command
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
示例15:
"github.com/cloudfoundry/cli/cf/models"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("disable-ssh command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
appRepo *testApplication.FakeApplicationRepository
configRepo core_config.Repository
deps command_registry.Dependency
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{}
appRepo = &testApplication.FakeApplicationRepository{}
})
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.Config = configRepo
deps.RepoLocator = deps.RepoLocator.SetApplicationRepository(appRepo)