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:20 UTC
[05/40] incubator-trafficcontrol git commit: removed because the type
ids are incorrect
removed because the type ids are incorrect
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/095195b5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/095195b5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/095195b5
Branch: refs/heads/psql-rebase
Commit: 095195b5c42fe5e3c05876dc8c5e13f457b2d04f
Parents: a2f026a
Author: Dewayne Richardson <de...@apache.org>
Authored: Thu Nov 17 13:23:17 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Mon Nov 21 12:04:09 2016 -0700
----------------------------------------------------------------------
traffic_ops/app/t/status.t | 88 -----------------------------------------
traffic_ops/app/t/types.t | 82 --------------------------------------
2 files changed, 170 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/095195b5/traffic_ops/app/t/status.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/status.t b/traffic_ops/app/t/status.t
deleted file mode 100644
index d82c527..0000000
--- a/traffic_ops/app/t/status.t
+++ /dev/null
@@ -1,88 +0,0 @@
-package main;
-#
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-use Mojo::Base -strict;
-use Test::More;
-use Test::Mojo;
-use DBI;
-use strict;
-use warnings;
-no warnings 'once';
-use warnings 'all';
-use Test::TestHelper;
-
-#no_transactions=>1 ==> keep fixtures after every execution, beware of duplicate data!
-#no_transactions=>0 ==> delete fixtures after every execution
-
-BEGIN { $ENV{MOJO_MODE} = "test" }
-
-my $schema = Schema->connect_to_database;
-my $dbh = Schema->database_handle;
-my $t = Test::Mojo->new('TrafficOps');
-
-Test::TestHelper->unload_core_data($schema);
-Test::TestHelper->load_core_data($schema);
-
-ok $t->post_ok( '/login', => form => { u => Test::TestHelper::ADMIN_USER, p => Test::TestHelper::ADMIN_USER_PASSWORD } )->status_is(302)
- ->or( sub { diag $t->tx->res->content->asset->{content}; } );
-
-my $q = 'select * from status limit 1';
-my $get_ds = $dbh->prepare($q);
-$get_ds->execute();
-my $p = $get_ds->fetchall_arrayref( {} );
-$get_ds->finish();
-
-# the jsons
-# Note the 3 is the index in the array returned, not the id. It's safe to assume there are at least 3 statuses.
-$t->get_ok('/datastatus')->status_is(200)->json_has('/3/name')->json_has('/3/description');
-
-#clean up old crud
-&upd_and_del();
-
-# create a new param
-$t->post_ok(
- '/status/create' => form => {
- name => 'JLP_TEST_STATUS',
- description => 'This is a test status'
-
- }
-)->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );
-
-# modify and delete it
-&upd_and_del();
-
-sub upd_and_del() {
- my $q = 'select id from status where name = \'JLP_TEST_STATUS\'';
- my $get_ds = $dbh->prepare($q);
- $get_ds->execute();
- my $p = $get_ds->fetchall_arrayref( {} );
- $get_ds->finish();
- my $i = 0;
- while ( defined( $p->[$i] ) ) {
- my $id = $p->[$i]->{id};
- $t->post_ok(
- '/status/update/'
- . $id => form => {
- name => 'JLP_TEST_STATUS',
- description => 'This is a test status'
- }
- )->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );
- $t->get_ok( '/status/delete/' . $id )->status_is(302);
- $i++;
- }
-}
-ok $t->get_ok('/logout')->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );
-$dbh->disconnect();
-done_testing();
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/095195b5/traffic_ops/app/t/types.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/types.t b/traffic_ops/app/t/types.t
deleted file mode 100644
index a455bb9..0000000
--- a/traffic_ops/app/t/types.t
+++ /dev/null
@@ -1,82 +0,0 @@
-package main;
-#
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-use Mojo::Base -strict;
-use Test::More;
-use Test::Mojo;
-use DBI;
-use strict;
-use warnings;
-use Test::TestHelper;
-
-#no_transactions=>1 ==> keep fixtures after every execution, beware of duplicate data!
-#no_transactions=>0 ==> delete fixtures after every execution
-
-BEGIN { $ENV{MOJO_MODE} = "test" }
-
-my $schema = Schema->connect_to_database;
-my $dbh = Schema->database_handle;
-my $t = Test::Mojo->new('TrafficOps');
-
-Test::TestHelper->unload_core_data($schema);
-Test::TestHelper->load_core_data($schema);
-
-ok $t->post_ok( '/login', => form => { u => Test::TestHelper::ADMIN_USER, p => Test::TestHelper::ADMIN_USER_PASSWORD } )->status_is(302)
- ->or( sub { diag $t->tx->res->content->asset->{content}; } );
-
-my $q = 'select * from type limit 1';
-my $get_ds = $dbh->prepare($q);
-$get_ds->execute();
-my $p = $get_ds->fetchall_arrayref( {} );
-$get_ds->finish();
-
-# create a new param
-$t->post_ok(
- '/types/create' => form => {
- 'type_data.name' => 'JLP_TEST_SERVER',
- 'type_data.description' => 'JLP test host',
- 'type_data.use_in_table' => 'server'
-
- }
-)->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );
-
-# modify and delete it
-&upd_and_del();
-
-sub upd_and_del() {
- my $q = 'select id from type where name = \'JLP_TEST_SERVER\'';
- my $get_ds = $dbh->prepare($q);
- $get_ds->execute();
- my $p = $get_ds->fetchall_arrayref( {} );
- $get_ds->finish();
- my $i = 0;
- while ( defined( $p->[$i] ) ) {
- my $id = $p->[$i]->{id};
- $t->post_ok(
- '/types/'
- . $id
- . '/update' => form => {
- 'type_data.name' => 'JLP_TEST_SERVER',
- 'type_data.description' => 'JLP test host updated',
- 'type_data.use_in_table' => 'server'
- }
- )->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );
- $t->get_ok( '/types/' . $id . '/delete' )->status_is(302);
- $i++;
- }
-}
-ok $t->get_ok('/logout')->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );
-$dbh->disconnect();
-done_testing();