AnyEvent-WebSocket-Client

 view release on metacpan or  search on metacpan

t/anyevent_websocket_client.t  view on Meta::CPAN

use lib 't/lib';
use Test2::Plugin::EV;
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use Test2::Tools::WebSocket::Server qw( start_server start_echo );
use AnyEvent::WebSocket::Client;

subtest 'new' => sub {

  my $client = AnyEvent::WebSocket::Client->new;
  isa_ok $client, 'AnyEvent::WebSocket::Client';

t/anyevent_websocket_client__proxy.t  view on Meta::CPAN

use lib 't/lib';
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use AnyEvent;
use AnyEvent::WebSocket::Client;

sub get_env {
    my ($env_name, $desc) = @_;
    my $val = $ENV{$env_name};
    if(!defined($val) || $val eq "") {
        skip_all "Set $env_name environment variable to $desc to enable this test.";

t/anyevent_websocket_client__scope.t  view on Meta::CPAN

use lib 't/lib';
use Test2::Require::Module 'Capture::Tiny';
use Test2::Require::Module 'Test::Memory::Cycle';
use Test2::Require::Module 'Devel::Cycle';
use Test2::Plugin::EV;
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use Test2::Tools::WebSocket::Server qw( start_server );
use AnyEvent::WebSocket::Client;
use Capture::Tiny qw( capture_stderr );
use Test::Memory::Cycle;

t/anyevent_websocket_client__server_initial_data_shutdown.t  view on Meta::CPAN

use lib 't/lib';
use Test2::Require::SSL ();
use Test2::Plugin::EV;
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use Test2::Tools::WebSocket::Server qw( start_server );
use AnyEvent::WebSocket::Client;

my @test_cases = (
  { label => 'without TLS', tls => 0,                                     },
  { label => 'with TLS',    tls => 1, tls_cert => do { local $/; <DATA> } },

t/anyevent_websocket_client__ssl.t  view on Meta::CPAN

use lib 't/lib';
use Test2::Require::SSL;
use Test2::Plugin::EV;
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use Test2::Tools::WebSocket::Server qw( start_server );
use AnyEvent::WebSocket::Client;

my $counter;
my $max;

t/anyevent_websocket_connection.t  view on Meta::CPAN

use utf8;
use lib 't/lib';
use Test2::Plugin::EV;
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use Test2::Tools::WebSocket::Connection qw( create_connection_pair create_connection_and_handle );
use AnyEvent::WebSocket::Connection;

subtest 'send' => sub {

  my($x,$y) = create_connection_pair;

t/anyevent_websocket_connection__counter_shutdown.t  view on Meta::CPAN

use lib 't/lib';
use Test2::Plugin::EV;
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use AnyEvent::WebSocket::Connection;
use Test2::Tools::WebSocket::Connection qw( create_connection_and_handle );

note(<<ENDNOTE);
Connection should shutdown its socket when the peer shuts down.
This is because in some cases the socket is still half-open (writable)
when it detects the shutdown from its peer. If it remains half-open,

t/anyevent_websocket_connection__destroy_in_callbacks.t  view on Meta::CPAN

use lib 't/lib';
use Test2::Plugin::EV;
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use Test2::Tools::WebSocket::Connection qw( create_connection_pair );
use AnyEvent::WebSocket::Connection;
use Scalar::Util qw(weaken);

note("It should be safe (exception-free) to destroy the Connection object in callbacks.");

sub test_case

t/anyevent_websocket_connection__finish_callback.t  view on Meta::CPAN

use lib 't/lib';
use Test2::Plugin::EV;
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use Test2::Tools::WebSocket::Connection qw( create_connection_pair );
use AnyEvent::WebSocket::Connection;

note("finish callback should be called only once");

sub test_case
{

t/anyevent_websocket_connection__payload_size.t  view on Meta::CPAN

use lib 't/lib';
use Test2::Plugin::EV;
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use Test2::Tools::WebSocket::Connection qw( create_connection_and_handle );
use AnyEvent::WebSocket::Connection;
use AE;
use AnyEvent::WebSocket::Connection;
use Protocol::WebSocket::Frame;

my $connection;

t/mojo.t  view on Meta::CPAN

use lib 't/lib';
use Test2::Require::NotWindows;
use Test2::Require::Module 'EV';
use Test2::Require::Module 'Mojolicious' => '3.0';
use Test2::Require::Module 'Mojolicious::Lite';
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use Test2::Tools::WebSocket::Mojo qw( start_mojo );
use AnyEvent::WebSocket::Client;
use Mojolicious::Lite;

t/mojo_echo.t  view on Meta::CPAN

use lib 't/lib';
use Test2::Require::NotWindows;
use Test2::Require::Module 'EV';
use Test2::Require::Module 'Mojolicious' => '3.0';
use Test2::Require::Module 'Mojolicious::Lite';
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use Test2::Tools::WebSocket::Mojo qw( start_mojo );
use AnyEvent::WebSocket::Client;
use Mojolicious::Lite;

t/mojo_receive.t  view on Meta::CPAN

use utf8;
use lib 't/lib';
use Test2::Require::NotWindows;
use Test2::Require::Module 'EV';
use Test2::Require::Module 'Mojolicious' => '3.0';
use Test2::Require::Module 'Mojolicious::Lite';
use Test2::Plugin::AnyEvent::Timeout;
use Test2::V0 -no_srand => 1;
use Test2::Tools::WebSocket::Mojo qw( start_mojo );
use AnyEvent::WebSocket::Client;
use Mojolicious::Lite;
use Protocol::WebSocket;



( run in 0.476 second using v1.01-cache-2.11-cpan-87723dcf8b7 )