Changeset 13205

Show
Ignore:
Timestamp:
06/04/08 15:31:58 (6 years ago)
Author:
daisuke
Message:

Add recipient chooser so that algorithm can also be configured

Location:
lang/perl/XMPP-Bomber/trunk
Files:
3 added
3 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/XMPP-Bomber/trunk/lib/XMPP/Bomber/Client/Flooder.pm

    r13200 r13205  
    6262} 
    6363 
     64sub choose_recipient 
     65{ 
     66    my $self = shift; 
     67    $self->recipient_chooser->choose( $self->recipients ); 
     68} 
     69 
    64701; 
  • lang/perl/XMPP-Bomber/trunk/lib/XMPP/Bomber/Role/Client.pm

    r13200 r13205  
    2525); 
    2626 
     27has 'recipients' => ( 
     28    is => 'rw', 
     29    isa => 'AccountList', 
     30    auto_deref => 1, 
     31    required => 1, 
     32); 
     33 
    2734has 'condvar' => ( 
    2835    is => 'rw', 
     
    3340    is => 'rw', 
    3441    does => 'XMPP::Bomber::Role::ContentProvider' 
     42); 
     43 
     44has 'recipient_chooser' => ( 
     45    is => 'rw', 
     46    does => 'XMPP::Bomber::Role::RecipientChooser' 
    3547); 
    3648 
  • lang/perl/XMPP-Bomber/trunk/t/client/01_flood.t

    r13200 r13205  
    66    use_ok("XMPP::Bomber::Client::Flooder"); 
    77    use_ok("XMPP::Bomber::ContentProvider::Gibberish"); 
     8    use_ok("XMPP::Bomber::RecipientChooser::Static"); 
    89} 
    910 
     
    2021            ) 
    2122        ], 
     23        recipients => [], 
     24        recipient_chooser => XMPP::Bomber::RecipientChooser::Static->new( 
     25            static_recipient => XMPP::Bomber::Account->new( 
     26                username => "recipient", 
     27                domain   => "example.com", 
     28                password => "bar" 
     29            ) 
     30        ), 
    2231        content_provider => XMPP::Bomber::ContentProvider::Gibberish->new() 
    2332    );