func TestSpecificSuites(t *testing.T) { switch os.Getenv("SODA_DIALECT") { case "postgres": suite.Run(t, &PostgreSQLSuite{}) case "mysql": suite.Run(t, &MySQLSuite{}) case "sqlite": suite.Run(t, &SQLiteSuite{}) } }
func TestClientSuite_RabbitTransport(t *testing.T) { suite.Run(t, &clientSuite{ TransF: func() transport.Transport { return rabbit.NewTransport() }, }) }
func TestBridgeRemoteSuite(t *testing.T) { suite.Run(t, &remoteBridgeTestSuite{ bridgeTestSuite: bridgeTestSuite{ name: "", }, }) }
func TestHeartbeaterSuite(t *testing.T) { pool, _ := conn.New(conn.ConnectionParam{ Address: "127.0.0.1:6379", }, 1) suite.Run(t, &HeartbeaterSuite{test.NewSuite(pool)}) }
func TestLIFOProcessorSuite(t *testing.T) { pool, _ := conn.New(conn.ConnectionParam{ Address: "127.0.0.1:6379", }, 1) suite.Run(t, &LIFOProcessorTest{test.NewSuite(pool)}) }
func TestJsonSafeMarshallerSuite(t *testing.T) { suite.Run(t, &jsonSafeMarshallerTestSuite{ MarshallerTestSuite{ m: &CustomMarshaller{Codec: &JSONSafeCodec{}}, }, }) }
func TestGobMarshallerSuite(t *testing.T) { suite.Run(t, &gobMarshallerTestSuite{ MarshallerTestSuite{ m: &GobMarshaller{}, }, }) }
func TestJsonMarshallerSuite(t *testing.T) { suite.Run(t, &jsonMarshallerTestSuite{ MarshallerTestSuite{ m: &JsonMarshaller{}, }, }) }
func TestBridgeLocalSuite(t *testing.T) { suite.Run(t, &localBridgeTestSuite{ bridgeTestSuite{ name: "local", }, }) }
func TestDingoAmqpSingleAppSuite(t *testing.T) { suite.Run(t, &amqpSingleAppTestSuite{ DingoSingleAppTestSuite{ GenApp: func() (app *dingo.App, err error) { app, err = dingo.NewApp("remote", nil) if err != nil { return } brk, err := dgamqp.NewBroker(dgamqp.DefaultAmqpConfig()) if err != nil { return } _, _, err = app.Use(brk, dingo.ObjT.Default) if err != nil { return } bkd, err := dgamqp.NewBackend(dgamqp.DefaultAmqpConfig()) if err != nil { return } _, _, err = app.Use(bkd, dingo.ObjT.Default) if err != nil { return } return }, }, }) }
func TestIntegrationMigrateSuite(t *testing.T) { migrateSuite := &IntegrationMigrateSuite{ Target: NewEtcdMigrationTarget(common.DefaultEtcdServerUrl, "gull", "default", true, NewNullLogger()), } suite.Run(t, migrateSuite) _ = os.RemoveAll(testdata.ConvertDestination1) }
func TestZkSuite(t *testing.T) { if testing.Short() { t.Skip("skip zk test") return } suite.Run(t, new(zkSuite)) }
// In order for 'go test' to run this suite, we need to create // a normal test function and pass our suite to suite.Run func TestFormat1TestSuite(t *testing.T) { //ts := new(Format1TestSuite) log.Info("TestFormat1TestSuite - Running test suite") suite.Run(t, new(Format1TestSuite)) log.Info("TestFormat1TestSuite - Finished test suite") }
func TestConnHashTestSuite(t *testing.T) { if testing.Short() { t.Skip("Skipping zk shard test in short mode.") } //launch zk sl := test.NewServiceLauncher() etcdOriPort, stopEtcd, err := sl.Start(test.Etcd) assert.NoError(t, err) s := new(ConnHashTestSuite) s.etcdOriPort = etcdOriPort s.etcdPort = 3333 // used for port forward s.forwarder = portForwarder( fmt.Sprintf(":%d", s.etcdPort), fmt.Sprintf(":%d", s.etcdOriPort)) s.stopForward, err = s.forwarder() assert.NoError(t, err, "no error") // non-forward etcdCli etcdCli = etcd.NewClient([]string{fmt.Sprintf("http://localhost:%d", etcdOriPort)}) // forwardable etcdCli etcdForwdCli = etcd.NewClient([]string{fmt.Sprintf("http://localhost:%d", s.etcdPort)}) suite.Run(t, s) // clean up the forwarding s.stopForward <- struct{}{} etcdCli.Close() etcdForwdCli.Close() assert.NoError(s.T(), stopEtcd()) }
func TestRedisSuite(t *testing.T) { if testing.Short() { t.Skip("skip redis test") return } suite.Run(t, new(redisSuite)) }
func TestSimpleDetectorSuite(t *testing.T) { pool, _ := conn.New(conn.ConnectionParam{ Address: "127.0.0.1:6379", }, 1) suite.Run(t, &SimpleDetectorSuite{test.NewSuite(pool)}) }
func TestSrvLauncherSuite(t *testing.T) { if testing.Short() { t.Skip("skip service launcher test") return } suite.Run(t, new(srvLauncherSuite)) }
func TestClientSuite_MockTransport(t *testing.T) { suite.Run(t, &clientSuite{ TransF: func() transport.Transport { return mock.NewTransport() }, }) }
func TestServerSuite_RabbitTransport(t *testing.T) { suite.Run(t, &serverSuite{ TransF: func() transport.Transport { return rabbit.NewTransport() }, }) }
func TestByteQueueSuite(t *testing.T) { pool, _ := conn.New(conn.ConnectionParam{ Address: "127.0.0.1:6379", }, 1) suite.Run(t, &ByteQueueSuite{test.NewSuite(pool)}) }
func TestBucketSuite(t *testing.T) { if testing.Short() { t.Skip("skipping test") } suite.Run(t, new(BucketSuite)) }
func TestGnatsdSuite(t *testing.T) { if testing.Short() { t.Skip("skip gnatsd test") return } suite.Run(t, new(gnatsdSuite)) }
func TestServerSuite_MockTransport(t *testing.T) { suite.Run(t, &serverSuite{ TransF: func() transport.Transport { return mock.NewTransport() }, }) }
func TestRemote(t *testing.T) { // Service var service = offers.Offers{Configuration: offers.Configuration{OfferRepository: offer.NewRepository(mockgossie.NewMockConnectionPool())}} // Server var server = offers.MustNewServer(offers.Configuration{}, service, ":5000") go func() { if err := server.Start(); err != nil { panic(err) } }() // Client var client = offers.MustNewClient(offers.Configuration{}, ":5000") suite.Run(t, &offers.Suite{Interface: func() offers.Interface { return client }}) // Client if err := client.Close(); err != nil { panic(err) } // Server if err := server.Stop(); err != nil { panic(err) } }
func TestInvokerLazyJsonSafeSuite(t *testing.T) { suite.Run(t, &invokerLazyJsonSafeTestSuite{ InvokerTestSuite{ ivk: &LazyInvoker{}, convert: ioJSONSafe(), }, }) }
func TestRiakSuite(t *testing.T) { if h, ok := context.ParseRiakHost(); ok { s := &RiakTestSuite{ conn: context.ConnectRiakDb(h), } suite.Run(t, s) } }
func runQueryPlanSuite(t *testing.T, dialect gorp.Dialect, connection *sql.DB) { dbMap := new(gorp.DbMap) dbMap.Dialect = dialect dbMap.Db = connection testSuite := new(QueryPlanTestSuite) testSuite.Map = dbMap suite.Run(t, testSuite) }
func doIntegrationTest(t *testing.T, suites ...suite.TestingSuite) { if !*integration { t.Skip("Test against amazon not enabled.") } for i := range suites { suite.Run(t, suites[i]) } }
// TODO: DRY the suite initialization code func runQueryLanguageSuite(t *testing.T, dialect gorp.Dialect, connection *sql.DB) { dbMap := new(gorp.DbMap) dbMap.Dialect = dialect dbMap.Db = connection //dbMap.TraceOn("TEST DB: ", log.New(os.Stdout, "", log.LstdFlags)) testSuite := new(QueryLanguageTestSuite) testSuite.Map = dbMap suite.Run(t, testSuite) }
func TestFlowTestSuite(t *testing.T) { dockerHost := os.Getenv("DOCKER_HOST") dockerCertPath := os.Getenv("DOCKER_CERT_PATH") defer func() { os.Setenv("DOCKER_HOST", dockerHost) os.Setenv("DOCKER_CERT_PATH", dockerCertPath) }() suite.Run(t, new(FlowTestSuite)) }