예제 #1
0
파일: pop_test.go 프로젝트: markbates/pop
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
파일: shard_test.go 프로젝트: csigo/shard
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
파일: redis_test.go 프로젝트: csigo/test
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
파일: gnatsd_test.go 프로젝트: csigo/test
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))
}