|
From: <jgr...@us...> - 2003-10-06 13:54:39
|
Update of /cvsroot/popfile/engine/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv5598/tests
Modified Files:
TestProxy.tst
Log Message:
ENABLE POPFILE PROXIES TO DIFFERENTIATE BETWEEN CONDITIONS:
Command sent to a remote server...
1. returned successfully
2. returned with an error message
3. timed out
Use this to enable the POP3 proxy to drop a connection on
a timeout rather than keeping retrying which can cause
confusion if the POP3 server suddenly starts responding to
a previous request.
Proxy/Proxy.pm:
Change get_response_ and echo_response_ so that the caller
can distinguish the three cases above.
Proxy/POP3.pm:
Use the new get_response_ and echo_response_ to drop the
connection if condition #3 occurs.
Proxy/SMTP.pm
Proxy/NNTP.pm:
Update to work with the new get_response_ and
echo_response_
tests/TestProxy.pm:
Update the tests that handle get_response_ and
echo_response_
Index: TestProxy.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestProxy.tst,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** TestProxy.tst 29 Sep 2003 22:34:57 -0000 1.14
--- TestProxy.tst 6 Oct 2003 13:54:31 -0000 1.15
***************
*** 288,292 ****
$sp->{connection_timeout_error_} = 'timeout error';
open TEMP, ">temp.tmp";
! test_assert_regexp( $sp->get_response_( undef, \*TEMP, "HELLO" ), 'timeout error' );
close TEMP;
open TEMP, "<temp.tmp";
--- 288,294 ----
$sp->{connection_timeout_error_} = 'timeout error';
open TEMP, ">temp.tmp";
! my ( $r, $o ) = $sp->get_response_( undef, \*TEMP, "HELLO" );
! test_assert_regexp( $r, 'timeout error' );
! test_assert_equal( $o, 0 );
close TEMP;
open TEMP, "<temp.tmp";
***************
*** 299,303 ****
$sp->global_config_( 'timeout', 1 );
open TEMP, ">temp.tmp";
! test_assert_regexp( $sp->get_response_( $client, \*TEMP, "HELLO" ), 'timeout error' );
close TEMP;
open TEMP, "<temp.tmp";
--- 301,307 ----
$sp->global_config_( 'timeout', 1 );
open TEMP, ">temp.tmp";
! ( $r, $o ) = $sp->get_response_( $client, \*TEMP, "HELLO" );
! test_assert_regexp( $r, 'timeout error' );
! test_assert_equal( $o, 0 );
close TEMP;
open TEMP, "<temp.tmp";
***************
*** 309,313 ****
open TEMP, ">temp.tmp";
! test_assert_equal( $sp->get_response_( $client, \*TEMP, "HELLO", 1 ), '' );
close TEMP;
open TEMP, "<temp.tmp";
--- 313,319 ----
open TEMP, ">temp.tmp";
! ( $r, $o ) = $sp->get_response_( $client, \*TEMP, "HELLO", 1 );
! test_assert_equal( $r, '' );
! test_assert_equal( $o, 1 );
close TEMP;
open TEMP, "<temp.tmp";
***************
*** 322,326 ****
open TEMP, ">temp.tmp";
! test_assert_regexp( $sp->get_response_( $client, \*TEMP, "HELLO" ), 'HELLO response' );
close TEMP;
open TEMP, "<temp.tmp";
--- 328,334 ----
open TEMP, ">temp.tmp";
! ( $r, $o ) = $sp->get_response_( $client, \*TEMP, "HELLO" );
! test_assert_regexp( $r, 'HELLO response' );
! test_assert_equal( $o, 1 );
close TEMP;
open TEMP, "<temp.tmp";
***************
*** 336,340 ****
$sp->{good_response_} = 'GOOD';
open TEMP, ">temp.tmp";
! test_assert( $sp->echo_response_( $client, \*TEMP, "HOWRU?" ) );
close TEMP;
open TEMP, "<temp.tmp";
--- 344,348 ----
$sp->{good_response_} = 'GOOD';
open TEMP, ">temp.tmp";
! test_assert_equal( $sp->echo_response_( $client, \*TEMP, "HOWRU?" ), 0 );
close TEMP;
open TEMP, "<temp.tmp";
***************
*** 349,353 ****
open TEMP, ">temp.tmp";
! test_assert( !$sp->echo_response_( $client, \*TEMP, "HOWRU?" ) );
close TEMP;
open TEMP, "<temp.tmp";
--- 357,361 ----
open TEMP, ">temp.tmp";
! test_assert_equal( $sp->echo_response_( $client, \*TEMP, "HOWRU?" ), 1 );
close TEMP;
open TEMP, "<temp.tmp";
|