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


Golang helpers.NewJUnitReporter函数代码示例

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


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

示例1: TestApplications

func TestApplications(t *testing.T) {
	RegisterFailHandler(Fail)

	SetDefaultEventuallyTimeout(time.Minute)
	SetDefaultEventuallyPollingInterval(time.Second)

	config := helpers.LoadConfig()
	context = helpers.NewContext(config)
	environment := helpers.NewEnvironment(context)

	var _ = SynchronizedBeforeSuite(func() []byte {
		path, err := exec.LookPath("scp")
		Expect(err).NotTo(HaveOccurred())
		return []byte(path)
	}, func(encodedSCPPath []byte) {
		scpPath = string(encodedSCPPath)
		environment.Setup()
	})

	AfterSuite(func() {
		environment.Teardown()
	})

	componentName := "SSH"

	rs := []Reporter{}

	if config.ArtifactsDirectory != "" {
		helpers.EnableCFTrace(config, componentName)
		rs = append(rs, helpers.NewJUnitReporter(config, componentName))
	}

	RunSpecsWithDefaultAndCustomReporters(t, componentName, rs)
}
开发者ID:axelaris,项目名称:diego-acceptance-tests,代码行数:34,代码来源:ssh_suite_test.go

示例2: TestApplications

func TestApplications(t *testing.T) {
	RegisterFailHandler(Fail)

	SetDefaultEventuallyTimeout(time.Minute)
	SetDefaultEventuallyPollingInterval(time.Second)

	config := helpers.LoadConfig()
	context = helpers.NewContext(config)
	environment := helpers.NewEnvironment(context)

	BeforeSuite(func() {
		environment.Setup()
	})

	AfterSuite(func() {
		environment.Teardown()
	})

	componentName := "SecurityGroups"

	rs := []Reporter{}

	if config.ArtifactsDirectory != "" {
		helpers.EnableCFTrace(config, componentName)
		rs = append(rs, helpers.NewJUnitReporter(config, componentName))
	}

	RunSpecsWithDefaultAndCustomReporters(t, componentName, rs)
}
开发者ID:axelaris,项目名称:diego-acceptance-tests,代码行数:29,代码来源:security_group_suite_test.go

示例3: TestRouting

func TestRouting(t *testing.T) {
	RegisterFailHandler(Fail)

	config = helpers.LoadConfig()

	componentName := "Routing"

	rs := []Reporter{}

	context := helpers.NewContext(config)
	environment := helpers.NewEnvironment(context)

	BeforeSuite(func() {
		Expect(config.SystemDomain).ToNot(Equal(""), "Must provide a system domain for the routing suite")
		Expect(config.ClientSecret).ToNot(Equal(""), "Must provide a client secret for the routing suite")
		environment.Setup()
	})

	AfterSuite(func() {
		environment.Teardown()
	})

	if config.ArtifactsDirectory != "" {
		helpers.EnableCFTrace(config, componentName)
		rs = append(rs, helpers.NewJUnitReporter(config, componentName))
	}

	RunSpecsWithDefaultAndCustomReporters(t, componentName, rs)
}
开发者ID:drnic,项目名称:noop-cf-boshrelease,代码行数:29,代码来源:routing_suite_test.go

示例4: TestDetect

func TestDetect(t *testing.T) {
	RegisterFailHandler(Fail)

	config = helpers.LoadConfig()

	if config.DefaultTimeout > 0 {
		DEFAULT_TIMEOUT = config.DefaultTimeout * time.Second
	}

	if config.DetectTimeout > 0 {
		DETECT_TIMEOUT = config.DetectTimeout * time.Second
	}

	context = helpers.NewContext(config)
	environment := helpers.NewEnvironment(context)

	BeforeSuite(func() {
		environment.Setup()
	})

	AfterSuite(func() {
		environment.Teardown()
	})

	componentName := "Buildpack Detection"

	rs := []Reporter{}

	if config.ArtifactsDirectory != "" {
		helpers.EnableCFTrace(config, componentName)
		rs = append(rs, helpers.NewJUnitReporter(config, componentName))
	}

	RunSpecsWithDefaultAndCustomReporters(t, componentName, rs)
}
开发者ID:cwlbraa,项目名称:cf-acceptance-tests,代码行数:35,代码来源:detect_suite_test.go

示例5: TestCATS

func TestCATS(t *testing.T) {
	RegisterFailHandler(Fail)

	var validationError error
	Config, validationError = config.NewCatsConfig(os.Getenv("CONFIG"))

	var _ = BeforeSuite(func() {
		if validationError != nil {
			fmt.Println("Invalid configuration.  ")
			fmt.Println(validationError)
			Fail("Please fix the contents of $CONFIG:\n  " + os.Getenv("CONFIG") + "\nbefore proceeding.")
		}

		TestSetup = workflowhelpers.NewTestSuiteSetup(Config)

		installedVersion, err := GetInstalledCliVersionString()
		Expect(err).ToNot(HaveOccurred(), "Error trying to determine CF CLI version")

		Expect(ParseRawCliVersionString(installedVersion).AtLeast(ParseRawCliVersionString(minCliVersion))).To(BeTrue(), "CLI version "+minCliVersion+" is required")
		if Config.GetIncludeSsh() {
			ScpPath, err = exec.LookPath("scp")
			Expect(err).NotTo(HaveOccurred())

			SftpPath, err = exec.LookPath("sftp")
			Expect(err).NotTo(HaveOccurred())
		}
		TestSetup.Setup()
	})

	AfterSuite(func() {
		if TestSetup != nil {
			TestSetup.Teardown()
		}
	})

	rs := []Reporter{}

	if validationError == nil {
		if Config.GetArtifactsDirectory() != "" {
			helpers.EnableCFTrace(Config, "CATS")
			rs = append(rs, helpers.NewJUnitReporter(Config, "CATS"))
		}
	}

	RunSpecsWithDefaultAndCustomReporters(t, "CATS", rs)
}
开发者ID:nickwei84,项目名称:cf-acceptance-tests,代码行数:46,代码来源:cats_suite_test.go

