Esempio n. 1
0
func (s *ProducerSuite) SetUpTest(c *C) {
	s.deadMessageCh = make(chan *sarama.ProducerMessage, 100)
	s.cfg = config.Default()
	s.cfg.Kafka.SeedPeers = testhelpers.KafkaPeers
	s.cfg.Producer.DeadMessageCh = s.deadMessageCh
	s.kh = testhelpers.NewKafkaHelper(c)
}
Esempio n. 2
0
func (s *AdminSuite) SetUpSuite(c *C) {
	testhelpers.InitLogging(c)
	s.cfg = config.Default()
	s.cfg.ClientID = "producer"
	s.cfg.Kafka.SeedPeers = testhelpers.KafkaPeers
	s.cfg.ZooKeeper.SeedPeers = testhelpers.ZookeeperPeers
	s.kh = testhelpers.NewKafkaHelper(c)
}
Esempio n. 3
0
func (s *ServiceSuite) SetUpTest(c *C) {
	s.cfg = testhelpers.NewTestConfig("service-default")
	os.Remove(s.cfg.UnixAddr)
	s.kh = testhelpers.NewKafkaHelper(c)
	s.unixClient = testhelpers.NewUDSHTTPClient(s.cfg.UnixAddr)
	// The default HTTP client cannot be used, because it caches connections,
	// but each test must have a brand new connection.
	s.tcpClient = &http.Client{Transport: &http.Transport{
		Dial: (&net.Dialer{
			Timeout:   30 * time.Second,
			KeepAlive: 30 * time.Second,
		}).Dial,
	}}
}
Esempio n. 4
0
func (s *SmartConsumerSuite) SetUpSuite(c *C) {
	testhelpers.InitLogging(c)
	s.kh = testhelpers.NewKafkaHelper(c)
}