コード例 #1
0
func TestConnectToExistingSentinelRedis(t *testing.T) {
	redis := NewTransport(getRedisSentinelHost(), getRedisMaster(), "input", "ouput")
	err := redis.Connect()
	if err != nil {
		t.Fatal("Expected connection not established.")
	}
	redis.Disconnect()
}
コード例 #2
0
func TestConnectToExistingSingleRedis(t *testing.T) {
	redis := NewRedisTransport(getRedisHost(), "", "input", "ouput")
	err := redis.Connect()
	if err != nil {
		t.Fatalf("Expected connection not established.")
	}
	redis.Disconnect()
}
コード例 #3
0
func TestSendingAndReceiveWithQueueSentinel(t *testing.T) {
	queueName := fmt.Sprintf("queue:test-%d", time.Now().UnixNano())
	redis := NewTransport(getRedisSentinelHost(), getRedisMaster(), queueName, queueName)

	redis.Connect()
	log.Debugf("TestSendingAndReceiveWithQueueSingleHost.queueName: %s", queueName)

	sendAndReceiveWithQueueInternal(t, redis)
	defer redis.Disconnect()
}
コード例 #4
0
func TestDisconnectWithoutConnecting(t *testing.T) {
	redis := NewTransport(getRedisHost(), "", "input", "ouput")
	redis.Disconnect() // should not fail
}