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));
            });
        }
        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);
            });
        }
        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);
            });
        }
示例#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);
     });
 }
示例#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));
     });
 }
示例#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);
            });
        }