Skip to content

Commit

Permalink
Version update, tests updated and passing
Browse files Browse the repository at this point in the history
  • Loading branch information
lonelycode committed Sep 1, 2016
1 parent 59ec10e commit cb34f03
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
4 changes: 3 additions & 1 deletion round_robin_test.go
@@ -1,12 +1,14 @@
package main

import "testing"
import "github.com/TykTechnologies/tykcommon"

func TestRR(t *testing.T) {
thisArr1 := []string{"1", "2", "3"}

thisRR := RoundRobin{}
thisRR.SetMax(&thisArr1)
asHL := tykcommon.NewHostListFromList(thisArr1)
thisRR.SetMax(asHL)

val := thisRR.GetPos()

Expand Down
39 changes: 17 additions & 22 deletions service_discovery_test.go
Expand Up @@ -261,16 +261,15 @@ func TestServiceDiscovery_EUREKA(t *testing.T) {
t.Error(err)
}

var thisList *[]string
thisList = data.(*[]string)
thisList := data

arr := []string{"ip-172-31-57-136:60565", "ip-172-31-13-37:50045"}

if len(*thisList) != len(arr) {
if thisList.Len() != len(arr) {
t.Error("Result lists length do not match expected value")
}

for i, v := range *thisList {
for i, v := range thisList.All() {
if v != arr[i] {
err := "Value is wrong, should be: " + arr[i] + " have: " + v
t.Error(err)
Expand All @@ -288,16 +287,15 @@ func TestServiceDiscovery_CONSUL(t *testing.T) {
t.Error(err)
}

var thisList *[]string
thisList = data.(*[]string)
thisList := data

arr := []string{"10.1.10.12:8000", "10.1.10.13:8000"}

if len(*thisList) != len(arr) {
if thisList.Len() != len(arr) {
t.Error("Result lists length do not match expected value")
}

for i, v := range *thisList {
for i, v := range thisList.All() {
if v != arr[i] {
err := "Value is wrong, should be: " + arr[i] + " have: " + v
t.Error(err)
Expand All @@ -315,16 +313,15 @@ func TestServiceDiscovery_NESTED_CONSUL(t *testing.T) {
t.Error(err)
}

var thisList *[]string
thisList = data.(*[]string)
thisList := data

arr := []string{"httpbin1.org:80", "httpbin2.org:80"}

if len(*thisList) != len(arr) {
if thisList.Len() != len(arr) {
t.Error("Result lists length do not match expected value")
}

for i, v := range *thisList {
for i, v := range thisList.All() {
if v != arr[i] {
err := "Value is wrong, should be: " + arr[i] + " have: " + v
t.Error(err)
Expand All @@ -342,16 +339,15 @@ func TestServiceDiscovery_ETCD_NESTED_LIST(t *testing.T) {
t.Error(err)
}

var thisList *[]string
thisList = data.(*[]string)
thisList := data

arr := []string{"httpbin.org:80", "httpbin2.org:80"}

if len(*thisList) != len(arr) {
if thisList.Len() != len(arr) {
t.Error("Result lists length do not match expected value")
}

for i, v := range *thisList {
for i, v := range thisList.All() {
if v != arr[i] {
err := "Value is wrong, should be: " + arr[i] + " have: " + v
t.Error(err)
Expand All @@ -369,7 +365,7 @@ func TestServiceDiscovery_ETCD_NESTED_NOLIST(t *testing.T) {
t.Error(err)
}

host := data.(string)
host,_ := data.GetIndex(0)

tVal := "httpbin.org:80"

Expand All @@ -389,7 +385,7 @@ func TestServiceDiscovery_ETCD_NOLIST(t *testing.T) {
t.Error(err)
}

host := data.(string)
host,_ := data.GetIndex(0)

tVal := "httpbin.org:6000"

Expand All @@ -409,16 +405,15 @@ func TestServiceDiscovery_MESOSPHERE(t *testing.T) {
t.Error(err)
}

var thisList *[]string
thisList = data.(*[]string)
thisList := data

arr := []string{"httpbin.org:80"}

if len(*thisList) != len(arr) {
if thisList.Len() != len(arr) {
t.Error("Result lists length do not match expected value")
}

for i, v := range *thisList {
for i, v := range thisList.All() {
if v != arr[i] {
err := "Value is wrong, should be: " + arr[i] + " have: " + v
t.Error(err)
Expand Down
2 changes: 1 addition & 1 deletion version.go
@@ -1,3 +1,3 @@
package main

var VERSION string = "v2.2.0.10"
var VERSION string = "v2.2.0.11"

0 comments on commit cb34f03

Please sign in to comment.