Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

domm (4030)

  (email not shown publicly)

Just in case you like to know, I'm currently full-time father of 2 kids, half-time Perl hacker, sort-of DJ, bicyclist, no longer dreadlocked and 33 years old

I'm also head of [], maintainer of the CPANTS [] project, member of the TPF Grants Commitee [] and the YAPC Europe Foundation [].

I've got stuff on CPAN [], held various talks [] and organised YAPC::Europe 2007 in Vienna [].

Journal of domm (4030)

Thursday July 03, 2008
11:03 AM

testing fun

[ #36847 ]

So, I'm currently developing a single-sign-on system for $work. Because I'm a well-behaved coder, I write tests. Which was fun today. In order to test the communication of the SSO-"Client" (i.e. the website the user actually wants to log on to) with the SSO-"Server" (the one SSO system), I had to:

  1. Generate a very small Catalyst TestApp (the "client")
  2. run the TestApp in a test (easy thanks to Catalyst::Test)
  3. write some fixures (connect to DB, generate a user to play around with, generate a login token directly in the DB)
  4. start the "server" by forking off another process and start another Catalyst app in the child
  5. Call the action in the "client" that's triggered after the user actually logged in on the SSO server.
  6. In this action, send an XMLRPC (ok, JSONRPC) request to the server running in the forked process.
  7. Take the result of the JSONRPC, store the values in the session & mark the user as authenticated
  8. Redirect to some page in the TestApp that is rigged to only display the username
  9. Check if the username matches the one generated for the testuser (see 3.)
  10. Kill the forked process
  11. Remove the fixtures

And it usernames matched! Even after setting the username to 'Rüştü Reçber' (yes, we're using the names of soccer players (especially ones with lots of non-latin1 characters) for test values - call it collateral damage of the EM...) (to bad that use.perl doesn't like utf8 chars in links, which means that the wikipedia link to poor old Rüştü is broken..)

/me likes testing

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • At work I mostly work with SAP which requires user testing which is hard to sensibly automate (given the small size of our system). Our test coverage is terrible and we often get problems appearing days, weeks or months after code is moved in to live that should have been picked up in testing.

    At home where I mostly code in Perl and work when I can code in Perl I like the tests, it really helps improve your code and testing is a benefit not a chore in my opinion.

    All I have to figure out now is why my module

    -- "It's not magic, it's work..."