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/14 17:07:07 UTC

[04/53] [abbrv] incubator-trafficcontrol git commit: fixing integration.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e9139ad5/traffic_ops/app/lib/Fixtures/Integration/Regex.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Integration/Regex.pm b/traffic_ops/app/lib/Fixtures/Integration/Regex.pm
index e06ba74..1eac8b7 100644
--- a/traffic_ops/app/lib/Fixtures/Integration/Regex.pm
+++ b/traffic_ops/app/lib/Fixtures/Integration/Regex.pm
@@ -26,27 +26,93 @@ extends 'DBIx::Class::EasyFixture';
 use namespace::autoclean;
 
 my %definition_for = (
-'0' => { new => 'Regex', => using => { pattern => '.*\.movies\..*', type => '18', id => '1', last_updated => '2015-12-10 15:43:45', }, }, 
-'1' => { new => 'Regex', => using => { id => '2', last_updated => '2015-12-10 15:43:45', pattern => '.*\.images\..*', type => '18', }, }, 
-'2' => { new => 'Regex', => using => { id => '3', last_updated => '2015-12-10 15:43:45', pattern => '.*\.games\..*', type => '18', }, }, 
-'3' => { new => 'Regex', => using => { id => '4', last_updated => '2015-12-10 15:43:45', pattern => '.*\.tv\..*', type => '18', }, }, 
-'4' => { new => 'Regex', => using => { id => '11', last_updated => '2015-12-10 15:43:45', pattern => '.*\.movies\..*', type => '18', }, }, 
-'5' => { new => 'Regex', => using => { id => '12', last_updated => '2015-12-10 15:43:45', pattern => '.*\.images\..*', type => '18', }, }, 
-'6' => { new => 'Regex', => using => { id => '13', last_updated => '2015-12-10 15:43:45', pattern => '.*\.games\..*', type => '18', }, }, 
-'7' => { new => 'Regex', => using => { id => '14', last_updated => '2015-12-10 15:43:45', pattern => '.*\.tv\..*', type => '18', }, }, 
-); 
+	## id => 1
+	'0' => {
+		new => 'Regex',
+		using => {
+			pattern => '.*\.games\..*',
+			last_updated => '2015-12-10 15:43:45',
+			type => '20',
+		},
+	},
+	## id => 2
+	'1' => {
+		new => 'Regex',
+		using => {
+			pattern => '.*\.games\..*',
+			last_updated => '2015-12-10 15:43:45',
+			type => '20',
+		},
+	},
+	## id => 3
+	'2' => {
+ 		new => 'Regex',
+ 		using => {
+			pattern => '.*\.images\..*',
+ 			last_updated => '2015-12-10 15:43:45',
+ 			type => '20',
+ 		},
+	},
+	## id => 4
+	'3' => {
+		new => 'Regex',
+		using => {
+			pattern => '.*\.images\..*',
+			last_updated => '2015-12-10 15:43:45',
+			type => '20',
+		},
+	},
+	## id => 5
+	'4' => {
+		new => 'Regex',
+		using => {
+			pattern => '.*\.movies\..*',
+			type => '20',
+			last_updated => '2015-12-10 15:43:45',
+		},
+	},
+	## id => 6
+	'5' => {
+		new => 'Regex',
+		using => {
+			pattern => '.*\.movies\..*',
+			last_updated => '2015-12-10 15:43:45',
+			type => '20',
+		},
+	},
+	## id => 7
+	'6' => {
+ 		new => 'Regex',
+ 		using => {
+			pattern => '.*\.tv\..*',
+ 			last_updated => '2015-12-10 15:43:45',
+ 			type => '20',
+ 		},
+	},
+	## id => 8
+	'7' => {
+ 		new => 'Regex',
+ 		using => {
+			pattern => '.*\.tv\..*',
+ 			last_updated => '2015-12-10 15:43:45',
+ 			type => '20',
+ 		},
+	},
+);
 
 sub name {
 		return "Regex";
 }
 
