Пример #1
0
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{})
	}
}
Пример #2
0
func TestClientSuite_RabbitTransport(t *testing.T) {
	suite.Run(t, &clientSuite{
		TransF: func() transport.Transport {
			return rabbit.NewTransport()
		},
	})
}
Пример #3
0
func TestBridgeRemoteSuite(t *testing.T) {
	suite.Run(t, &remoteBridgeTestSuite{
		bridgeTestSuite: bridgeTestSuite{
			name: "",
		},
	})
}
Пример #4
0
func TestHeartbeaterSuite(t *testing.T) {
	pool, _ := conn.New(conn.ConnectionParam{
		Address: "127.0.0.1:6379",
	}, 1)

	suite.Run(t, &HeartbeaterSuite{test.NewSuite(pool)})
}
Пример #5
0
func TestLIFOProcessorSuite(t *testing.T) {
	pool, _ := conn.New(conn.ConnectionParam{
		Address: "127.0.0.1:6379",
	}, 1)

	suite.Run(t, &LIFOProcessorTest{test.NewSuite(pool)})
}
Пример #6
0
func TestJsonSafeMarshallerSuite(t *testing.T) {
	suite.Run(t, &jsonSafeMarshallerTestSuite{
		MarshallerTestSuite{
			m: &CustomMarshaller{Codec: &JSONSafeCodec{}},
		},
	})
}
Пример #7
0
func TestGobMarshallerSuite(t *testing.T) {
	suite.Run(t, &gobMarshallerTestSuite{
		MarshallerTestSuite{
			m: &GobMarshaller{},
		},
	})
}
Пример #8
0
func TestJsonMarshallerSuite(t *testing.T) {
	suite.Run(t, &jsonMarshallerTestSuite{
		MarshallerTestSuite{
			m: &JsonMarshaller{},
		},
	})
}
Пример #9
0
func TestBridgeLocalSuite(t *testing.T) {
	suite.Run(t, &localBridgeTestSuite{
		bridgeTestSuite{
			name: "local",
		},
	})
}
Пример #10
0
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
			},
		},
	})
}
Пример #11
0
func TestIntegrationMigrateSuite(t *testing.T) {
	migrateSuite := &IntegrationMigrateSuite{
		Target: NewEtcdMigrationTarget(common.DefaultEtcdServerUrl, "gull", "default", true, NewNullLogger()),
	}
	suite.Run(t, migrateSuite)
	_ = os.RemoveAll(testdata.ConvertDestination1)
}
Пример #12
0
func TestZkSuite(t *testing.T) {
	if testing.Short() {
		t.Skip("skip zk test")
		return
	}
	suite.Run(t, new(zkSuite))
}
Пример #13
0
// 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")

}
Пример #14
0
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())
}
Пример #15
0
func TestRedisSuite(t *testing.T) {
	if testing.Short() {
		t.Skip("skip redis test")
		return
	}
	suite.Run(t, new(redisSuite))
}
Пример #16
0
func TestSimpleDetectorSuite(t *testing.T) {
	pool, _ := conn.New(conn.ConnectionParam{
		Address: "127.0.0.1:6379",
	}, 1)

	suite.Run(t, &SimpleDetectorSuite{test.NewSuite(pool)})
}
Пример #17
0
func TestSrvLauncherSuite(t *testing.T) {
	if testing.Short() {
		t.Skip("skip service launcher test")
		return
	}
	suite.Run(t, new(srvLauncherSuite))
}
Пример #18
0
func TestClientSuite_MockTransport(t *testing.T) {
	suite.Run(t, &clientSuite{
		TransF: func() transport.Transport {
			return mock.NewTransport()
		},
	})
}
Пример #19
0
func TestServerSuite_RabbitTransport(t *testing.T) {
	suite.Run(t, &serverSuite{
		TransF: func() transport.Transport {
			return rabbit.NewTransport()
		},
	})
}
Пример #20
0
func TestByteQueueSuite(t *testing.T) {
	pool, _ := conn.New(conn.ConnectionParam{
		Address: "127.0.0.1:6379",
	}, 1)

	suite.Run(t, &ByteQueueSuite{test.NewSuite(pool)})
}
Пример #21
0
func TestBucketSuite(t *testing.T) {
	if testing.Short() {
		t.Skip("skipping test")
	}

	suite.Run(t, new(BucketSuite))
}
Пример #22
0
func TestGnatsdSuite(t *testing.T) {
	if testing.Short() {
		t.Skip("skip gnatsd test")
		return
	}
	suite.Run(t, new(gnatsdSuite))
}
Пример #23
0
func TestServerSuite_MockTransport(t *testing.T) {
	suite.Run(t, &serverSuite{
		TransF: func() transport.Transport {
			return mock.NewTransport()
		},
	})
}
Пример #24
0
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)
	}
}
Пример #25
0
func TestInvokerLazyJsonSafeSuite(t *testing.T) {
	suite.Run(t, &invokerLazyJsonSafeTestSuite{
		InvokerTestSuite{
			ivk:     &LazyInvoker{},
			convert: ioJSONSafe(),
		},
	})
}
Пример #26
0
func TestRiakSuite(t *testing.T) {
	if h, ok := context.ParseRiakHost(); ok {
		s := &RiakTestSuite{
			conn: context.ConnectRiakDb(h),
		}
		suite.Run(t, s)
	}
}
Пример #27
0
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)
}
Пример #28
0
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])
	}
}
Пример #29
0
// 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)
}
Пример #30
0
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))
}