Re: [cgiapp] testing the new CAD::PSGI version

2011-05-19 Thread Ron Savage
Hi Mark

Another attempt. More below.

On Thu, 2011-05-19 at 11:26 +1000, Ron Savage wrote:
 Hi Mark
 
 Doesn't work for me.
 
 I assume it's due to the exact combination of modules used and their
 parentage.
 
 (1) 1 line change to Local::Application::Controller:
 
 package Local::Application::Controller;
 
 #Patch#use parent 'CGI::Application';
 use parent 'CGI::Application::Dispatch::PSGI';
 use strict;
 use warnings;
 ...
 
 (2) 2 line change to app.psgi:
 
 #!/usr/bin/env perl
 #
 # Run with:
 # starman -l 127.0.0.1:5002 --workers 1 httpd/cgi-bin/local/app.psgi 
 # or, for more debug output:
 # plackup -l 127.0.0.1:5002 httpd/cgi-bin/local/app.psgi 
 
 use strict;
 use warnings;
 
 #Patch#use CGI::Application::Dispatch::PSGI;
 use Local::Application::Controller;
 
 use Plack::Builder;
 
 # -
 
 #Patch#my($app) = CGI::Application::Dispatch - as_psgi
 my($app) = Local::Application::Controller - as_psgi
 (
   prefix = 'Local::Application::Controller',
   table  =
   [
   ''  = {app = 'Initialize', rm = 'display'},
   ':app'  = {rm = 'display'},
   ':app/:rm/:id?' = {},
   ],
 );
 
 builder
 {
   enable Plack::Middleware::Static,
   path = qr!^/(assets|favicon|yui)/!,
   root = '/dev/shm/html';
   $app;
 };
 
 (3) The error:
 
 [Dispatch] ERROR: Unknown error: Can't locate object method new via
 package Local::Application::Controller::Initialize
 at 
 /home/ron/perl5/perlbrew/perls/perl-5.12.2/lib/site_perl/5.12.2/CGI/Application/Dispatch/PSGI.pm
  line 455.
 
 This'll be because CGI::Application itself is not pulled in.

(4) 1 line change to Local::Application::Controller (multiple
inheritance):

package Local::Application::Controller;

#Patch#use parent 'CGI::Application';
use parent qw/CGI Application CGI::Application::Dispatch::PSGI/;
use strict;
use warnings;
...

(5) The error:

[Dispatch] ERROR: Unknown error: Can't locate object method
run_as_psgi via package Local::Application::Controller::Initialize
at 
/home/ron/perl5/perlbrew/perls/perl-5.12.2/lib/site_perl/5.12.2/CGI/Application/Dispatch/PSGI.pm
 line 465.

-- 
Ron Savage
http://savage.net.au/
Ph: 0421 920 622


#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] testing the new CAD::PSGI version

2011-05-18 Thread Ron Savage
Hi Mark

Doesn't work for me.

I assume it's due to the exact combination of modules used and their
parentage.

(1) 1 line change to Local::Application::Controller:

package Local::Application::Controller;

#Patch#use parent 'CGI::Application';
use parent 'CGI::Application::Dispatch::PSGI';
use strict;
use warnings;
...

(2) 2 line change to app.psgi:

#!/usr/bin/env perl
#
# Run with:
# starman -l 127.0.0.1:5002 --workers 1 httpd/cgi-bin/local/app.psgi 
# or, for more debug output:
# plackup -l 127.0.0.1:5002 httpd/cgi-bin/local/app.psgi 

use strict;
use warnings;

#Patch#use CGI::Application::Dispatch::PSGI;
use Local::Application::Controller;

use Plack::Builder;

# -

#Patch#my($app) = CGI::Application::Dispatch - as_psgi
my($app) = Local::Application::Controller - as_psgi
(
prefix = 'Local::Application::Controller',
table  =
[
''  = {app = 'Initialize', rm = 'display'},
':app'  = {rm = 'display'},
':app/:rm/:id?' = {},
],
);

builder
{
enable Plack::Middleware::Static,
path = qr!^/(assets|favicon|yui)/!,
root = '/dev/shm/html';
$app;
};

