Esempio n. 1
0
	})

	Describe("TailingLogs", func() {
		var logMessageChan chan *events.LogMessage
		var errorChan chan error
		var doneChan chan struct{}
		var stopChan chan struct{}

		perform := func() {
			connection = noaa.NewConsumer(trafficControllerUrl, tlsSettings, consumerProxyFunc)
			logMessageChan = make(chan *events.LogMessage)
			errorChan = make(chan error, 10)
			stopChan = make(chan struct{})
			doneChan = make(chan struct{})
			go func() {
				connection.TailingLogs(appGuid, authToken, logMessageChan, errorChan, stopChan)
				close(doneChan)
			}()
		}

		BeforeEach(func() {
			startFakeTrafficController()
		})

		It("attempts to connect five times", func() {
			fakeHandler.fail = true
			perform()

			fakeHandler.Close()

			Eventually(errorChan, 3).Should(HaveLen(5))
Esempio n. 2
0
			})
		})
	})

	Describe("TailingLogs", func() {
		var logMessageChan chan *events.LogMessage
		var errorChan chan error
		var doneChan chan struct{}

		perform := func() {
			cnsmr = noaa.NewConsumer(trafficControllerUrl, tlsSettings, consumerProxyFunc)
			logMessageChan = make(chan *events.LogMessage)
			errorChan = make(chan error, 10)
			doneChan = make(chan struct{})
			go func() {
				cnsmr.TailingLogs(appGuid, authToken, logMessageChan, errorChan)
				close(doneChan)
			}()
		}

		BeforeEach(func() {
			startFakeTrafficController()
		})

		It("attempts to connect five times", func() {
			fakeHandler.fail = true
			perform()

			fakeHandler.Close()

			Eventually(errorChan, 3).Should(HaveLen(5))