Ejemplo n.º 1
0
        public void An_Outgoing_Connection_Must_Report_Failed_connection_attempt_when_target_cannot_be_resolved()
        {
            var test    = new UnacceptedConnectionTest(this);
            var address = new DnsEndPoint("notthere.local", 666);

            test.ConnectionActor = test.CreateConnectionActorWithoutRegistration(address);
            test.Run(x =>
            {
                x.ConnectionActor.Tell(x.NewChannelRegistration());
                x.UserHandler.ExpectMsg <Tcp.CommandFailed>(TimeSpan.FromSeconds(30));
            });
        }
Ejemplo n.º 2
0
        public void An_Outgoing_Connection_Must_Report_Failed_connection_attempt_when_timing_out()
        {
            var unboundAddress = TestUtils.TemporaryServerAddress();
            var test           = new UnacceptedConnectionTest(this);

            test.ConnectionActor = test.CreateConnectionActor(serverAddress: unboundAddress, timeout: TimeSpan.FromMilliseconds(100));
            test.Run(x =>
            {
                x.UserHandler.ExpectMsg <Tcp.CommandFailed>();
                Watch(x.ConnectionActor);
                ExpectTerminated(x.ConnectionActor);
            });
        }
Ejemplo n.º 3
0
        public void An_Outgoing_Connection_Must_Report_Failed_connection_attempt_when_target_is_unreachable()
        {
            var unboundAddress = TestUtils.TemporaryServerAddress();
            var test           = new UnacceptedConnectionTest(this);

            test.ConnectionActor = test.CreateConnectionActor(serverAddress: unboundAddress);
            test.Run(x =>
            {
                //x.ClientSideChannel.Socket.Poll(3000, SelectMode.SelectWrite).ShouldBe(true);  // In .NET we cant select on 'Connectable' (I think)

                Thread.Sleep(3000);
                x.Selector.Send(x.ConnectionActor, SelectionHandler.ChannelConnectable.Instance);
                x.UserHandler.ExpectMsg <Tcp.CommandFailed>();

                Watch(x.ConnectionActor);
                ExpectTerminated(x.ConnectionActor);
            });
        }
Ejemplo n.º 4
0
 public void An_Outgoing_Connection_Must_Report_Failed_connection_attempt_when_timing_out()
 {
     var unboundAddress = TestUtils.TemporaryServerAddress();
     var test = new UnacceptedConnectionTest(this);
     test.ConnectionActor = test.CreateConnectionActor(serverAddress: unboundAddress, timeout:TimeSpan.FromMilliseconds(100));
     test.Run(x =>
     {   
         x.UserHandler.ExpectMsg<Tcp.CommandFailed>();
         Watch(x.ConnectionActor);
         ExpectTerminated(x.ConnectionActor);
     });
 }
Ejemplo n.º 5
0
 public void An_Outgoing_Connection_Must_Report_Failed_connection_attempt_when_target_cannot_be_resolved()
 {
     var test = new UnacceptedConnectionTest(this);
     var address = new DnsEndPoint("notthere.local", 666);
     test.ConnectionActor = test.CreateConnectionActorWithoutRegistration(address);
     test.Run(x =>
     {
         x.ConnectionActor.Tell(x.NewChannelRegistration());
         x.UserHandler.ExpectMsg<Tcp.CommandFailed>(TimeSpan.FromSeconds(30));
     });
 }
Ejemplo n.º 6
0
        public void An_Outgoing_Connection_Must_Report_Failed_connection_attempt_when_target_is_unreachable()
        {
            var unboundAddress = TestUtils.TemporaryServerAddress();
            var test = new UnacceptedConnectionTest(this);
            test.ConnectionActor = test.CreateConnectionActor(serverAddress: unboundAddress);
            test.Run(x =>
            {
                //x.ClientSideChannel.Socket.Poll(3000, SelectMode.SelectWrite).ShouldBe(true);  // In .NET we cant select on 'Connectable' (I think)

                Thread.Sleep(3000);
                x.Selector.Send(x.ConnectionActor, SelectionHandler.ChannelConnectable.Instance);
                x.UserHandler.ExpectMsg<Tcp.CommandFailed>();

                Watch(x.ConnectionActor);
                ExpectTerminated(x.ConnectionActor);
            });
        }