(3) The error:

[Dispatch] ERROR: Unknown error: Can't locate object method new via
package Local::Application::Controller::Initialize
at 
/home/ron/perl5/perlbrew/perls/perl-5.12.2/lib/site_perl/5.12.2/CGI/Application/Dispatch/PSGI.pm
 line 455.

This'll be because CGI::Application itself is not pulled in.

-- 
Ron Savage
http://savage.net.au/
Ph: 0421 920 622


#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] testing the new CAD::PSGI version

2011-05-16 Thread Mark Stosberg

 CGI::Application::Dispatch::PSGI gives any CGI script using CGI::App
 access to PSGI's amazing capabilities. It's what I use for every CGI
 script, nowadays.

Ron,

Could you test the Github version of CAD::PSGI if you haven't already?
As part of re-implementing it better, it should be a little faster, and
the calling syntax did have to change slightly.

Before:

 use Your::Application::Dispatch;
 use CGI::Application::Dispatch::PSGI;
 Your::Application::Dispatch-as_psgi;

After:

 use Your::Application::Dispatch;
 Your::Application::Dispatch-as_psgi;

 ### In Your::Application::Dispatch;
 package Your::Application::Dispatch;
 use base 'CGI::Application::Dispatch::PSGI';


The full Synopsis is below. Here's the the link to the source:

https://github.com/markstos/CGI--Application--Dispatch/blob/psgi-support/lib/CGI/Application/Dispatch/PSGI.pm

The current maintainer of that namespace has give me authority to upload
this replacement version there, which has a more efficient implementation.


##

=head1 SYNOPSIS

=head2 Out of Box

Under mod_perl:

  # change Apache1 to Apache2 as needed.

  Location /
  SetHandler perl-script
  PerlHandler Plack::Handler::Apache1
  PerlSetVar psgi_app /path/to/app.psgi
  /Location

  Perl
  use Plack::Handler::Apache1;
  Plack::Handler::Apache1-preload(/path/to/app.psgi);
  /Perl

Under CGI:

This would be the instance script for your application, such
as /cgi-bin/dispatch.cgi:

### in your dispatch.psgi:
# ( in a persistent environment, use FindBin::Real instead. )
use FindBin 'Bin';
use lib $Bin/../perllib';
use Your::Application::Dispatch;
Your::Application::Dispatch-as_psgi;

### In Your::Application::Dispatch;
package Your::Application::Dispatch;
use base 'CGI::Application::Dispatch::PSGI';


=head2 With a dispatch table

package MyApp::Dispatch;
use base 'CGI::Application::Dispatch::PSGI';

sub dispatch_args {
return {
prefix  = 'MyApp',
table   = [
''= { app = 'Welcome', rm = 'start' },
':app/:rm'= { },
'admin/:app/:rm'  = { prefix   = 'MyApp::Admin' },
],
};
}


#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] testing 1, 2, 3...

2011-05-10 Thread Ron Savage
Hi David

On Tue, 2011-05-10 at 16:19 -0400, David Kaufman wrote:
 Is this thing on?

I'm receiving. Got this and Colm's post, but nothing for some unknown
time before that. But then, perhaps no-one posted...

 Sorry for the list downage. it needed a:
 
chown mailman ~mailman
 
 Seems qmail ignores .qmail control files in home directories that are 
 not owned by their owner
 
 thanks, Dan.
 
 Whilst yum feels that /usr/lib/mailman should be owned by root, and 
 makes its feelings known during every update
 
 thanks, RedHat.

Hahahahaha. Surely you'd be the first person this millenium to thank
Redhat for anything. And yes, I realize you're being sarcastic.

-- 
Ron Savage
http://savage.net.au/
Ph: 0421 920 622


#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] Testing harness for non-CGI::App code

2008-11-26 Thread Michael Peters

Ron Savage wrote:


Is Test::WWW::Mechanize the most appropriate harness for testing CGI
(but not CGI::Application) code?


