You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2016/11/28 21:23:00 UTC

[02/11] incubator-trafficcontrol git commit: update Deliverservice and associated tests/fixtures for psql

update Deliverservice and associated tests/fixtures for psql


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c444a403
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c444a403
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c444a403

Branch: refs/heads/psql-rebase
Commit: c444a40328c009f6eda520b71963d6dbe3150306
Parents: cf14ba3
Author: David Neuman <da...@gmail.com>
Authored: Mon Nov 21 15:36:49 2016 -0700
Committer: David Neuman <da...@gmail.com>
Committed: Mon Nov 21 15:36:49 2016 -0700

----------------------------------------------------------------------
 .../client/delivery_service_resources.go        | 32 ++++++++++----------
 traffic_ops/client/fixtures/delivery_service.go | 30 +++++++++---------
 .../client/tests/delivery_service_test.go       |  8 ++---
 3 files changed, 35 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c444a403/traffic_ops/client/delivery_service_resources.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/delivery_service_resources.go b/traffic_ops/client/delivery_service_resources.go
index a65734c..f8a677c 100644
--- a/traffic_ops/client/delivery_service_resources.go
+++ b/traffic_ops/client/delivery_service_resources.go
@@ -35,39 +35,39 @@ type DeleteDeliveryServiceResponse struct {
 
 // DeliveryService ...
 type DeliveryService struct {
-	ID                   string                 `json:"id"`
+	ID                   int                    `json:"id"`
 	XMLID                string                 `json:"xmlId"`
 	Active               bool                   `json:"active"`
-	DSCP                 string                 `json:"dscp"`
+	DSCP                 int                    `json:"dscp"`
 	Signed               bool                   `json:"signed"`
-	QStringIgnore        string                 `json:"qstringIgnore"`
-	GeoLimit             string                 `json:"geoLimit"`
-	GeoProvider          string                 `json:"geoProvider"`
+	QStringIgnore        int                    `json:"qstringIgnore"`
+	GeoLimit             int                    `json:"geoLimit"`
+	GeoProvider          int                    `json:"geoProvider"`
 	HTTPBypassFQDN       string                 `json:"httpBypassFqdn"`
 	DNSBypassIP          string                 `json:"dnsBypassIp"`
 	DNSBypassIP6         string                 `json:"dnsBypassIp6"`
 	DNSBypassCname       string                 `json:"dnsBypassCname"`
-	DNSBypassTTL         string                 `json:"dnsBypassTtl"`
+	DNSBypassTTL         int                    `json:"dnsBypassTtl"`
 	OrgServerFQDN        string                 `json:"orgServerFqdn"`
 	Type                 string                 `json:"type"`
 	ProfileName          string                 `json:"profileName"`
 	ProfileDesc          string                 `json:"profileDescription"`
 	CDNName              string                 `json:"cdnName"`
-	CCRDNSTTL            string                 `json:"ccrDnsTtl"`
-	GlobalMaxMBPS        string                 `json:"globalMaxMbps"`
-	GlobalMaxTPS         string                 `json:"globalMaxTps"`
+	CCRDNSTTL            int                    `json:"ccrDnsTtl"`
+	GlobalMaxMBPS        int                    `json:"globalMaxMbps"`
+	GlobalMaxTPS         int                    `json:"globalMaxTps"`
 	LongDesc             string                 `json:"longDesc"`
 	LongDesc1            string                 `json:"longDesc1"`
 	LongDesc2            string                 `json:"longDesc2"`
-	MaxDNSAnswers        string                 `json:"maxDnsAnswers"`
+	MaxDNSAnswers        int                    `json:"maxDnsAnswers"`
 	InfoURL              string                 `json:"infoUrl"`
-	MissLat              string                 `json:"missLat"`
-	MissLong             string                 `json:"missLong"`
+	MissLat              float64                `json:"missLat"`
+	MissLong             float64                `json:"missLong"`
 	CheckPath            string                 `json:"checkPath"`
 	LastUpdated          string                 `json:"lastUpdated"`
-	Protocol             string                 `json:"protocol"`
+	Protocol             int                    `json:"protocol"`
 	IPV6RoutingEnabled   bool                   `json:"ipv6RoutingEnabled"`
-	RangeRequestHandling string                 `json:"rangeRequestHandling"`
+	RangeRequestHandling int                    `json:"rangeRequestHandling"`
 	HeaderRewrite        string                 `json:"headerRewrite"`
 	EdgeHeaderRewrite    string                 `json:"edgeHeaderRewrite"`
 	MidHeaderRewrite     string                 `json:"midHeaderRewrite"`
@@ -75,9 +75,9 @@ type DeliveryService struct {
 	RegexRemap           string                 `json:"regexRemap"`
 	CacheURL             string                 `json:"cacheurl"`
 	RemapText            string                 `json:"remapText"`
-	MultiSiteOrigin      string                 `json:"multiSiteOrigin"`
+	MultiSiteOrigin      int                    `json:"multiSiteOrigin"`
 	DisplayName          string                 `json:"displayName"`
-	InitialDispersion    string                 `json:"initialDispersion"`
+	InitialDispersion    int                    `json:"initialDispersion"`
 	MatchList            []DeliveryServiceMatch `json:"matchList,omitempty"`
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c444a403/traffic_ops/client/fixtures/delivery_service.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/delivery_service.go b/traffic_ops/client/fixtures/delivery_service.go
index 6c7bf74..a0263eb 100644
--- a/traffic_ops/client/fixtures/delivery_service.go
+++ b/traffic_ops/client/fixtures/delivery_service.go
@@ -22,30 +22,30 @@ func DeliveryServices() *client.GetDeliveryServiceResponse {
 	return &client.GetDeliveryServiceResponse{
 		Response: []client.DeliveryService{
 			client.DeliveryService{
-				ID:                   "001",
+				ID:                   001,
 				XMLID:                "ds-test",
 				Active:               true,
-				DSCP:                 "40",
+				DSCP:                 40,
 				Signed:               false,
-				QStringIgnore:        "1",
-				GeoLimit:             "0",
-				GeoProvider:          "0",
-				DNSBypassTTL:         "30",
+				QStringIgnore:        1,
+				GeoLimit:             0,
+				GeoProvider:          0,
+				DNSBypassTTL:         30,
 				Type:                 "HTTP",
 				ProfileName:          "ds-123",
 				CDNName:              "test-cdn",
-				CCRDNSTTL:            "3600",
-				GlobalMaxTPS:         "0",
-				MaxDNSAnswers:        "0",
-				MissLat:              "44.654321",
-				MissLong:             "-99.123456",
-				Protocol:             "0",
+				CCRDNSTTL:            3600,
+				GlobalMaxTPS:         0,
+				MaxDNSAnswers:        0,
+				MissLat:              44.654321,
+				MissLong:             -99.123456,
+				Protocol:             0,
 				IPV6RoutingEnabled:   true,
-				RangeRequestHandling: "0",
+				RangeRequestHandling: 0,
 				TRResponseHeaders:    "Access-Control-Allow-Origin: *",
-				MultiSiteOrigin:      "0",
+				MultiSiteOrigin:      0,
 				DisplayName:          "Testing",
-				InitialDispersion:    "1",
+				InitialDispersion:    1,
 			},
 		},
 	}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c444a403/traffic_ops/client/tests/delivery_service_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/delivery_service_test.go b/traffic_ops/client/tests/delivery_service_test.go
index d8691b5..bf182e4 100644
--- a/traffic_ops/client/tests/delivery_service_test.go
+++ b/traffic_ops/client/tests/delivery_service_test.go
@@ -57,7 +57,7 @@ func TestDeliveryServices(t *testing.T) {
 			testHelper.Success(t, "Should get back \"ds-test\" for \"XMLID\"")
 		}
 
-		if s.MissLong != "-99.123456" {
+		if s.MissLong != -99.123456 {
 			testHelper.Error(t, "Should get back \"-99.123456\" for \"MissLong\", got: %s", s.MissLong)
 		} else {
 			testHelper.Success(t, "Should get back \"-99.123456\" for \"MissLong\"")
@@ -111,7 +111,7 @@ func TestDeliveryService(t *testing.T) {
 		testHelper.Success(t, "Should get back \"ds-test\" for \"XMLID\"")
 	}
 
-	if ds.MissLong != "-99.123456" {
+	if ds.MissLong != -99.123456 {
 		testHelper.Error(t, "Should get back \"-99.123456\" for \"MissLong\", got: %s", ds.MissLong)
 	} else {
 		testHelper.Success(t, "Should get back \"-99.123456\" for \"MissLong\"")
@@ -159,7 +159,7 @@ func TestCreateDeliveryService(t *testing.T) {
 	}
 
 	actual := ds.Response.ID
-	if actual != "001" {
+	if actual != 001 {
 		testHelper.Error(t, "Should get back \"001\" for \"Response.ID\", got: %s", actual)
 	} else {
 		testHelper.Success(t, "Should get back \"0001\" for \"Response.ID\"")
@@ -207,7 +207,7 @@ func TestUpdateDeliveryService(t *testing.T) {
 	}
 
 	actual := ds.Response.ID
-	if actual != "001" {
+	if actual != 001 {
 		testHelper.Error(t, "Should get back \"001\" for \"Response.ID\", got: %s", actual)
 	} else {
 		testHelper.Success(t, "Should get back \"0001\" for \"Response.ID\"")