当前位置: 首页>>代码示例>>Golang>>正文


Golang helpers.AppUri函数代码示例

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


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

示例1: configureBroker

func configureBroker(serviceBrokerAppName, routeServiceName string) {
	brokerConfigJson := helpers.CurlApp(serviceBrokerAppName, "/config")

	var brokerConfigMap customMap

	err := json.Unmarshal([]byte(brokerConfigJson), &brokerConfigMap)
	Expect(err).NotTo(HaveOccurred())

	if routeServiceName != "" {
		routeServiceUrl := helpers.AppUri(routeServiceName, "/")
		url, err := url.Parse(routeServiceUrl)
		Expect(err).NotTo(HaveOccurred())
		url.Scheme = "https"
		routeServiceUrl = url.String()

		brokerConfigMap.key("behaviors").key("bind").key("default").key("body")["route_service_url"] = routeServiceUrl
	} else {
		body := brokerConfigMap.key("behaviors").key("bind").key("default").key("body")
		delete(body, "route_service_url")
	}
	changedJson, err := json.Marshal(brokerConfigMap)
	Expect(err).NotTo(HaveOccurred())

	helpers.CurlApp(serviceBrokerAppName, "/config", "-X", "POST", "-d", string(changedJson))
}
开发者ID:cf-routing,项目名称:cf-acceptance-tests,代码行数:25,代码来源:route_services_test.go

示例2: createServiceBroker

func createServiceBroker() (string, string, string) {
	serviceBrokerAsset := assets.NewAssets().ServiceBroker
	serviceBrokerAppName := PushApp(serviceBrokerAsset, config.RubyBuildpackName)

	serviceName := initiateBrokerConfig(serviceBrokerAppName)

	brokerName := generator.PrefixedRandomName("RATS-BROKER-")
	brokerUrl := helpers.AppUri(serviceBrokerAppName, "")

	config = helpers.LoadConfig()
	context := helpers.NewContext(config)
	cf.AsUser(context.AdminUserContext(), context.ShortTimeout(), func() {
		session := cf.Cf("create-service-broker", brokerName, "user", "password", brokerUrl)
		Expect(session.Wait(DEFAULT_TIMEOUT)).To(Exit(0))

		session = cf.Cf("enable-service-access", serviceName)
		Expect(session.Wait(DEFAULT_TIMEOUT)).To(Exit(0))

	})

	return brokerName, serviceBrokerAppName, serviceName
}
开发者ID:cf-routing,项目名称:cf-acceptance-tests,代码行数:22,代码来源:route_services_test.go

示例3: Update

func (b ServiceBroker) Update() {
	cf.AsUser(b.context.AdminUserContext(), DEFAULT_TIMEOUT, func() {
		Expect(cf.Cf("update-service-broker", b.Name, "username", "password", helpers.AppUri(b.Name, "")).Wait(DEFAULT_TIMEOUT)).To(Exit(0))
	})
}
开发者ID:cf-routing,项目名称:cf-acceptance-tests,代码行数:5,代码来源:broker.go

示例4: Configure

func (b ServiceBroker) Configure() {
	Expect(runner.Curl(helpers.AppUri(b.Name, "/config"), "-d", b.ToJSON()).Wait(DEFAULT_TIMEOUT)).To(Exit(0))
}
开发者ID:cf-routing,项目名称:cf-acceptance-tests,代码行数:3,代码来源:broker.go