I love T::W::M (used with Test::HTML::Content). But why limit yourself to just normal CGI and not 
CGI::Application code? IMO it's not only important to test the C::A code, but also the environment 
you're running it in. If you run your tests just via the module but your application runs under 
Apache, then there will be bugs that your tests don't catch.


--
Michael Peters
Plus Three, LP


#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] Testing harness for non-CGI::App code

2008-11-26 Thread Ron Savage
Hi Michael

On Wed, 2008-11-26 at 09:12 -0500, Michael Peters wrote:
 Ron Savage wrote:
 
  Is Test::WWW::Mechanize the most appropriate harness for testing CGI
  (but not CGI::Application) code?
 
 I love T::W::M (used with Test::HTML::Content). But why limit yourself to 
 just normal CGI and not 
 CGI::Application code? IMO it's not only important to test the C::A code, but 
 also the environment 
 you're running it in. If you run your tests just via the module but your 
 application runs under 
 Apache, then there will be bugs that your tests don't catch.

Thanx.

And...

Why limit myself!?

Well, I did not say but I'm investigating tools to test my re-write of
CGI::Uploader, which is a stand-alone module, and has nothing to do with
CGI::Application, although of course it could be used in a
CGI::App-based app.

Unfinished docs here: http://savage.net.au/Up.html

As for Test::HTML::Content, damn!

Now I have to learn yet /another/ module's idiosyncracies :-)).

-- 
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html



#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] Testing

2007-12-12 Thread Richard Dice
I see this.

On Dec 12, 2007 10:27 AM, Jesse Erlbaum [EMAIL PROTECTED] wrote:
 Ping?





 Jesse Erlbaum

 The Erlbaum Group, LLC http://erlbaum.net/

 817 Broadway, 10th floor

 New York, NY 10003

 212-684-6161 (office)

 917-647-3059 (mobile)

 212-684-6226 (fax)

 [EMAIL PROTECTED] blocked::mailto:[EMAIL PROTECTED]




 #  CGI::Application community mailing list  
 ####
 ##  To unsubscribe, or change your message delivery options,  ##
 ##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
 ####
 ##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
 ##  Wiki:  http://cgiapp.erlbaum.net/ ##
 ####
 



#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] Testing

2007-12-12 Thread Stewart Heckenberg
PONG!

