Agent-TCLI

 view release on metacpan or  search on metacpan

t/TCLI.Package.XMPP.t  view on Meta::CPAN

#!/usr/bin/env perl
# $Id: TCLI.Package.XMPP.t 49 2007-04-25 10:32:36Z hacker $

use Test::More tests => 32;
use lib 'blib/lib';
use warnings;
use strict;

use Getopt::Lucid qw(:all);

sub VERBOSE () { 0 }

my ($opt, $verbose,$domain,$username,$password,$host, $poe_td, $poe_te);

eval {$opt = Getopt::Lucid->getopt([
		Param("domain"),
		Param("username|u"),
		Param("password|p"),
		Param("host"),
		Counter("poe_debug|d"),
		Counter("poe_event|e"),
		Counter("xmpp_debug|x"),
		Counter("verbose|v"),
	])};
if($@) {die "ERROR: $@";}

$verbose = $opt->get_verbose ? $opt->get_verbose : VERBOSE;

# xmpp username/password to log in with
$username = $opt->get_username ? $opt->get_username : 'testy1';
$password = $opt->get_password ? $opt->get_password : 'testy1';
$domain = $opt->get_domain ? $opt->get_domain : 'testing.erichacker.com';
$host = $opt->get_host ? $opt->get_host : 'testing.erichacker.com';
$poe_td = $opt->get_poe_debug;
$poe_te = $opt->get_poe_event;

sub POE::Kernel::TRACE_DEFAULT  () { $poe_td }
sub POE::Kernel::TRACE_EVENTS  () { $poe_te }

use Agent::TCLI::Transport::Test;
use Agent::TCLI::Testee;
use Agent::TCLI::Transport::XMPP;
use Agent::TCLI::User;
use POE;

# TASK Test suite is not complete. Need testing for catching errors.

use_ok('Agent::TCLI::Package::XMPP');
use_ok('Net::XMPP::JID');

# Set up transport, otherwise commands don't work

my @packages = (
#	Agent::TCLI::Package::XMPP->new(
#	     'verbose'    => $verbose ,
#		 'do_verbose'	=> sub { diag( @_ ) },
#	),
);

my @users = (
	Agent::TCLI::User->new(
		'id'		=> 'testy2@testing.erichacker.com',
		'protocol'	=> 'xmpp',
		'auth'		=> 'master',
	),



( run in 0.580 second using v1.01-cache-2.11-cpan-39bf76dae61 )