-sub get_definition { 
-		my ( $self, $name ) = @_;
+sub get_definition {
+		my ( $self,
+ 			$name ) = @_;
 		return $definition_for{$name};
 }
 
 sub all_fixture_names {
-		return keys %definition_for;
+	# sort by db pattern to guarantee insertion order
+	return (sort { $definition_for{$a}{using}{pattern} cmp $definition_for{$b}{using}{pattern} } keys %definition_for);
 }
 
 __PACKAGE__->meta->make_immutable;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e9139ad5/traffic_ops/app/lib/Fixtures/Integration/Region.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Integration/Region.pm b/traffic_ops/app/lib/Fixtures/Integration/Region.pm
index 98e6db6..d80ef59 100644
--- a/traffic_ops/app/lib/Fixtures/Integration/Region.pm
+++ b/traffic_ops/app/lib/Fixtures/Integration/Region.pm
@@ -26,22 +26,46 @@ extends 'DBIx::Class::EasyFixture';
 use namespace::autoclean;
 
 my %definition_for = (
-'0' => { new => 'Region', => using => { division => '1', id => '1', last_updated => '2015-12-10 15:43:45', name => 'East', }, }, 
-'1' => { new => 'Region', => using => { id => '2', last_updated => '2015-12-10 15:43:45', name => 'West', division => '2', }, }, 
-'2' => { new => 'Region', => using => { division => '2', id => '3', last_updated => '2015-12-10 15:43:45', name => 'Central', }, }, 
-); 
+	'0' => {
+		new => 'Region',
+		using => {
+			division => '2',
+			last_updated => '2015-12-10 15:43:45',
+			name => 'Central',
+		},
+	},
+	'1' => {
+		new => 'Region',
+		using => {
+		division => '1',
+			last_updated => '2015-12-10 15:43:45',
+			name => 'East',
+		},
+	},
+	'2' => {
+		new => 'Region',
+		using => {
+			last_updated => '2015-12-10 15:43:45',
+			name => 'West',
+			division => '2',
+		},
+	},
+);
 
 sub name {
 		return "Region";
 }
 
-sub get_definition { 
-		my ( $self, $name ) = @_;
+sub get_definition {
+		my ( $self,
+			$name ) = @_;
 		return $definition_for{$name};
 }
 
 sub all_fixture_names {
-		return keys %definition_for;
+	# sort by db name to guarantee insertion order
+	return (sort {
+		$definition_for{$a}{using}{name} cmp $definition_for{$b}{using}{name} } keys %definition_for);
 }
 
 __PACKAGE__->meta->make_immutable;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e9139ad5/traffic_ops/app/lib/Fixtures/Integration/Role.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Integration/Role.pm b/traffic_ops/app/lib/Fixtures/Integration/Role.pm
index bc683e7..6510091 100644
--- a/traffic_ops/app/lib/Fixtures/Integration/Role.pm
+++ b/traffic_ops/app/lib/Fixtures/Integration/Role.pm
@@ -26,25 +26,75 @@ extends 'DBIx::Class::EasyFixture';
 use namespace::autoclean;
 
 my %definition_for = (
-'0' => { new => 'Role', => using => { description => 'block all access', id => '1', name => 'disallowed', priv_level => '0', }, }, 
-'1' => { new => 'Role', => using => { description => 'block all access', id => '2', name => 'read-only user', priv_level => '10', }, }, 
-'2' => { new => 'Role', => using => { description => 'block all access', id => '3', name => 'operations', priv_level => '20', }, }, 
-'3' => { new => 'Role', => using => { description => 'super-user', id => '4', name => 'admin', priv_level => '30', }, }, 
-'4' => { new => 'Role', => using => { description => 'database migrations user - DO NOT REMOVE', id => '5', name => 'migrations', priv_level => '20', }, }, 
-'5' => { new => 'Role', => using => { description => 'Portal User', id => '6', name => 'portal', priv_level => '2', }, }, 
-); 
+	## id => 1
+	'0' => {
+		new => 'Role',
+		using => {
+			name => 'admin',
+			description => 'super-user',
+			priv_level => '30',
+		},
+	},
+	## id => 2
+	'1' => {
+		new => 'Role',
+		using => {
+			name => 'disallowed',
+			description => 'block all access',
+			priv_level => '0',
+		},
+	},
+	## id => 3
+	'2' => {
+		new => 'Role',
+		using => {
+			name => 'migrations',
+			description => 'database migrations user - DO NOT REMOVE',
+			priv_level => '20',
+		},
+	},
+	## id => 4
+	'3' => {
+		new => 'Role',
+		using => {
+			name => 'operations',
+			description => 'block all access',
+			priv_level => '20',
+		},
+	},
+	## id => 5
+	'4' => {
+		new => 'Role',
+		using => {
+			name => 'portal',
+			description => 'Portal User',
+			priv_level => '2',
+		},
+	},
+	## id => 6
+	'5' => {
+		new => 'Role',
+		using => {
+			name => 'read-only user',
+			description => 'block all access',
+			priv_level => '10',
+		},
+	},
+);
 
 sub name {
 		return "Role";
 }
 
-sub get_definition { 
-		my ( $self, $name ) = @_;
+sub get_definition {
+		my ( $self,
+			$name ) = @_;
 		return $definition_for{$name};
 }
 
 sub all_fixture_names {
-		return keys %definition_for;
+	# sort by db name to guarantee insertion order
+	return (sort { $definition_for{$a}{using}{name} cmp $definition_for{$b}{using}{name} } keys %definition_for);
 }
 
 __PACKAGE__->meta->make_immutable;