[Catalyst-commits] r12171 - in trunk/Catalyst-Model-LDAP: . t t/lib
t/lib/TestApp t/lib/TestApp/Controller
t/lib/TestAppInheritedComponent
t/lib/TestAppInheritedComponent/Controller
t/lib/TestAppInheritedComponent/Model
t/lib/TestAppInheritedComponent/Model/LDAP
dwc at dev.catalyst.perl.org
dwc at dev.catalyst.perl.org
Thu Dec 3 21:44:43 GMT 2009
Author: dwc
Date: 2009-12-03 21:44:43 +0000 (Thu, 03 Dec 2009)
New Revision: 12171
Added:
trunk/Catalyst-Model-LDAP/t/lib/TestApp/Controller/
trunk/Catalyst-Model-LDAP/t/lib/TestApp/Controller/Root.pm
trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent.pm
trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/
trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Controller/
trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Controller/Root.pm
trunk/Catalyst-Model-LDAP/t/live_inherited_component.t
Removed:
trunk/Catalyst-Model-LDAP/t/inherited_component.t
trunk/Catalyst-Model-LDAP/t/lib/TestApp2.pm
trunk/Catalyst-Model-LDAP/t/lib/TestApp2/
Modified:
trunk/Catalyst-Model-LDAP/Changes
trunk/Catalyst-Model-LDAP/t/lib/TestApp.pm
trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Model/LDAP.pm
trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Model/LDAP/Connection.pm
trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Model/LDAP/Entry.pm
Log:
Reorganize tests and update their deprecated Catalyst usage
Modified: trunk/Catalyst-Model-LDAP/Changes
===================================================================
--- trunk/Catalyst-Model-LDAP/Changes 2009-12-03 21:13:15 UTC (rev 12170)
+++ trunk/Catalyst-Model-LDAP/Changes 2009-12-03 21:44:43 UTC (rev 12171)
@@ -8,6 +8,7 @@
- Update ACCEPT_CONTEXT method to remove Catalyst-specific
parameters, which broke anonymous Net::LDAP::bind operations
- Convert from Class::C3 to MRO::Compat
+ - Reorganize tests and update their deprecated Catalyst usage
0.16 Wed Feb 20 19:17:04 EST 2008
- Fix Catalyst::Model::LDAP::Entry's constructor
Deleted: trunk/Catalyst-Model-LDAP/t/inherited_component.t
===================================================================
--- trunk/Catalyst-Model-LDAP/t/inherited_component.t 2009-12-03 21:13:15 UTC (rev 12170)
+++ trunk/Catalyst-Model-LDAP/t/inherited_component.t 2009-12-03 21:44:43 UTC (rev 12171)
@@ -1,16 +0,0 @@
-use strict;
-use warnings;
-use Test::More;
-
-use FindBin;
-use lib "$FindBin::Bin/lib";
-use Catalyst::Test 'TestApp2';
-
-plan skip_all => 'set TEST_AUTHOR to enable this test' unless $ENV{TEST_AUTHOR};
-plan tests => 2;
-
-{
- my $res = request('/search?sn=TEST');
- ok($res->is_success);
- like($res->content, qr/TEST/);
-}
\ No newline at end of file
Added: trunk/Catalyst-Model-LDAP/t/lib/TestApp/Controller/Root.pm
===================================================================
--- trunk/Catalyst-Model-LDAP/t/lib/TestApp/Controller/Root.pm (rev 0)
+++ trunk/Catalyst-Model-LDAP/t/lib/TestApp/Controller/Root.pm 2009-12-03 21:44:43 UTC (rev 12171)
@@ -0,0 +1,65 @@
+package TestApp::Controller::Root;
+
+use strict;
+use warnings;
+use base qw/Catalyst::Controller/;
+use Data::Dumper;
+
+__PACKAGE__->config(namespace => '');
+
+sub filter {
+ my ($self, $params) = @_;
+
+ my @parts = map { $_ . '=' . $params->{$_} } keys %$params;
+ my $filter = '(' . join('&', @parts) . ')';
+
+ return $filter;
+}
+
+sub search : Local {
+ my ($self, $c) = @_;
+
+ my $filter = $self->filter($c->request->params);
+ my $mesg = $c->model('LDAP')->search($filter);
+
+ $c->stash(entries => [ $mesg->entries ]);
+ $c->forward('results');
+}
+
+sub blarg : Local {
+ my ($self, $c) = @_;
+
+ my $filter = $self->filter($c->request->params);
+ my $mesg = $c->model('LDAP')->blarg($filter);
+
+ $c->stash(entries => [ $mesg->entries ]);
+ $c->forward('results');
+}
+
+sub is_cool : Local {
+ my ($self, $c) = @_;
+
+ my $uid = $c->request->params->{uid};
+ my $mesg = $c->model('LDAP')->search("(uid=$uid)");
+
+ $c->response->content_type('text/plain');
+ $c->response->body($mesg->entry(0)->is_cool);
+}
+
+sub results : Local {
+ my ($self, $c) = @_;
+
+ $c->response->content_type('text/plain');
+ $c->response->body(Dumper($c->stash));
+}
+
+sub end : Private {
+ my ($self, $c) = @_;
+
+ return 1 if $c->response->status =~ /^3\d\d$/;
+ return 1 if $c->response->body;
+
+ $c->res->body('Default body from end');
+}
+
+1;
Modified: trunk/Catalyst-Model-LDAP/t/lib/TestApp.pm
===================================================================
--- trunk/Catalyst-Model-LDAP/t/lib/TestApp.pm 2009-12-03 21:13:15 UTC (rev 12170)
+++ trunk/Catalyst-Model-LDAP/t/lib/TestApp.pm 2009-12-03 21:44:43 UTC (rev 12171)
@@ -2,8 +2,7 @@
use strict;
use warnings;
-use Catalyst;# qw/-Debug/;
-use Data::Dumper;
+use Catalyst;
our $VERSION = '0.01';
@@ -19,59 +18,4 @@
__PACKAGE__->setup;
-sub filter {
- my ($self, $params) = @_;
-
- my @parts = map { $_ . '=' . $params->{$_} } keys %$params;
- my $filter = '(' . join('&', @parts) . ')';
-
- return $filter;
-}
-
-sub search : Local {
- my ($self, $c) = @_;
-
- my $filter = $self->filter($c->request->params);
- my $mesg = $c->model('LDAP')->search($filter);
-
- $c->stash(entries => [ $mesg->entries ]);
- $c->forward('results');
-}
-
-sub blarg : Local {
- my ($self, $c) = @_;
-
- my $filter = $self->filter($c->request->params);
- my $mesg = $c->model('LDAP')->blarg($filter);
-
- $c->stash(entries => [ $mesg->entries ]);
- $c->forward('results');
-}
-
-sub is_cool : Local {
- my ($self, $c) = @_;
-
- my $uid = $c->request->params->{uid};
- my $mesg = $c->model('LDAP')->search("(uid=$uid)");
-
- $c->response->content_type('text/plain');
- $c->response->body($mesg->entry(0)->is_cool);
-}
-
-sub results : Local {
- my ($self, $c) = @_;
-
- $c->response->content_type('text/plain');
- $c->response->body(Dumper $c->stash);
-}
-
-sub end : Private {
- my ($self, $c) = @_;
-
- return 1 if $c->response->status =~ /^3\d\d$/;
- return 1 if $c->response->body;
-
- $c->res->body('Default body from end');
-}
-
1;
Deleted: trunk/Catalyst-Model-LDAP/t/lib/TestApp2.pm
===================================================================
--- trunk/Catalyst-Model-LDAP/t/lib/TestApp2.pm 2009-12-03 21:13:15 UTC (rev 12170)
+++ trunk/Catalyst-Model-LDAP/t/lib/TestApp2.pm 2009-12-03 21:44:43 UTC (rev 12171)
@@ -1,47 +0,0 @@
-package TestApp2;
-
-use strict;
-use warnings;
-use Catalyst;# qw/-Debug/;
-use Data::Dumper;
-
-our $VERSION = '0.01';
-
-__PACKAGE__->config(
- name => 'TestApp',
- 'Model::LDAP' => {
- host => 'ldap.ufl.edu',
- base => 'ou=People,dc=ufl,dc=edu',
- connection_class => 'TestApp2::Model::LDAP::Connection',
- entry_class => 'TestApp2::Model::LDAP::Entry',
- },
-);
-
-__PACKAGE__->setup;
-
-sub filter {
- my ($self, $params) = @_;
-
- my @parts = map { $_ . '=' . $params->{$_} } keys %$params;
- my $filter = '(' . join('&', @parts) . ')';
-
- return $filter;
-}
-
-sub search : Local {
- my ($self, $c) = @_;
-
- my $filter = $self->filter($c->request->params);
- my $mesg = $c->model('LDAP')->search($filter);
-
- $c->stash(entries => [ $mesg->entries ]);
- $c->forward('results');
-}
-sub results : Local {
- my ($self, $c) = @_;
-
- $c->response->content_type('text/plain');
- $c->response->body(Dumper $c->stash);
-}
-
-1;
Copied: trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent (from rev 12168, trunk/Catalyst-Model-LDAP/t/lib/TestApp2)
Added: trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Controller/Root.pm
===================================================================
--- trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Controller/Root.pm (rev 0)
+++ trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Controller/Root.pm 2009-12-03 21:44:43 UTC (rev 12171)
@@ -0,0 +1,35 @@
+package TestAppInheritedComponent::Controller::Root;
+
+use strict;
+use warnings;
+use base qw/Catalyst::Controller/;
+use Data::Dumper;
+
+__PACKAGE__->config(namespace => '');
+
+sub filter {
+ my ($self, $params) = @_;
+
+ my @parts = map { $_ . '=' . $params->{$_} } keys %$params;
+ my $filter = '(' . join('&', @parts) . ')';
+
+ return $filter;
+}
+
+sub search : Local {
+ my ($self, $c) = @_;
+
+ my $filter = $self->filter($c->request->params);
+ my $mesg = $c->model('LDAP')->search($filter);
+
+ $c->stash(entries => [ $mesg->entries ]);
+ $c->forward('results');
+}
+sub results : Local {
+ my ($self, $c) = @_;
+
+ $c->response->content_type('text/plain');
+ $c->response->body(Dumper($c->stash));
+}
+
+1;
Modified: trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Model/LDAP/Connection.pm
===================================================================
--- trunk/Catalyst-Model-LDAP/t/lib/TestApp2/Model/LDAP/Connection.pm 2009-12-03 17:15:17 UTC (rev 12168)
+++ trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Model/LDAP/Connection.pm 2009-12-03 21:44:43 UTC (rev 12171)
@@ -1,4 +1,4 @@
-package TestApp2::Model::LDAP::Connection;
+package TestAppInheritedComponent::Model::LDAP::Connection;
use strict;
use warnings;
Modified: trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Model/LDAP/Entry.pm
===================================================================
--- trunk/Catalyst-Model-LDAP/t/lib/TestApp2/Model/LDAP/Entry.pm 2009-12-03 17:15:17 UTC (rev 12168)
+++ trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Model/LDAP/Entry.pm 2009-12-03 21:44:43 UTC (rev 12171)
@@ -1,4 +1,4 @@
-package TestApp2::Model::LDAP::Entry;
+package TestAppInheritedComponent::Model::LDAP::Entry;
use strict;
use warnings;
Modified: trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Model/LDAP.pm
===================================================================
--- trunk/Catalyst-Model-LDAP/t/lib/TestApp2/Model/LDAP.pm 2009-12-03 17:15:17 UTC (rev 12168)
+++ trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent/Model/LDAP.pm 2009-12-03 21:44:43 UTC (rev 12171)
@@ -1,4 +1,4 @@
-package TestApp2::Model::LDAP;
+package TestAppInheritedComponent::Model::LDAP;
use strict;
use warnings;
Copied: trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent.pm (from rev 12168, trunk/Catalyst-Model-LDAP/t/lib/TestApp2.pm)
===================================================================
--- trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent.pm (rev 0)
+++ trunk/Catalyst-Model-LDAP/t/lib/TestAppInheritedComponent.pm 2009-12-03 21:44:43 UTC (rev 12171)
@@ -0,0 +1,21 @@
+package TestAppInheritedComponent;
+
+use strict;
+use warnings;
+use Catalyst;
+
+our $VERSION = '0.01';
+
+__PACKAGE__->config(
+ name => 'TestAppInheritedComponent',
+ 'Model::LDAP' => {
+ host => 'ldap.ufl.edu',
+ base => 'ou=People,dc=ufl,dc=edu',
+ connection_class => 'TestAppInheritedComponent::Model::LDAP::Connection',
+ entry_class => 'TestAppInheritedComponent::Model::LDAP::Entry',
+ },
+);
+
+__PACKAGE__->setup;
+
+1;
Copied: trunk/Catalyst-Model-LDAP/t/live_inherited_component.t (from rev 12168, trunk/Catalyst-Model-LDAP/t/inherited_component.t)
===================================================================
--- trunk/Catalyst-Model-LDAP/t/live_inherited_component.t (rev 0)
+++ trunk/Catalyst-Model-LDAP/t/live_inherited_component.t 2009-12-03 21:44:43 UTC (rev 12171)
@@ -0,0 +1,16 @@
+use strict;
+use warnings;
+use Test::More;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+use Catalyst::Test 'TestAppInheritedComponent';
+
+plan skip_all => 'set TEST_AUTHOR to enable this test' unless $ENV{TEST_AUTHOR};
+plan tests => 2;
+
+{
+ my $res = request('/search?sn=TEST');
+ ok($res->is_success);
+ like($res->content, qr/TEST/);
+}
More information about the Catalyst-commits
mailing list