Michael De La Rue > WWW-Link > WWW::Link::Test

Download:
WWW-Link-0.036.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Module Version: 1.06   Source  

NAME ^

WWW::Link::Test - adaptive functions for testing links.

SYNOPSIS ^

    use WWW::Link::Test
    $ua=create_a_user_agent();
    $link=get_a_link_object();
    WWW::Link::Test::test_link($ua, $link);

DESCRIPTION ^

The adaptive tester uses either a simple or a complex tester depending on which one has been working correctly.

METHODS ^

test_link

This function tests a link by going out to the world and checking it and then telling the associated link object what happened.

handle_response

The link tester has recieved a response, now the question is what do we do with it. It depends on our testing mode.

check_cookie ^

This verifies that the given link has a useful test cookie, and gives it an appropriate one if it doesn't.

TESTING MODES ^

We have two different ways of testing. One us network efficient, but is less likely to give a fully correct answer. The other is less network efficient, but more tests more carefully.

We assume that the complex testing system is correct. We will allow the simple testing system to be used only as long as we have no reason to suspect inaccuracy we will test with the simple tester.

verifying testing..

Every now and then (after 20 tests) we will verify that our method of testing is consistent. We do this by trying simple then complex testing in order. If they are inconsistent then we finally try simple testing one more time then mark the simple testing as wrong.

testing at status changes.

If a link changes status then we will try to verify it sooner..

statuses

There are two flags that can be set.

OKAY_SIMPLE_WORKING - link tests correctly with both complex and simple testers when it is working.

OKAY_SIMPLE_BROKEN- link tests correctly with both complex and simple testers when it is broken.

As long as these are both set then most of our testing should be done in simple mode.

syntax highlighting: