當前位置: 首頁>>代碼示例>>Golang>>正文


Golang fake_bbs.FakeClient類代碼示例

本文整理匯總了Golang中github.com/cloudfoundry-incubator/bbs/fake_bbs.FakeClient的典型用法代碼示例。如果您正苦於以下問題:Golang FakeClient類的具體用法?Golang FakeClient怎麽用?Golang FakeClient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了FakeClient類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的github.com/cloudfoundry-incubator/bbs/fake_bbs.FakeClient類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。