Пример #1
0
func (s *MysqlTestSuite) SetupSuite() {
	s.DriverTestSuite.SetupSuite()

	err := integration.RepeatWhileError(func() error {
		var err error
		if s.connection, err = sql.Open("mysql", CONNECTION_URL); err != nil {
			return err
		}
		return s.connection.Ping()
	})

	if err != nil {
		s.Fail(err.Error())
	}
}
Пример #2
0
func (s *CassandraTestSuite) SetupSuite() {
	s.DriverTestSuite.SetupSuite()
	cluster := gocql.NewCluster("localhost")
	cluster.Consistency = gocql.All
	cluster.Timeout = 1 * time.Minute

	err := integration.RepeatWhileError(func() error {
		var err error
		s.session, err = cluster.CreateSession()
		return err
	})
	s.Nil(err)

	s.session.Query("CREATE KEYSPACE integration_test WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }").Exec()
}