On 13/12/2007, Jesse Erlbaum [EMAIL PROTECTED] wrote:
 Hehe..



  -Original Message-
  From: [EMAIL PROTECTED] [mailto:cgiapp-
  [EMAIL PROTECTED] On Behalf Of Joel Gwynn
  Sent: Wednesday, December 12, 2007 11:34 AM
  To: CGI Application
  Subject: Re: [cgiapp] Testing
 
  64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms
  64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms
  64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms
  64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms
  64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms
  64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms
  64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms



 #  CGI::Application community mailing list  
 ####
 ##  To unsubscribe, or change your message delivery options,  ##
 ##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
 ####
 ##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
 ##  Wiki:  http://cgiapp.erlbaum.net/ ##
 ####
 



#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




RE: [cgiapp] Testing

2007-12-12 Thread John Day

Yes, there are in fact live bodies out here!

Have to admit it has been quiet though.

John Day
Toronto


At 02:08 PM 12/12/2007, you wrote:

Hehe..



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:cgiapp-
 [EMAIL PROTECTED] On Behalf Of Joel Gwynn
 Sent: Wednesday, December 12, 2007 11:34 AM
 To: CGI Application
 Subject: Re: [cgiapp] Testing

 64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms
 64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms
 64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms
 64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms
 64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms
 64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms
 64 bytes from joelman (here): icmp_seq=0 ttl=53 time=16.9 ms



#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.17.1/1182 - Release Date: 
12/12/2007 11:29 AM



#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] Testing

2005-03-02 Thread David Scott
Joel,

Check out these examples of testing.  This code was
written from studying the testing done by the
CGI::Application release tests.  Then expanded to
test for an application.  It gives you a view of
testing CGI::apps, supporting classes and the
screens.

  http://www.geocities.com/leapingfrog/perl/perl.html

The samples can be looked at as files with links or
downloaded as an application and tested on your
your system.

Sincerely,

David Scott

--- Joel Gwynn [EMAIL PROTECTED] wrote:

 What do people use for automated testing of their
 CGI::Application apps?
 How about testing things like user account creation
 forms, use menus,
 and they myriad of options that can be selected, and
 things that go
 wrong?
 

-
 Web Archive: 

http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
  
 http://marc.theaimsgroup.com/?l=cgiappr=1w=2
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 





__ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
  http://marc.theaimsgroup.com/?l=cgiappr=1w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] Testing

2005-02-28 Thread Joel Gwynn
HTTP::Recorder looks quite cool.


On Mon, 28 Feb 2005 11:06:48 -0500, William McKee [EMAIL PROTECTED] wrote:
 On Sun, Feb 27, 2005 at 10:21:33AM -0500, Joel Gwynn wrote:
  What do people use for automated testing of their CGI::Application apps?
  How about testing things like user account creation forms, use menus,
  and they myriad of options that can be selected, and things that go
  wrong?
 
 I've been using Apache::Test[1] for my unit and system testing for the
 past year and have been quite happy with it. There's a bit of a learning
 curve to get familiar with it but Geoff's article[2] does a good job of
 explaining the basics. He has also put together a nice skeleton[3] that
 demonstrates basic usage although it's intended purpose is for reporting
 bugs.
 
 I used to use HTTP::WebTest (and occassionally still do) for my system
 testing. I've been eyeing the combination of HTTP::Recorder and
 WWW::Mech recently but have made no inroads there. Check out the wiki
 entries[4] on this subject as well.
 
 William
 
 [1] http://perl.apache.org/docs/general/testing/testing.html
 [2] http://www.perl.com/pub/a/2003/05/22/testing.html
 [3] http://perl.apache.org/docs/general/testing/testing.html#References
 [4] http://twiki.med.yale.edu/twiki2/bin/view/CGIapp/TestingCGIApplications
 
 --
 Knowmad Services Inc.
 http://www.knowmad.com
 
 -
 Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
   http://marc.theaimsgroup.com/?l=cgiappr=1w=2
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
  http://marc.theaimsgroup.com/?l=cgiappr=1w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] Testing

2005-02-27 Thread Cees Hek
On Sun, 27 Feb 2005 10:21:33 -0500, Joel Gwynn [EMAIL PROTECTED] wrote:
 What do people use for automated testing of their CGI::Application apps?
 How about testing things like user account creation forms, use menus,
 and they myriad of options that can be selected, and things that go
 wrong?

I've used WWW::Mechanize successfully for this task.  It allows you to
walk through the website and click on buttons or links and submit
forms.   Test::WWW::Mechanize adds a nice set of testing functions
around the WWW::Mechanize interface.

You can also use Test::HTML::Lint which provides a testing framework
around HTML::Lint for doing HTML validation (also see HTML::Tidy and
Test::HTML::Tidy which is intended to replace HTML::Lint).

The drawbacks of this system is that you need a webserver to do the
tests, so it is easy to do the testing on your development box, but a
little bit more tricky on a production machine.  The Apache::Test
framework might help here which will actually provide you with a
working webserver in a testing framework.

I find the biggest problem with doing proper testing of a web
application is that it is so time consuming...  There are so many
possibilities when using a web application, and catching all the edge
cases can be tricky.  A possible way to simplify this is to use
something like HTTP::Recorder, which can be setup as an HTTP proxy and
will record all transactions that go through the proxy and
automatically generates a WWW::Mechanize script that can be used to
replay the entire transaction.

So you could set this up, and then let your testers go nuts with the
application, and then replay all their transactions in the future... 
You can also take the resulting Mechanize script and pepper it with
Test::WWW::Mechanize checks to write your test scripts.  Half of the
work will be done for you.

Of course this only tests the frontend of the application.  It is
probably worthwhile to test your data objects directly as well, and
any utility functions.  But those can be tested with more traditional
testing methods.


Cheers,

-- 
Cees Hek

-
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
  http://marc.theaimsgroup.com/?l=cgiappr=1w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]