示例5:

			broker.Push()
			broker.Configure()
		})

		AfterEach(func() {
			broker.Destroy()
		})

		It("can be created, viewed (in list), updated, and deleted by SpaceDevelopers", func() {
			cf.AsUser(context.RegularUserContext(), context.ShortTimeout(), func() {
				spaceCmd := cf.Cf("space", context.RegularUserContext().Space, "--guid").Wait(DEFAULT_TIMEOUT)
				spaceGuid := string(spaceCmd.Out.Contents())
				spaceGuid = strings.Trim(spaceGuid, "\n")
				body := map[string]string{
					"name":          broker.Name,
					"broker_url":    helpers.AppUri(broker.Name, ""),
					"auth_username": context.RegularUserContext().Username,
					"auth_password": context.RegularUserContext().Password,
					"space_guid":    spaceGuid,
				}
				jsonBody, _ := json.Marshal(body)

				By("Create")
				createBrokerCommand := cf.Cf("curl", "/v2/service_brokers", "-X", "POST", "-d", string(jsonBody)).Wait(DEFAULT_TIMEOUT)
				Expect(createBrokerCommand).To(Exit(0))

				By("Read")
				serviceBrokersCommand := cf.Cf("service-brokers").Wait(DEFAULT_TIMEOUT)
				Expect(serviceBrokersCommand).To(Exit(0))
				Expect(serviceBrokersCommand.Out.Contents()).To(ContainSubstring(broker.Name))
开发者ID:cwlbraa,项目名称:cf-acceptance-tests,代码行数:30,代码来源:service_broker_lifecycle_test.go

示例6:

			Expect(cf.Cf("start", appName).Wait(CF_PUSH_TIMEOUT)).To(Exit(0))
		})

		AfterEach(func() {
			cf.Cf("delete", appName, "-f").Wait(DEFAULT_TIMEOUT)

			Expect(cf.Cf("delete-service", dbInstanceName, "-f").Wait(DEFAULT_TIMEOUT)).To(Exit(0))

			// Poll until destruction is complete, otherwise the org cleanup (in AfterSuite) fails.
			pollForRDSDeletionCompletion(dbInstanceName)
		})

		It("can connect to the DB instance from the app", func() {
			By("Sending request to DB Healthcheck app")
			resp, err := httpClient.Get(helpers.AppUri(appName, "/db"))
			Expect(err).NotTo(HaveOccurred())
			body, err := ioutil.ReadAll(resp.Body)
			Expect(err).NotTo(HaveOccurred())
			Expect(resp.StatusCode).To(Equal(200), "Got %d response from healthcheck app. Response body:\n%s\n", resp.StatusCode, string(body))

			By("Sending request to DB Healthcheck app without TLS")
			resp, err = httpClient.Get(helpers.AppUri(appName, "/db?ssl=false"))
			Expect(err).NotTo(HaveOccurred())
			body, err = ioutil.ReadAll(resp.Body)
			Expect(err).NotTo(HaveOccurred())
			Expect(resp.StatusCode).NotTo(Equal(200), "Got %d response from healthcheck app. Response body:\n%s\n", resp.StatusCode, string(body))
			Expect(body).To(MatchRegexp("no pg_hba.conf entry for .* SSL off"), "Connection without TLS did not report a TLS error")

			By("Testing permissions after unbind and rebind")
			resp, err = httpClient.Get(helpers.AppUri(appName, "/db/permissions-check?phase=setup"))
开发者ID:alphagov,项目名称:paas-cf,代码行数:30,代码来源:rds_broker_test.go

示例7:

			broker.Configure()
		})

		AfterEach(func() {
			app_helpers.AppReport(broker.Name, Config.DefaultTimeoutDuration())
			broker.Destroy()
		})

		It("can be created, viewed (in list), updated, and deleted by SpaceDevelopers", func() {
			workflowhelpers.AsUser(TestSetup.RegularUserContext(), TestSetup.ShortTimeout(), func() {
				spaceCmd := cf.Cf("space", TestSetup.RegularUserContext().Space, "--guid").Wait(Config.DefaultTimeoutDuration())
				spaceGuid := string(spaceCmd.Out.Contents())
				spaceGuid = strings.Trim(spaceGuid, "\n")
				body := map[string]string{
					"name":          broker.Name,
					"broker_url":    helpers.AppUri(broker.Name, "", Config),
					"auth_username": TestSetup.RegularUserContext().Username,
					"auth_password": TestSetup.RegularUserContext().Password,
					"space_guid":    spaceGuid,
				}
				jsonBody, _ := json.Marshal(body)

				By("Create")
				createBrokerCommand := cf.Cf("curl", "/v2/service_brokers", "-X", "POST", "-d", string(jsonBody)).Wait(Config.DefaultTimeoutDuration())
				Expect(createBrokerCommand).To(Exit(0))

				By("Read")
				serviceBrokersCommand := cf.Cf("service-brokers").Wait(Config.DefaultTimeoutDuration())
				Expect(serviceBrokersCommand).To(Exit(0))
				Expect(serviceBrokersCommand.Out.Contents()).To(ContainSubstring(broker.Name))
开发者ID:nickwei84,项目名称:cf-acceptance-tests,代码行数:30,代码来源:service_broker_lifecycle.go

示例8: curlAppWithCookies

func curlAppWithCookies(appName, path string, cookieStorePath string) string {
	uri := helpers.AppUri(appName, path)
	curlCmd := runner.Curl(uri, "-b", cookieStorePath, "-c", cookieStorePath)
	runner.NewCmdRunner(curlCmd, helpers.CURL_TIMEOUT).Run()
	return string(curlCmd.Out.Contents())
}
开发者ID:cwlbraa,项目名称:cf-acceptance-tests,代码行数:6,代码来源:session_affinity_test.go

示例9: Update

func (b ServiceBroker) Update() {
	workflowhelpers.AsUser(b.TestSetup.AdminUserContext(), Config.DefaultTimeoutDuration(), func() {
		Expect(cf.Cf("update-service-broker", b.Name, "username", "password", helpers.AppUri(b.Name, "", Config)).Wait(Config.DefaultTimeoutDuration())).To(Exit(0))
	})
}
开发者ID:nickwei84,项目名称:cf-acceptance-tests,代码行数:5,代码来源:broker.go

示例10: CreateSpaceScoped

func (b ServiceBroker) CreateSpaceScoped() {
	workflowhelpers.AsUser(b.TestSetup.RegularUserContext(), Config.DefaultTimeoutDuration(), func() {
		Expect(cf.Cf("create-service-broker", b.Name, "username", "password", helpers.AppUri(b.Name, "", Config), "--space-scoped").Wait(Config.DefaultTimeoutDuration())).To(Exit(0))
		Expect(cf.Cf("service-brokers").Wait(Config.DefaultTimeoutDuration())).To(Say(b.Name))
	})
}
开发者ID:nickwei84,项目名称:cf-acceptance-tests,代码行数:6,代码来源:broker.go

示例11: Configure

func (b ServiceBroker) Configure() {
	Expect(helpers.Curl(Config, helpers.AppUri(b.Name, "/config", Config), "-d", b.ToJSON()).Wait(Config.DefaultTimeoutDuration())).To(Exit(0))
}
开发者ID:nickwei84,项目名称:cf-acceptance-tests,代码行数:3,代码来源:broker.go


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