• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang fake_receptor.FakeClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/cloudfoundry-incubator/receptor/fake_receptor.FakeClient的典型用法代码示例。如果您正苦于以下问题:Golang FakeClient类的具体用法?Golang FakeClient怎么用?Golang FakeClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了FakeClient类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1:

	"github.com/onsi/gomega/ghttp"

	config_package "github.com/cloudfoundry-incubator/ltc/config"
	"github.com/cloudfoundry-incubator/ltc/receptor_client/fake_receptor_client_creator"
	"github.com/cloudfoundry-incubator/ltc/version"
	"github.com/cloudfoundry-incubator/ltc/version/fake_file_swapper"
	"github.com/cloudfoundry-incubator/receptor"
	"github.com/cloudfoundry-incubator/receptor/fake_receptor"
)

var _ = Describe("VersionManager", func() {
	var (
		fakeFileSwapper           *fake_file_swapper.FakeFileSwapper
		fakeServer                *ghttp.Server
		config                    *config_package.Config
		versionManager            version.VersionManager
		fakeReceptorClientCreator *fake_receptor_client_creator.FakeCreator
		fakeReceptorClient        *fake_receptor.FakeClient

		ltcTempFile *os.File
	)

	BeforeEach(func() {
		fakeFileSwapper = &fake_file_swapper.FakeFileSwapper{}

		fakeServer = ghttp.NewServer()
		fakeServerURL, err := url.Parse(fakeServer.URL())
		Expect(err).NotTo(HaveOccurred())

		fakeServerHost, fakeServerPort, err := net.SplitHostPort(fakeServerURL.Host)
		Expect(err).NotTo(HaveOccurred())
开发者ID:cloudfoundry-incubator,项目名称:ltc,代码行数:31,代码来源:version_manager_test.go


示例2:

	. "github.com/onsi/gomega"

	"github.com/cloudfoundry-incubator/bbs/models"
	"github.com/cloudfoundry-incubator/ltc/app_runner"
	"github.com/cloudfoundry-incubator/ltc/app_runner/fake_keygen"
	"github.com/cloudfoundry-incubator/ltc/logs/reserved_app_ids"
	"github.com/cloudfoundry-incubator/ltc/route_helpers"
	"github.com/cloudfoundry-incubator/receptor"
	"github.com/cloudfoundry-incubator/receptor/fake_receptor"
)

var _ = Describe("AppRunner", func() {

	var (
		fakeReceptorClient *fake_receptor.FakeClient
		fakeKeyGenerator   *fake_keygen.FakeKeyGenerator
		appRunner          app_runner.AppRunner
	)

	BeforeEach(func() {
		fakeReceptorClient = &fake_receptor.FakeClient{}
		fakeKeyGenerator = &fake_keygen.FakeKeyGenerator{}
		appRunner = app_runner.New(fakeReceptorClient, "myDiegoInstall.com", fakeKeyGenerator)

		fakeKeyGenerator.GenerateRSAPrivateKeyReturns("THIS IS A PRIVATE HOST KEY", nil)
		fakeKeyGenerator.GenerateRSAKeyPairReturns("THIS IS A PRIVATE KEY", "THIS IS A PUBLIC KEY", nil)
	})

	Describe("CreateApp", func() {
		var createAppParams app_runner.CreateAppParams
开发者ID:davidwadden,项目名称:ltc,代码行数:30,代码来源:app_runner_test.go


示例3:

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/cloudfoundry-incubator/lattice/ltc/task_examiner"
	"github.com/cloudfoundry-incubator/lattice/ltc/task_examiner/fake_task_examiner"
	"github.com/cloudfoundry-incubator/lattice/ltc/task_runner"
	"github.com/cloudfoundry-incubator/receptor"
	"github.com/cloudfoundry-incubator/receptor/fake_receptor"
	"github.com/cloudfoundry-incubator/runtime-schema/models"
)

var _ = Describe("TaskRunner", func() {
	var (
		fakeReceptorClient *fake_receptor.FakeClient
		taskRunner         task_runner.TaskRunner
		fakeTaskExaminer   *fake_task_examiner.FakeTaskExaminer
	)

	BeforeEach(func() {
		fakeReceptorClient = &fake_receptor.FakeClient{}
		fakeTaskExaminer = &fake_task_examiner.FakeTaskExaminer{}
		taskRunner = task_runner.New(fakeReceptorClient, fakeTaskExaminer)
	})

	Describe("CreateTask", func() {
		var (
			action             models.Action
			securityGroupRules []models.SecurityGroupRule
			createTaskParams   task_runner.CreateTaskParams
		)
开发者ID:rowhit,项目名称:lattice,代码行数:30,代码来源:task_runner_test.go


示例4:

package task_examiner_test

import (
	"errors"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/cloudfoundry-incubator/lattice/ltc/task_examiner"
	"github.com/cloudfoundry-incubator/receptor"
	"github.com/cloudfoundry-incubator/receptor/fake_receptor"
)

var _ = Describe("TaskExaminer", func() {
	var (
		fakeReceptorClient *fake_receptor.FakeClient
		taskExaminer       task_examiner.TaskExaminer
	)

	BeforeEach(func() {
		fakeReceptorClient = &fake_receptor.FakeClient{}
		taskExaminer = task_examiner.New(fakeReceptorClient)
	})

	Describe("TaskStatus", func() {
		BeforeEach(func() {
			getTaskResponse := receptor.TaskResponse{
				TaskGuid:      "boop",
				State:         receptor.TaskStateCompleted,
				CellID:        "cell-01",
				Failed:        false,
				FailureReason: "",
开发者ID:shanetreacy,项目名称:lattice,代码行数:32,代码来源:task_examiner_test.go


示例5:

	"errors"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/cloudfoundry-incubator/lattice/ltc/config/target_verifier"
	"github.com/cloudfoundry-incubator/lattice/ltc/receptor_client/fake_receptor_client_creator"
	"github.com/cloudfoundry-incubator/receptor"
	"github.com/cloudfoundry-incubator/receptor/fake_receptor"
)

var _ = Describe("TargetVerifier", func() {
	Describe("VerifyTarget", func() {
		var (
			fakeReceptorClient        *fake_receptor.FakeClient
			fakeReceptorClientCreator *fake_receptor_client_creator.FakeCreator
			targetVerifier            target_verifier.TargetVerifier
		)

		BeforeEach(func() {
			fakeReceptorClient = &fake_receptor.FakeClient{}
			fakeReceptorClientCreator = &fake_receptor_client_creator.FakeCreator{}
			fakeReceptorClientCreator.CreateReceptorClientReturns(fakeReceptorClient)
			targetVerifier = target_verifier.New(fakeReceptorClientCreator)
		})

		It("returns up=true, auth=true if the receptor does not return an error", func() {
			up, auth, err := targetVerifier.VerifyTarget("http://receptor.mylattice.com")
			Expect(err).NotTo(HaveOccurred())
			Expect(up).To(BeTrue())
			Expect(auth).To(BeTrue())
开发者ID:davidwadden,项目名称:lattice-release,代码行数:31,代码来源:target_verifier_test.go


示例6:

	. "github.com/onsi/gomega"

	"github.com/cloudfoundry-incubator/bbs/models"
	"github.com/cloudfoundry-incubator/ltc/app_examiner"
	"github.com/cloudfoundry-incubator/ltc/app_examiner/fake_noaa_consumer"
	"github.com/cloudfoundry-incubator/ltc/route_helpers"
	"github.com/cloudfoundry-incubator/receptor"
	"github.com/cloudfoundry-incubator/receptor/fake_receptor"
	"github.com/cloudfoundry/sonde-go/events"
)

var _ = Describe("AppExaminer", func() {

	var (
		fakeReceptorClient *fake_receptor.FakeClient
		fakeNoaaConsumer   *fake_noaa_consumer.FakeNoaaConsumer
		appExaminer        app_examiner.AppExaminer
	)

	BeforeEach(func() {
		fakeReceptorClient = &fake_receptor.FakeClient{}
		fakeNoaaConsumer = &fake_noaa_consumer.FakeNoaaConsumer{}
		appExaminer = app_examiner.New(fakeReceptorClient, fakeNoaaConsumer)
	})

	Describe("ListApps", func() {
		Context("with the receptor returning both desiredlrps and actuallrps", func() {
			BeforeEach(func() {
				desiredLrps := []receptor.DesiredLRPResponse{
					{
						ProcessGuid: "process2-scalingDown",
开发者ID:SrinivasChilveri,项目名称:ltc,代码行数:31,代码来源:app_examiner_test.go


示例7:

	"github.com/cloudfoundry-incubator/diego-ssh/test_helpers/fake_ssh"
	"github.com/cloudfoundry-incubator/receptor"
	"github.com/cloudfoundry-incubator/receptor/fake_receptor"
	"github.com/pivotal-golang/lager/lagertest"
	"golang.org/x/crypto/ssh"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("DiegoProxyAuthenticator", func() {
	var (
		receptorClient     *fake_receptor.FakeClient
		expectedRoute      routes.SSHRoute
		desiredLRPResponse receptor.DesiredLRPResponse
		actualLrpResponse  receptor.ActualLRPResponse
		authenticator      *authenticators.DiegoProxyAuthenticator
		logger             *lagertest.TestLogger
		receptorCreds      []byte
		metadata           *fake_ssh.FakeConnMetadata
	)

	BeforeEach(func() {
		receptorClient = new(fake_receptor.FakeClient)

		expectedRoute = routes.SSHRoute{
			ContainerPort:   1111,
			PrivateKey:      "pem-encoded-key",
			HostFingerprint: "host-fingerprint",
			User:            "user",
			Password:        "password",
		}
开发者ID:sykesm,项目名称:diego-ssh,代码行数:32,代码来源:diego_proxy_authenticator_test.go


示例8:

	. "github.com/cloudfoundry-incubator/lattice/ltc/test_helpers/matchers"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/cloudfoundry-incubator/lattice/ltc/app_runner"
	"github.com/cloudfoundry-incubator/lattice/ltc/logs/reserved_app_ids"
	"github.com/cloudfoundry-incubator/lattice/ltc/route_helpers"
	"github.com/cloudfoundry-incubator/receptor"
	"github.com/cloudfoundry-incubator/receptor/fake_receptor"
	"github.com/cloudfoundry-incubator/runtime-schema/models"
)

var _ = Describe("AppRunner", func() {

	var (
		fakeReceptorClient *fake_receptor.FakeClient
		appRunner          app_runner.AppRunner
	)

	BeforeEach(func() {
		fakeReceptorClient = &fake_receptor.FakeClient{}
		appRunner = app_runner.New(fakeReceptorClient, "myDiegoInstall.com")
	})

	Describe("CreateApp", func() {
		It("Upserts lattice domain so that it is always fresh, then starts the Docker App", func() {
			args := []string{"app", "arg1", "--app", "arg 2"}
			envs := map[string]string{"APPROOT": "/root/env/path"}
			err := appRunner.CreateApp(app_runner.CreateAppParams{
				AppEnvironmentParams: app_runner.AppEnvironmentParams{
					EnvironmentVariables: envs,
					Privileged:           false,
开发者ID:rajkumargithub,项目名称:lattice,代码行数:32,代码来源:app_runner_test.go



注:本文中的github.com/cloudfoundry-incubator/receptor/fake_receptor.FakeClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang rep.NewResource函数代码示例发布时间:2022-05-23
下一篇:
Golang receptor.DesiredLRPCreateRequest类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap