public void TestHoconActor_should_log_debug_messages_invisibly_when_loglevel_is_info()
 {
     // should see no debug messages from the actor since overrode the config
     EventFilter.Debug("TestHoconActor got a message").Expect(0, () =>
     {
         var actor = Sys.ActorOf(Props.Create(() => new TestHoconActor()));
         actor.Tell("foo");
     });
 }
예제 #2
0
        public void A_GraphStageLogic_must_support_logging_in_custom_graphstage()
        {
            const int n = 10;

            EventFilter.Debug(start: "Randomly generated").Expect(n, () =>
            {
                Source.FromGraph(new RandomLettersSource())
                .Take(n)
                .RunWith(Sink.Ignore <string>(), Materializer)
                .Wait(TimeSpan.FromSeconds(3));
            });
        }
예제 #3
0
        public UntrustedSpec(ITestOutputHelper output)
            : base(@"
            akka.actor.provider = ""Akka.Remote.RemoteActorRefProvider, Akka.Remote""
            akka.remote.untrusted-mode = on
            akka.remote.trusted-selection-paths = [""/user/receptionist"", ]    
            akka.remote.dot-netty.tcp = {
                port = 0
                hostname = localhost
            }
            akka.loglevel = DEBUG
            ", output)
        {
            _client = ActorSystem.Create("UntrustedSpec-client", ConfigurationFactory.ParseString(@"
                akka.actor.provider =  ""Akka.Remote.RemoteActorRefProvider, Akka.Remote""
                 akka.remote.dot-netty.tcp = {
                    port = 0
                    hostname = localhost
                }                
            ").WithFallback(Sys.Settings.Config));

            _address      = Sys.AsInstanceOf <ExtendedActorSystem>().Provider.DefaultAddress;
            _receptionist = Sys.ActorOf(Props.Create(() => new Receptionist(TestActor)), "receptionist");

            _remoteDaemon = new Lazy <IActorRef>(() =>
            {
                var p = CreateTestProbe(_client);
                _client.ActorSelection(new RootActorPath(_address) / _receptionist.Path.Elements)
                .Tell(new IdentifyReq("/remote"), p.Ref);
                return(p.ExpectMsg <ActorIdentity>().Subject);
            });

            _target2 = new Lazy <IActorRef>(() =>
            {
                var p = CreateTestProbe(_client);
                _client.ActorSelection(new RootActorPath(_address) / _receptionist.Path.Elements)
                .Tell(new IdentifyReq("child2"), p.Ref);

                var actorRef = p.ExpectMsg <ActorIdentity>().Subject;
                return(actorRef);
            });


            EventFilter.Debug().Mute();
        }
예제 #4
0
            public void ClusterClient_can_start_with_zero_buffer()
            {
                Within(30.Seconds(), () =>
                {
                    //start the cluster client
                    RunOn(() =>
                    {
                        var c = Sys.ActorOf(ClusterClient.Props(ClusterClientSettings.Create(Sys).WithBufferSize(0).WithInitialContacts(InitialContacts)), "client1");
                        //check for the debug log message that the cluster client will output in case of an 0 buffersize
                        EventFilter.Debug(start: "Receptionist not available and buffering is disabled, dropping message").ExpectOne(
                            () =>
                        {
                            c.Tell(new ClusterClient.Send("/user/testService", "hello"));
                        });

                        //ExpectMsg<string>(3.Seconds()).Should().Be("hello");


                        ExpectTerminated(c, 10.Seconds());
                    }, _config.Client);

                    EnterBarrier("end-of-test");
                });
            }