本文整理汇总了Golang中github.com/cloudfoundry/bosh-agent/agent/applier/fakes.FakeApplier.ConfiguredError方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeApplier.ConfiguredError方法的具体用法?Golang FakeApplier.ConfiguredError怎么用?Golang FakeApplier.ConfiguredError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/bosh-agent/agent/applier/fakes.FakeApplier
的用法示例。
在下文中一共展示了FakeApplier.ConfiguredError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: init
func init() {
Describe("Start", func() {
var (
jobSupervisor *fakejobsuper.FakeJobSupervisor
applier *fakeappl.FakeApplier
specService *fakeas.FakeV1Service
action StartAction
)
BeforeEach(func() {
jobSupervisor = fakejobsuper.NewFakeJobSupervisor()
applier = fakeappl.NewFakeApplier()
specService = fakeas.NewFakeV1Service()
action = NewStart(jobSupervisor, applier, specService)
})
It("is synchronous", func() {
Expect(action.IsAsynchronous()).To(BeFalse())
})
It("is not persistent", func() {
Expect(action.IsPersistent()).To(BeFalse())
})
It("returns started", func() {
started, err := action.Run()
Expect(err).ToNot(HaveOccurred())
Expect(started).To(Equal("started"))
})
It("starts monitor services", func() {
_, err := action.Run()
Expect(err).ToNot(HaveOccurred())
Expect(jobSupervisor.Started).To(BeTrue())
})
It("configures jobs", func() {
_, err := action.Run()
Expect(err).ToNot(HaveOccurred())
Expect(applier.Configured).To(BeTrue())
})
It("apply errs if a job fails configuring", func() {
applier.ConfiguredError = errors.New("fake error")
_, err := action.Run()
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("Configuring jobs"))
})
})
}
示例2: init
func init() {
Describe("Start", func() {
var (
jobSupervisor *fakejobsuper.FakeJobSupervisor
applier *fakeappl.FakeApplier
specService *fakeas.FakeV1Service
platform *fakeplatform.FakePlatform
settingsService *fakesettings.FakeSettingsService
logger boshlog.Logger
dualDCSupport *nimbus.DualDCSupport
action StartAction
)
BeforeEach(func() {
jobSupervisor = fakejobsuper.NewFakeJobSupervisor()
applier = fakeappl.NewFakeApplier()
specService = fakeas.NewFakeV1Service()
action = NewStart(jobSupervisor, applier, specService, dualDCSupport, platform)
platform = fakeplatform.NewFakePlatform()
logger = boshlog.NewLogger(boshlog.LevelNone)
settingsService = &fakesettings.FakeSettingsService{}
dualDCSupport = nimbus.NewDualDCSupport(
platform.GetRunner(),
platform.GetFs(),
platform.GetDirProvider(),
specService,
settingsService,
logger,
)
action = NewStart(jobSupervisor, applier, specService, dualDCSupport, platform)
})
It("is synchronous", func() {
Expect(action.IsAsynchronous()).To(BeFalse())
})
It("is not persistent", func() {
Expect(action.IsPersistent()).To(BeFalse())
})
It("returns started", func() {
started, err := action.Run()
Expect(err).ToNot(HaveOccurred())
Expect(started).To(Equal("started"))
})
It("starts monitor services", func() {
_, err := action.Run()
Expect(err).ToNot(HaveOccurred())
Expect(jobSupervisor.Started).To(BeTrue())
})
It("configures jobs", func() {
_, err := action.Run()
Expect(err).ToNot(HaveOccurred())
Expect(applier.Configured).To(BeTrue())
})
It("apply errs if a job fails configuring", func() {
applier.ConfiguredError = errors.New("fake error")
_, err := action.Run()
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("Configuring jobs"))
})
})
}