本文整理匯總了Golang中github.com/cloudfoundry-incubator/runtime-schema/bbs/fake_bbs.FakeReceptorBBS類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeReceptorBBS類的具體用法?Golang FakeReceptorBBS怎麽用?Golang FakeReceptorBBS使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeReceptorBBS類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
"github.com/cloudfoundry-incubator/runtime-schema/models"
"github.com/pivotal-golang/lager"
"github.com/tedsuo/ifrit"
"github.com/tedsuo/ifrit/ginkgomon"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/ghttp"
)
var _ = Describe("TaskWorker", func() {
var (
fakeBBS *fake_bbs.FakeReceptorBBS
enqueue chan<- models.Task
process ifrit.Process
fakeServer *ghttp.Server
logger lager.Logger
timeout time.Duration
)
BeforeEach(func() {
timeout = 1 * time.Second
cf_http.Initialize(timeout)
fakeServer = ghttp.NewServer()
logger = lager.NewLogger("task-watcher-test")
logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.INFO))
fakeBBS = new(fake_bbs.FakeReceptorBBS)
示例2:
oldmodels "github.com/cloudfoundry-incubator/runtime-schema/models"
"github.com/gogo/protobuf/proto"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/pivotal-golang/lager"
)
var _ = Describe("Actual LRP Handlers", func() {
var (
logger lager.Logger
fakeLegacyBBS *fake_legacy_bbs.FakeReceptorBBS
fakeBBS *fake_bbs.FakeClient
responseRecorder *httptest.ResponseRecorder
handler *handlers.ActualLRPHandler
oldActualLRP1 oldmodels.ActualLRP
oldActualLRP2 oldmodels.ActualLRP
oldEvacuatingLRP2 oldmodels.ActualLRP
actualLRP1 models.ActualLRP
actualLRP2 models.ActualLRP
evacuatingLRP2 models.ActualLRP
)
BeforeEach(func() {
fakeLegacyBBS = new(fake_legacy_bbs.FakeReceptorBBS)
fakeBBS = new(fake_bbs.FakeClient)
logger = lager.NewLogger("test")
logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))
responseRecorder = httptest.NewRecorder()
handler = handlers.NewActualLRPHandler(fakeBBS, fakeLegacyBBS, logger)
示例3:
"net/url"
"github.com/cloudfoundry-incubator/receptor"
"github.com/cloudfoundry-incubator/receptor/handlers"
"github.com/cloudfoundry-incubator/runtime-schema/bbs/bbserrors"
"github.com/cloudfoundry-incubator/runtime-schema/bbs/fake_bbs"
"github.com/cloudfoundry-incubator/runtime-schema/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/pivotal-golang/lager"
)
var _ = Describe("Desired LRP Handlers", func() {
var (
logger lager.Logger
fakeBBS *fake_bbs.FakeReceptorBBS
responseRecorder *httptest.ResponseRecorder
handler *handlers.DesiredLRPHandler
)
BeforeEach(func() {
fakeBBS = new(fake_bbs.FakeReceptorBBS)
logger = lager.NewLogger("test")
logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))
responseRecorder = httptest.NewRecorder()
handler = handlers.NewDesiredLRPHandler(fakeBBS, logger)
})
Describe("Create", func() {
validCreateLRPRequest := receptor.DesiredLRPCreateRequest{
ProcessGuid: "the-process-guid",
Domain: "the-domain",
示例4:
"github.com/cloudfoundry-incubator/bbs/models"
"github.com/cloudfoundry-incubator/receptor"
"github.com/cloudfoundry-incubator/receptor/handlers"
"github.com/cloudfoundry-incubator/runtime-schema/bbs/bbserrors"
fake_legacy_bbs "github.com/cloudfoundry-incubator/runtime-schema/bbs/fake_bbs"
oldmodels "github.com/cloudfoundry-incubator/runtime-schema/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/pivotal-golang/lager"
)
var _ = Describe("Desired LRP Handlers", func() {
var (
logger lager.Logger
fakeLegacyBBS *fake_legacy_bbs.FakeReceptorBBS
fakeBBS *fake_bbs.FakeClient
responseRecorder *httptest.ResponseRecorder
handler *handlers.DesiredLRPHandler
)
BeforeEach(func() {
fakeLegacyBBS = new(fake_legacy_bbs.FakeReceptorBBS)
fakeBBS = new(fake_bbs.FakeClient)
logger = lager.NewLogger("test")
logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))
responseRecorder = httptest.NewRecorder()
handler = handlers.NewDesiredLRPHandler(fakeBBS, fakeLegacyBBS, logger)
})
Describe("Create", func() {
validCreateLRPRequest := receptor.DesiredLRPCreateRequest{
示例5:
"github.com/cloudfoundry-incubator/receptor/serialization"
fake_legacy_bbs "github.com/cloudfoundry-incubator/runtime-schema/bbs/fake_bbs"
oldmodels "github.com/cloudfoundry-incubator/runtime-schema/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/pivotal-golang/lager"
)
var _ = Describe("Actual LRP Handlers", func() {
var (
logger lager.Logger
fakeLegacyBBS *fake_legacy_bbs.FakeReceptorBBS
fakeBBS *fake_bbs.FakeClient
responseRecorder *httptest.ResponseRecorder
handler *handlers.ActualLRPHandler
oldActualLRP2 oldmodels.ActualLRP
oldEvacuatingLRP2 oldmodels.ActualLRP
actualLRP1 *models.ActualLRP
actualLRP2 *models.ActualLRP
evacuatingLRP2 *models.ActualLRP
)
BeforeEach(func() {
fakeLegacyBBS = new(fake_legacy_bbs.FakeReceptorBBS)
fakeBBS = new(fake_bbs.FakeClient)
logger = lager.NewLogger("test")
logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))
responseRecorder = httptest.NewRecorder()
handler = handlers.NewActualLRPHandler(fakeBBS, fakeLegacyBBS, logger)
示例6:
)
var _ = Describe("Watcher", func() {
const (
expectedProcessGuid = "some-process-guid"
expectedInstanceGuid = "some-instance-guid"
retryWaitDuration = 50 * time.Millisecond
)
var (
bbs *fake_bbs.FakeReceptorBBS
hub *eventfakes.FakeHub
clock *fakeclock.FakeClock
receptorWatcher watcher.Watcher
process ifrit.Process
desiredLRPStop chan bool
desiredLRPErrors chan error
actualLRPStop chan bool
actualLRPErrors chan error
)
BeforeEach(func() {
bbs = new(fake_bbs.FakeReceptorBBS)
hub = new(eventfakes.FakeHub)
clock = fakeclock.NewFakeClock(time.Now())
logger := lagertest.NewTestLogger("test")
desiredLRPStop = make(chan bool, 1)
desiredLRPErrors = make(chan error)
示例7:
"net/http/httptest"
"github.com/cloudfoundry-incubator/receptor"
"github.com/cloudfoundry-incubator/receptor/handlers"
"github.com/cloudfoundry-incubator/receptor/serialization"
"github.com/cloudfoundry-incubator/runtime-schema/bbs/fake_bbs"
"github.com/cloudfoundry-incubator/runtime-schema/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/pivotal-golang/lager"
)
var _ = Describe("Cell Handlers", func() {
var (
logger lager.Logger
fakeBBS *fake_bbs.FakeReceptorBBS
responseRecorder *httptest.ResponseRecorder
handler *handlers.CellHandler
)
BeforeEach(func() {
fakeBBS = new(fake_bbs.FakeReceptorBBS)
logger = lager.NewLogger("test")
logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))
responseRecorder = httptest.NewRecorder()
handler = handlers.NewCellHandler(fakeBBS, logger)
})
Describe("GetAll", func() {
var cellPresences []models.CellPresence
BeforeEach(func() {
示例8:
"github.com/cloudfoundry-incubator/receptor"
"github.com/cloudfoundry-incubator/receptor/handlers"
"github.com/cloudfoundry-incubator/runtime-schema/bbs/bbserrors"
"github.com/cloudfoundry-incubator/runtime-schema/bbs/fake_bbs"
"github.com/cloudfoundry-incubator/runtime-schema/models"
"github.com/pivotal-golang/lager"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("TaskHandler", func() {
var (
logger lager.Logger
fakeBBS *fake_bbs.FakeReceptorBBS
responseRecorder *httptest.ResponseRecorder
handler *handlers.TaskHandler
request *http.Request
)
BeforeEach(func() {
fakeBBS = new(fake_bbs.FakeReceptorBBS)
logger = lager.NewLogger("test")
logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))
responseRecorder = httptest.NewRecorder()
handler = handlers.NewTaskHandler(fakeBBS, logger)
})
Describe("Create", func() {
validCreateRequest := receptor.TaskCreateRequest{
TaskGuid: "task-guid-1",
示例9:
"net/http/httptest"
"net/url"
"github.com/cloudfoundry-incubator/receptor"
"github.com/cloudfoundry-incubator/receptor/handlers"
"github.com/cloudfoundry-incubator/runtime-schema/bbs/fake_bbs"
"github.com/cloudfoundry-incubator/runtime-schema/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/pivotal-golang/lager"
)
var _ = Describe("Domain Handlers", func() {
var (
logger lager.Logger
fakeBBS *fake_bbs.FakeReceptorBBS
responseRecorder *httptest.ResponseRecorder
handler *handlers.DomainHandler
)
BeforeEach(func() {
fakeBBS = new(fake_bbs.FakeReceptorBBS)
logger = lager.NewLogger("test")
logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))
responseRecorder = httptest.NewRecorder()
handler = handlers.NewDomainHandler(fakeBBS, logger)
})
Describe("Upsert", func() {
var domain string
var ttlInSeconds int