File: tcpip.t

package info (click to toggle)
libxml-stream-perl 1.24-4%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 952 kB
  • sloc: perl: 4,821; xml: 64; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use strict;
use warnings;

use Test::More tests => 4;

BEGIN{ use_ok("XML::Stream","Node"); }

my $stream = XML::Stream->new(style=>"node");
ok( defined($stream), "new()" );
isa_ok( $stream, "XML::Stream" );

SKIP:
{
    skip "No network communication allowed", 1 if ($ENV{NO_NETWORK});

    my $sock = IO::Socket::INET->new(PeerAddr=>'jabber.org:5222');
    skip "Cannot open connection (maybe a firewall?)",1 unless defined($sock);
    
    my $status = $stream->Connect(hostname=>"jabber.org",
                                  port=>5222,
                                  namespace=>"jabber:client",
                                  connectiontype=>"tcpip",
                                  timeout=>10);
    ok( defined($status), "Made connection");
}