本文整理汇总了Golang中github.com/cloudfoundry-incubator/bbs/fake_bbs.FakeClient类的典型用法代码示例。如果您正苦于以下问题:Golang FakeClient类的具体用法?Golang FakeClient怎么用?Golang FakeClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1:
var _ = Describe("EvacuationLrpProcessor", func() {
Describe("Process", func() {
const (
localCellID = "cell-α"
evacuationTTL = 1234
)
var (
logger *lagertest.TestLogger
fakeBBS *fake_bbs.FakeClient
fakeContainerDelegate *fake_internal.FakeContainerDelegate
fakeEvacuationReporter *fake_evacuation_context.FakeEvacuationReporter
lrpProcessor internal.LRPProcessor
processGuid string
desiredLRP models.DesiredLRP
index int
container executor.Container
instanceGuid string
lrpKey models.ActualLRPKey
lrpInstanceKey models.ActualLRPInstanceKey
)
BeforeEach(func() {
logger = lagertest.NewTestLogger("test")
fakeBBS = new(fake_bbs.FakeClient)
fakeContainerDelegate = &fake_internal.FakeContainerDelegate{}
开发者ID:jiangytcn,项目名称:rep,代码行数:31,代码来源:evacuation_lrp_processor_test.go
示例2:
processGuid = "process-guid-1"
containerPort = 8080
instanceGuid = "instance-guid-1"
lrpHost = "1.2.3.4"
)
var (
bbsClient *fake_bbs.FakeClient
natsClient *diegonats.FakeNATSClient
syncerRunner *syncer.Syncer
process ifrit.Process
syncMessages routing_table.MessagesToEmit
messagesToEmit routing_table.MessagesToEmit
clock *fakeclock.FakeClock
clockStep time.Duration
syncInterval time.Duration
shutdown chan struct{}
schedulingInfoResponse *models.DesiredLRPSchedulingInfo
actualResponses []*models.ActualLRPGroup
routerStartMessages chan<- *nats.Msg
fakeMetricSender *fake_metrics_sender.FakeMetricSender
)
BeforeEach(func() {
bbsClient = new(fake_bbs.FakeClient)
natsClient = diegonats.NewFakeClient()
clock = fakeclock.NewFakeClock(time.Now())
开发者ID:emc-xchallenge,项目名称:route-emitter,代码行数:31,代码来源:syncer_test.go
示例3:
"github.com/pivotal-golang/lager/lagertest"
"github.com/tedsuo/ifrit"
"github.com/tedsuo/ifrit/ginkgomon"
)
var _ = Describe("Processor", func() {
var (
fingerprintsToFetch []cc_messages.CCDesiredAppFingerprint
existingSchedulingInfos []*models.DesiredLRPSchedulingInfo
bbsClient *fake_bbs.FakeClient
fetcher *fakes.FakeFetcher
buildpackRecipeBuilder *fakes.FakeRecipeBuilder
dockerRecipeBuilder *fakes.FakeRecipeBuilder
processor ifrit.Runner
process ifrit.Process
syncDuration time.Duration
metricSender *fake.FakeMetricSender
clock *fakeclock.FakeClock
pollingInterval time.Duration
logger *lagertest.TestLogger
)
BeforeEach(func() {
metricSender = fake.NewFakeMetricSender()
metrics.Initialize(metricSender, nil)
syncDuration = 900900
开发者ID:emc-xchallenge,项目名称:nsync,代码行数:32,代码来源:processor_test.go
示例4:
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)
开发者ID:se77en,项目名称:lattice,代码行数:31,代码来源:actual_lrp_handlers_test.go
示例5:
"net/url"
"github.com/cloudfoundry-incubator/bbs/fake_bbs"
"github.com/cloudfoundry-incubator/bbs/models"
"github.com/cloudfoundry-incubator/nsync/handlers"
"github.com/pivotal-golang/lager/lagertest"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("StopAppHandler", func() {
var (
logger *lagertest.TestLogger
fakeBBS *fake_bbs.FakeClient
request *http.Request
responseRecorder *httptest.ResponseRecorder
)
BeforeEach(func() {
logger = lagertest.NewTestLogger("test")
fakeBBS = new(fake_bbs.FakeClient)
responseRecorder = httptest.NewRecorder()
var err error
request, err = http.NewRequest("DELETE", "", nil)
Expect(err).NotTo(HaveOccurred())
request.Form = url.Values{
":process_guid": []string{"process-guid"},
开发者ID:emc-xchallenge,项目名称:nsync,代码行数:31,代码来源:stop_app_handler_test.go
示例6:
"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)
开发者ID:rowhit,项目名称:lattice,代码行数:31,代码来源:actual_lrp_handlers_test.go
示例7:
"github.com/cloudfoundry/dropsonde/metric_sender/fake"
"github.com/cloudfoundry/dropsonde/metrics"
"github.com/pivotal-golang/lager/lagertest"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
)
var _ = Describe("DesireAppHandler", func() {
var (
logger *lagertest.TestLogger
fakeBBS *fake_bbs.FakeClient
buildpackBuilder *fakes.FakeRecipeBuilder
dockerBuilder *fakes.FakeRecipeBuilder
desireAppRequest cc_messages.DesireAppRequestFromCC
metricSender *fake.FakeMetricSender
request *http.Request
responseRecorder *httptest.ResponseRecorder
)
BeforeEach(func() {
var err error
logger = lagertest.NewTestLogger("test")
fakeBBS = new(fake_bbs.FakeClient)
buildpackBuilder = new(fakes.FakeRecipeBuilder)
dockerBuilder = new(fakes.FakeRecipeBuilder)
routingInfo, err := cc_messages.CCHTTPRoutes{
开发者ID:cf-routing,项目名称:nsync,代码行数:31,代码来源:desire_app_handler_test.go
示例8:
"github.com/cloudfoundry-incubator/bbs/fake_bbs"
"github.com/cloudfoundry-incubator/bbs/models"
"github.com/cloudfoundry-incubator/nsync/handlers"
"github.com/pivotal-golang/lager/lagertest"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
)
var _ = Describe("CancelTaskHandler", func() {
var (
logger *lagertest.TestLogger
fakeBBSClient *fake_bbs.FakeClient
request *http.Request
responseRecorder *httptest.ResponseRecorder
)
BeforeEach(func() {
var err error
logger = lagertest.NewTestLogger("test")
fakeBBSClient = new(fake_bbs.FakeClient)
responseRecorder = httptest.NewRecorder()
request, err = http.NewRequest("DELETE", "", nil)
Expect(err).NotTo(HaveOccurred())
request.Form = url.Values{
开发者ID:cfibmers,项目名称:nsync,代码行数:30,代码来源:cancel_task_handler_test.go
示例9:
)
type EventHolder struct {
event models.Event
}
var nilEventHolder = EventHolder{}
var _ = Describe("Watcher", func() {
var (
eventSource *eventfakes.FakeEventSource
bbsClient *fake_bbs.FakeClient
ccClient *fakes.FakeCcClient
watcherRunner *watcher.Watcher
process ifrit.Process
logger *lagertest.TestLogger
nextErr atomic.Value
nextEvent atomic.Value
)
BeforeEach(func() {
eventSource = new(eventfakes.FakeEventSource)
bbsClient = new(fake_bbs.FakeClient)
bbsClient.SubscribeToEventsReturns(eventSource, nil)
logger = lagertest.NewTestLogger("test")
ccClient = new(fakes.FakeCcClient)
var err error
开发者ID:emc-xchallenge,项目名称:tps,代码行数:32,代码来源:watcher_test.go
示例10:
"github.com/cloudfoundry-incubator/bbs/models"
"github.com/cloudfoundry-incubator/bbs/models/internal/model_helpers"
"github.com/cloudfoundry-incubator/receptor"
"github.com/cloudfoundry-incubator/receptor/handlers"
"github.com/cloudfoundry-incubator/receptor/serialization"
"github.com/pivotal-golang/lager"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("TaskHandler", func() {
var (
logger lager.Logger
fakeClient *fake_bbs.FakeClient
responseRecorder *httptest.ResponseRecorder
handler *handlers.TaskHandler
request *http.Request
)
BeforeEach(func() {
fakeClient = &fake_bbs.FakeClient{}
logger = lager.NewLogger("test")
logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))
responseRecorder = httptest.NewRecorder()
handler = handlers.NewTaskHandler(fakeClient, logger)
})
Describe("Create", func() {
var validCreateRequest receptor.TaskCreateRequest
var expectedTask *models.Task
开发者ID:davidwadden,项目名称:lattice-release,代码行数:31,代码来源:task_handlers_test.go
示例11:
"github.com/pivotal-golang/lager"
"github.com/pivotal-golang/lager/lagertest"
"github.com/cloudfoundry-incubator/auctioneer/auctionrunnerdelegate"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Auction Runner Delegate", func() {
var (
delegate *auctionrunnerdelegate.AuctionRunnerDelegate
bbsClient *fake_bbs.FakeClient
serviceClient *fake_bbs.FakeServiceClient
metricSender *fake.FakeMetricSender
repClientFactory *repfakes.FakeClientFactory
repClient *repfakes.FakeClient
logger lager.Logger
)
BeforeEach(func() {
metricSender = fake.NewFakeMetricSender()
metrics.Initialize(metricSender, nil)
bbsClient = &fake_bbs.FakeClient{}
serviceClient = &fake_bbs.FakeServiceClient{}
repClientFactory = &repfakes.FakeClientFactory{}
repClient = &repfakes.FakeClient{}
repClientFactory.CreateClientReturns(repClient)
logger = lagertest.NewTestLogger("delegate")
开发者ID:emc-xchallenge,项目名称:auctioneer,代码行数:30,代码来源:auctionrunnerdelegate_test.go
示例12:
"github.com/cloudfoundry-incubator/nsync/handlers"
"github.com/cloudfoundry-incubator/nsync/recipebuilder"
"github.com/cloudfoundry-incubator/runtime-schema/cc_messages"
"github.com/pivotal-golang/lager/lagertest"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
)
var _ = Describe("DesireTaskHandler", func() {
var (
logger *lagertest.TestLogger
fakeBBSClient *fake_bbs.FakeClient
buildpackBuilder *fakes.FakeRecipeBuilder
taskRequest cc_messages.TaskRequestFromCC
request *http.Request
responseRecorder *httptest.ResponseRecorder
)
BeforeEach(func() {
var err error
logger = lagertest.NewTestLogger("test")
fakeBBSClient = new(fake_bbs.FakeClient)
buildpackBuilder = new(fakes.FakeRecipeBuilder)
taskRequest = cc_messages.TaskRequestFromCC{
TaskGuid: "the-task-guid",
LogGuid: "some-log-guid",
开发者ID:cf-routing,项目名称:nsync,代码行数:31,代码来源:desire_task_handler_test.go
示例13:
"github.com/cloudfoundry-incubator/receptor/task_handler"
"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.FakeClient
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.FakeClient)
开发者ID:davidwadden,项目名称:lattice-release,代码行数:31,代码来源:task_worker_test.go
示例14:
"github.com/cloudfoundry-incubator/bbs/models"
"github.com/cloudfoundry-incubator/receptor"
"github.com/cloudfoundry-incubator/receptor/handlers"
"github.com/cloudfoundry-incubator/receptor/serialization"
"github.com/pivotal-golang/lager"
"github.com/vito/go-sse/sse"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Event Stream Handlers", func() {
var (
logger lager.Logger
fakeBBS *fake_bbs.FakeClient
handler *handlers.EventStreamHandler
server *httptest.Server
)
BeforeEach(func() {
fakeBBS = new(fake_bbs.FakeClient)
logger = lager.NewLogger("test")
logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))
handler = handlers.NewEventStreamHandler(fakeBBS, logger)
})
AfterEach(func(done Done) {
if server != nil {
server.Close()
开发者ID:davidwadden,项目名称:lattice-release,代码行数:32,代码来源:event_stream_handler_test.go
示例15:
"github.com/cloudfoundry-incubator/rep/generator/internal"
"github.com/cloudfoundry-incubator/rep/generator/internal/fake_internal"
"github.com/pivotal-golang/lager/lagertest"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gbytes"
)
var _ = Describe("OrdinaryLRPProcessor", func() {
const expectedCellID = "cell-id"
var (
processor internal.LRPProcessor
logger *lagertest.TestLogger
bbsClient *fake_bbs.FakeClient
containerDelegate *fake_internal.FakeContainerDelegate
evacuationReporter *fake_evacuation_context.FakeEvacuationReporter
)
BeforeEach(func() {
bbsClient = new(fake_bbs.FakeClient)
containerDelegate = new(fake_internal.FakeContainerDelegate)
evacuationReporter = &fake_evacuation_context.FakeEvacuationReporter{}
evacuationReporter.EvacuatingReturns(false)
processor = internal.NewLRPProcessor(bbsClient, containerDelegate, expectedCellID, evacuationReporter, 124)
logger = lagertest.NewTestLogger("test")
})
Describe("Process", func() {
const sessionPrefix = "test.ordinary-lrp-processor."
开发者ID:jianhuiz,项目名称:rep,代码行数:31,代码来源:ordinary_lrp_processor_test.go
示例16:
"github.com/cloudfoundry-incubator/bbs/fake_bbs"
"github.com/cloudfoundry-incubator/receptor"
"github.com/cloudfoundry-incubator/receptor/handlers"
fake_legacy_bbs "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
fakeLegacyBBS *fake_legacy_bbs.FakeReceptorBBS
fakeBBS *fake_bbs.FakeClient
responseRecorder *httptest.ResponseRecorder
handler *handlers.DomainHandler
)
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.NewDomainHandler(fakeBBS, fakeLegacyBBS, logger)
})
Describe("Upsert", func() {
var domain string
开发者ID:davidwadden,项目名称:lattice-release,代码行数:30,代码来源:domain_handlers_test.go
示例17:
"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{
开发者ID:davidwadden,项目名称:lattice-release,代码行数:31,代码来源:desired_lrp_handlers_test.go
示例18:
)
var (
eventSource *eventfakes.FakeEventSource
bbsClient *fake_bbs.FakeClient
table *fake_routing_table.FakeRoutingTable
emitter *fake_nats_emitter.FakeNATSEmitter
syncEvents syncer.Events
clock *fakeclock.FakeClock
watcherProcess *watcher.Watcher
process ifrit.Process
expectedRoutes []string
expectedRoutingKey routing_table.RoutingKey
expectedCFRoute cfroutes.CFRoute
expectedAdditionalRoutes []string
expectedAdditionalRoutingKey routing_table.RoutingKey
expectedAdditionalCFRoute cfroutes.CFRoute
dummyMessagesToEmit routing_table.MessagesToEmit
fakeMetricSender *fake_metrics_sender.FakeMetricSender
logger *lagertest.TestLogger
nextErr atomic.Value
nextEvent atomic.Value
)
BeforeEach(func() {
开发者ID:emc-xchallenge,项目名称:route-emitter,代码行数:31,代码来源:watcher_test.go
示例19:
"github.com/pivotal-golang/lager/lagertest"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Handler", func() {
Describe("rate limiting", func() {
var (
noaaClient *fakes.FakeNoaaClient
bbsClient *fake_bbs.FakeClient
logger *lagertest.TestLogger
server *httptest.Server
fakeActualLRPResponses chan []*models.ActualLRPGroup
statsRequest *http.Request
statusRequest *http.Request
httpClient *http.Client
)
BeforeEach(func() {
var err error
var httpHandler http.Handler
httpClient = &http.Client{}
logger = lagertest.NewTestLogger("test")
bbsClient = new(fake_bbs.FakeClient)
noaaClient = &fakes.FakeNoaaClient{}
开发者ID:emc-xchallenge,项目名称:tps,代码行数:31,代码来源:handler_test.go
示例20:
"golang.org/x/crypto/ssh"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("PermissionsBuilder", func() {
Describe("Build", func() {
var (
logger *lagertest.TestLogger
expectedRoute routes.SSHRoute
desiredLRP *models.DesiredLRP
actualLRPGroup *models.ActualLRPGroup
bbsClient *fake_bbs.FakeClient
credentials []byte
metadata *fake_ssh.FakeConnMetadata
permissionsBuilder authenticators.PermissionsBuilder
permissions *ssh.Permissions
buildErr error
processGuid string
index int
)
BeforeEach(func() {
logger = lagertest.NewTestLogger("test")
expectedRoute = routes.SSHRoute{
ContainerPort: 1111,
PrivateKey: "pem-encoded-key",
HostFingerprint: "host-fingerprint",
开发者ID:benjaminharnett,项目名称:diego-ssh,代码行数:31,代码来源:permissions_builder_test.go
注:本文中的github.com/cloudfoundry-incubator/bbs/fake_bbs.FakeClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论