本文整理汇总了Golang中github.com/cloudfoundry-incubator/bbs/models.ActualLRPKey类的典型用法代码示例。如果您正苦于以下问题:Golang ActualLRPKey类的具体用法?Golang ActualLRPKey怎么用?Golang ActualLRPKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ActualLRPKey类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
Context("when the ErrorMessage is blank", func() {
BeforeEach(func() {
request.ErrorMessage = ""
})
It("returns a validation error", func() {
Expect(request.Validate()).To(ConsistOf(models.ErrInvalidField{"error_message"}))
})
})
})
})
Describe("ActualLRPKey", func() {
Describe("Validate", func() {
var actualLRPKey models.ActualLRPKey
BeforeEach(func() {
actualLRPKey = models.NewActualLRPKey("process-guid", 1, "domain")
})
Context("when valid", func() {
It("returns nil", func() {
Expect(actualLRPKey.Validate()).To(BeNil())
})
})
Context("when the ProcessGuid is blank", func() {
BeforeEach(func() {
actualLRPKey.ProcessGuid = ""
})
示例2:
Expect(claimErr).To(Equal(models.ErrResourceNotFound))
})
It("does not create an actual LRP", func() {
_, err := etcdDB.ActualLRPGroupByProcessGuidAndIndex(logger, "process-guid", 1)
Expect(err).To(HaveOccurred())
})
})
})
Describe("StartActualLRP", func() {
var (
startErr *models.Error
request models.StartActualLRPRequest
startedActualLRP *models.ActualLRP
lrpKey models.ActualLRPKey
instanceKey models.ActualLRPInstanceKey
netInfo models.ActualLRPNetInfo
)
JustBeforeEach(func() {
request.ActualLrpKey = &lrpKey
request.ActualLrpInstanceKey = &instanceKey
request.ActualLrpNetInfo = &netInfo
startedActualLRP, startErr = etcdDB.StartActualLRP(logger, &request)
})
Context("when the actual LRP exists", func() {
var (
processGuid string
示例3:
"github.com/cloudfoundry-incubator/executor"
"github.com/cloudfoundry-incubator/rep"
"github.com/cloudfoundry-incubator/rep/generator"
"github.com/cloudfoundry-incubator/rep/generator/internal"
"github.com/cloudfoundry-incubator/rep/generator/internal/fake_internal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gbytes"
)
var _ = Describe("Operation", func() {
Describe("ResidualInstanceLRPOperation", func() {
var (
containerDelegate *fake_internal.FakeContainerDelegate
residualLRPOperation *generator.ResidualInstanceLRPOperation
lrpKey models.ActualLRPKey
instanceKey models.ActualLRPInstanceKey
expectedContainerGuid string
)
BeforeEach(func() {
lrpKey = models.NewActualLRPKey("the-process-guid", 0, "the-domain")
instanceKey = models.NewActualLRPInstanceKey("the-instance-guid", "the-cell-id")
containerDelegate = new(fake_internal.FakeContainerDelegate)
residualLRPOperation = generator.NewResidualInstanceLRPOperation(logger, fakeBBS, containerDelegate, lrpKey, instanceKey)
expectedContainerGuid = rep.LRPContainerGuid(lrpKey.GetProcessGuid(), instanceKey.GetInstanceGuid())
})
Describe("Key", func() {
It("returns the InstanceGuid", func() {
示例4:
"github.com/cloudfoundry-incubator/bbs/models"
"github.com/cloudfoundry-incubator/receptor"
"github.com/cloudfoundry-incubator/receptor/serialization"
"github.com/cloudfoundry-incubator/runtime-schema/bbs/bbserrors"
oldmodels "github.com/cloudfoundry-incubator/runtime-schema/models"
"github.com/tedsuo/ifrit/ginkgomon"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Actual LRP API", func() {
const lrpCount = 6
var (
evacuatingLRPKey models.ActualLRPKey
oldEvacuatingLRPKey oldmodels.ActualLRPKey
)
BeforeEach(func() {
receptorProcess = ginkgomon.Invoke(receptorRunner)
for i := 0; i < lrpCount; i++ {
index := strconv.Itoa(i)
lrpKey := oldmodels.NewActualLRPKey(
"process-guid-"+index,
i,
fmt.Sprintf("domain-%d", i/2),
)
instanceKey := oldmodels.NewActualLRPInstanceKey(
"instance-guid-"+index,
"cell-id",