gunnar: server/php-kolab/Kolab_Filter/tests load.phpt,NONE,1.1

cvs at kolab.org cvs at kolab.org
Wed Nov 28 07:06:14 CET 2007


Author: gunnar

Update of /kolabrepository/server/php-kolab/Kolab_Filter/tests
In directory doto:/tmp/cvs-serv10688/php-kolab/Kolab_Filter/tests

Added Files:
	load.phpt 
Log Message:
kolab/issue2177 (Better logging in kolabfilter and kolabmailboxfilter)

--- NEW FILE: load.phpt ---
--TEST--
A load test for the incoming filter.
--SKIPIF--
--FILE--
<?php
require_once 'Kolab/Filter/Incoming.php';

/* Our test configuration */
$conf = array();
$conf['log']['enabled']          = true;
$conf['log']['priority']         = PEAR_LOG_WARNING; // Leave this on DEBUG for now. We just restructured the package...
$conf['log']['type']             = 'console';
$conf['log']['name']             = 'ignored';
$conf['log']['ident']            = 'Kolab Filter';
$conf['log']['params']['append'] = true;
$conf['filter']['tempdir'] = './tmp';
$_SERVER['argv'] = array('test', '-s', 'me at example.com', '-r', 'you at example.com');
$logger = Horde::getLogger();

$logger->_lineFormat = '%2$s [%3$s] %7$s';
// Activate this if you need the log information. This will
// make the test fail though
//$logger->_lineFormat = '%2$s [%3$s] %4$s %7$s';

$timer = 0.0;

for ($i = 0; $i < 100; $i++) {

    $parser = &new Filter_Incoming('Drop', true);
    $inh = fopen('_data/tiny.eml', 'r');
    $parser->parse($inh);
    $timer += $parser->_stop();
    
    $parser = &new Filter_Incoming('Drop', true);
    $inh = fopen('_data/simple.eml', 'r');
    $parser->parse($inh);
    $timer += $parser->_stop();

    $parser = &new Filter_Incoming('Drop', true);
    $inh = fopen('_data/big.eml', 'r');
    $parser->parse($inh);
    $timer += $parser->_stop();

 }

// Let's use a average limit of 0.05 s per mail The above section runs
// 300 Mails through parsing so this should take at most 15 seconds.
var_dump($timer < 15);
?>
--EXPECT--
bool(true)





More information about the commits mailing list