示例6: TestApplications

func TestApplications(t *testing.T) {
	RegisterFailHandler(Fail)

	config = helpers.LoadConfig()

	if config.DefaultTimeout > 0 {
		DEFAULT_TIMEOUT = config.DefaultTimeout * time.Second
	}

	if config.CfPushTimeout > 0 {
		CF_PUSH_TIMEOUT = config.CfPushTimeout * time.Second
	}

	if config.LongCurlTimeout > 0 {
		LONG_CURL_TIMEOUT = config.LongCurlTimeout * time.Second
	}

	context = helpers.NewContext(config)
	environment := helpers.NewEnvironment(context)

	BeforeSuite(func() {
		environment.Setup()
	})

	AfterSuite(func() {
		environment.Teardown()
	})

	componentName := "Docker"

	rs := []Reporter{}

	if config.ArtifactsDirectory != "" {
		helpers.EnableCFTrace(config, componentName)
		rs = append(rs, helpers.NewJUnitReporter(config, componentName))
	}

	RunSpecsWithDefaultAndCustomReporters(t, componentName, rs)
}
开发者ID:cf-routing,项目名称:cf-acceptance-tests,代码行数:39,代码来源:init_test.go

示例7: TestPersiAcceptance

func TestPersiAcceptance(t *testing.T) {
	RegisterFailHandler(Fail)

	cfConfig = helpers.LoadConfig()
	defaults(&cfConfig)

	err := getPatsSpecificConfig()
	if err != nil {
		panic(err)
	}

	brokerName = pConfig.ServiceName + "-broker"

	componentName := "PATS Suite"
	rs := []Reporter{}

	SynchronizedBeforeSuite(func() []byte {
		patsSuiteContext = helpers.NewContext(cfConfig)

		cf.AsUser(patsSuiteContext.AdminUserContext(), DEFAULT_TIMEOUT, func() {
			// make sure we don't have a leftover service broker from another test
			deleteBroker(pConfig.BrokerUrl)

			if pConfig.PushedBrokerName != "" {
				// push the service broker as a cf application
				Expect(pConfig.SqlServiceName).ToNot(BeEmpty())

				appPath := os.Getenv("BROKER_APPLICATION_PATH")
				Expect(appPath).To(BeADirectory(), "BROKER_APPLICATION_PATH environment variable should point to a CF application")

				assetsPath := os.Getenv("ASSETS_PATH")
				Expect(assetsPath).To(BeADirectory(), "ASSETS_PATH environment variable should be a directory")

				Eventually(cf.Cf("update-security-group", "public_networks", filepath.Join(assetsPath, "security.json")), DEFAULT_TIMEOUT).Should(Exit(0))
				Eventually(cf.Cf("push", pConfig.PushedBrokerName, "-p", appPath, "-f", appPath+"/manifest.yml", "--no-start"), DEFAULT_TIMEOUT).Should(Exit(0))
				Eventually(cf.Cf("bind-service", pConfig.PushedBrokerName, pConfig.SqlServiceName), DEFAULT_TIMEOUT).Should(Exit(0))
				Eventually(cf.Cf("start", pConfig.PushedBrokerName), DEFAULT_TIMEOUT).Should(Exit(0))
			}

			createServiceBroker := cf.Cf("create-service-broker", brokerName, pConfig.BrokerUser, pConfig.BrokerPassword, pConfig.BrokerUrl).Wait(DEFAULT_TIMEOUT)
			Expect(createServiceBroker).To(Exit(0))
			Expect(createServiceBroker).To(Say(brokerName))
		})

		return nil
	}, func(_ []byte) {
		patsTestContext = helpers.NewContext(cfConfig)
		patsTestEnvironment = helpers.NewEnvironment(patsTestContext)

		patsTestEnvironment.Setup()
	})

	SynchronizedAfterSuite(func() {
		if patsTestEnvironment != nil {
			patsTestEnvironment.Teardown()
		}
	}, func() {
		cf.AsUser(patsSuiteContext.AdminUserContext(), DEFAULT_TIMEOUT, func() {
			session := cf.Cf("delete-service-broker", "-f", brokerName).Wait(DEFAULT_TIMEOUT)
			if session.ExitCode() != 0 {
				cf.Cf("purge-service-offering", pConfig.ServiceName).Wait(DEFAULT_TIMEOUT)
				Fail("pats service broker could not be cleaned up.")
			}
		})
	})

	if cfConfig.ArtifactsDirectory != "" {
		helpers.EnableCFTrace(cfConfig, componentName)
		rs = append(rs, helpers.NewJUnitReporter(cfConfig, componentName))
	}

	RunSpecsWithDefaultAndCustomReporters(t, componentName, rs)
}
开发者ID:cloudfoundry-incubator,项目名称:persi-acceptance-tests,代码行数:73,代码来源:persi_acceptance_suite_test.go


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