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

[12/40] incubator-trafficcontrol git commit: fixed the job api

fixed the job api


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

Branch: refs/heads/psql-rebase
Commit: 54e9a369f79125c045a4eca8591b551d9a17659a
Parents: 15f5241
Author: Dewayne Richardson <de...@apache.org>
Authored: Thu Nov 17 13:41:05 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Mon Nov 21 12:04:09 2016 -0700

----------------------------------------------------------------------
 traffic_ops/app/lib/Fixtures/Job.pm             |  6 +++---
 .../app/t/api/1.1/deliveryserviceserver.t       |  2 +-
 traffic_ops/app/t/api/1.1/job.t                 | 22 ++++++++++----------
 3 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/54e9a369/traffic_ops/app/lib/Fixtures/Job.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Job.pm b/traffic_ops/app/lib/Fixtures/Job.pm
index d64aed1..ad01cce 100644
--- a/traffic_ops/app/lib/Fixtures/Job.pm
+++ b/traffic_ops/app/lib/Fixtures/Job.pm
@@ -30,8 +30,8 @@ my %definition_for = (
 			asset_type          => 'file',
 			status              => 1,
 			start_time          => $now,
-			job_user            => 1,
-			job_deliveryservice => 2,
+			job_user            => 100,
+			job_deliveryservice => 100,
 			entered_time        => $now
 		},
 	},
@@ -44,7 +44,7 @@ sub get_definition {
 
 sub all_fixture_names {
 	# sort by db name to guarantee insertion order
-	return (sort { $definition_for{$a}{using}{name} cmp $definition_for{$b}{using}{name} } keys %definition_for);
+	return (sort { $definition_for{$a}{using}{id} cmp $definition_for{$b}{using}{id} } keys %definition_for);
 }
 
 __PACKAGE__->meta->make_immutable;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/54e9a369/traffic_ops/app/t/api/1.1/deliveryserviceserver.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.1/deliveryserviceserver.t b/traffic_ops/app/t/api/1.1/deliveryserviceserver.t
index 42fa37a..c798d2d 100644
--- a/traffic_ops/app/t/api/1.1/deliveryserviceserver.t
+++ b/traffic_ops/app/t/api/1.1/deliveryserviceserver.t
@@ -42,7 +42,7 @@ ok $t->post_ok( '/login', => form => { u => 'portal', p => Test::TestHelper::ADM
 	->or( sub { diag $t->tx->res->content->asset->{content}; } );
 
 $t->get_ok("/api/1.1/deliveryserviceserver.json")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } )
-	->json_is( "/response/0/server", "1" )->json_is( "/response/0/deliveryService", "1" )->json_is( "/limit", "20" )
+	->json_is( "/response/0/server", "100" )->json_is( "/response/0/deliveryService", "100" )->json_is( "/limit", "20" )
 	->json_is( "/orderby", "deliveryservice" );
 
 ok $t->get_ok('/logout')->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/54e9a369/traffic_ops/app/t/api/1.1/job.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.1/job.t b/traffic_ops/app/t/api/1.1/job.t
index b72f412..c76461a 100644
--- a/traffic_ops/app/t/api/1.1/job.t
+++ b/traffic_ops/app/t/api/1.1/job.t
@@ -73,7 +73,7 @@ ok $t->get_ok('/api/1.1/user/current/jobs.json')->status_is(200)->json_has( '/re
 ok $t->post_ok(
 	'/api/1.1/user/current/jobs',
 	json => {
-		dsId      => 8,
+		dsId      => 100,
 		regex     => '/foo1/.*',
 		ttl       => 48,
 		startTime => $now,
@@ -84,31 +84,31 @@ ok $t->post_ok(
 ok $t->post_ok(
 	'/api/1.1/user/current/jobs',
 	json => {
-		dsId      => 8,
+		dsId      => 100,
 		regex     => '/foo1/.*',
 		ttl       => 0,
 		startTime => $now,
 	}
-	)->status_is(400)->json_is( '/alerts', [ { level => "error", text => "ttl should be between 1 and 2160" } ] )
+	)->status_is(400)->json_is( '/alerts', [ { level => "error", text => "ttl should be between 1 and 72" } ] )
 	->or( sub { diag $t->tx->res->content->asset->{content}; } ),
 	'Will not create a purge job without the ttl in the proper low range?';
 
 ok $t->post_ok(
 	'/api/1.1/user/current/jobs',
 	json => {
-		dsId      => 8,
+		dsId      => 100,
 		regex     => '/foo1/.*',
 		ttl       => 3000,
 		startTime => $now,
 	}
-	)->status_is(400)->json_is( '/alerts', [ { level => "error", text => "ttl should be between 1 and 2160" } ] )
+	)->status_is(400)->json_is( '/alerts', [ { level => "error", text => "ttl should be between 1 and 72" } ] )
 	->or( sub { diag $t->tx->res->content->asset->{content}; } ),
 	'Will not create a purge job without the ttl in the proper high range?';
 
 ok $t->post_ok(
 	'/api/1.1/user/current/jobs',
 	json => {
-		dsId      => 8,
+		dsId      => 100,
 		regex     => '/foo2/.*',
 		ttl       => 49,
 		startTime => $now,
@@ -118,7 +118,7 @@ ok $t->post_ok(
 ok $t->post_ok(
 	'/api/1.1/user/current/jobs',
 	json => {
-		dsId      => 9,
+		dsId      => 800,
 		regex     => '/foo2/.*',
 		ttl       => 49,
 		startTime => $now,
@@ -128,7 +128,7 @@ ok $t->post_ok(
 ok $t->post_ok(
 	'/api/1.1/user/current/jobs',
 	json => {
-		dsId      => 8,
+		dsId      => 100,
 		ttl       => 49,
 		startTime => $now,
 	}
@@ -139,7 +139,7 @@ ok $t->post_ok(
 ok $t->post_ok(
 	'/api/1.1/user/current/jobs',
 	json => {
-		dsId  => 8,
+		dsId  => 100,
 		regex => '/foo2/.*',
 		ttl   => 49,
 	}
@@ -150,7 +150,7 @@ ok $t->post_ok(
 ok $t->post_ok(
 	'/api/1.1/user/current/jobs',
 	json => {
-		dsId      => 8,
+		dsId      => 100,
 		regex     => '/foo2/.*',
 		ttl       => 49,
 		startTime => '2015-01-09',
@@ -163,7 +163,7 @@ ok $t->post_ok(
 ok $t->post_ok(
 	'/api/1.1/user/current/jobs',
 	json => {
-		dsId      => 8,
+		dsId      => 100,
 		regex     => '/foo2/.*',
 		startTime => $now,
 	}