Beispiel #1
0
 public TestBarrier(TestKitBase testKit, int count, TimeSpan? defaultTimeout=null)
 {
     _testKit = testKit;
     _count = count;
     _defaultTimeout = defaultTimeout.GetValueOrDefault(testKit.TestKitSettings.DefaultTimeout);
     _barrier = new Barrier(count);
 }
 public CleanupLocalSnapshots(TestKitBase testKit)
 {
     StorageLocations = new[]
     {
         "akka.persistence.snapshot-store.local.dir"
     }.Select(s => new DirectoryInfo(testKit.Sys.Settings.Config.GetString(s))).ToList();
 }
Beispiel #3
0
            public TestContainer(TestKitBase testKit, GlobalOptions options = null, Type replayWorkerType = null)
            {
                var query = new ProjectionStreamQuery();
                Reader = testKit.CreateTestProbe();
                Writer = testKit.CreateTestProbe();
                options = options ?? new GlobalOptions();

                var props = Even.ProjectionStream.CreateProps(query, Reader, Writer, options);
                ProjectionStream = testKit.Sys.ActorOf(props);
            }
Beispiel #4
0
 // ReSharper disable once MemberCanBePrivate.Global - Akka needs it to be public
 public ProxyActor(TestKitBase testKit, ICanTell target)
 {
     IActorRef testActor = testKit.TestActor;
     ReceiveAny(m =>
     {
         if (Sender.Equals(testActor))
             target.Tell(m, Self);
         else
             testActor.Tell(m, Self);
     });
 }
            public TestSystem(TestKitBase testKit, string name, int containerCount)
            {
                _testKit = testKit;
                _name = name;
                _nullDiscovery = _testKit.ActorOf(BlackHoleActor.Props);

                Table = _testKit.ActorOfAsTestActorRef(
                    () => new Table("TEST", _name, _nullDiscovery, typeof(IncrementalIntegerIdGenerator), null),
                    _name);
                Containers = new List<TestActorRef<DistributedActorTableContainer<long>>>();
                for (int i = 0; i < containerCount; i++)
                    AddConstainer();
            }
 public UnacceptedConnectionTest(TestKitBase kit, bool pullMode = false)
     : base(kit)
 {
     _pullMode = pullMode;
 }
 public StreamPuppet(IPublisher<int> p, TestKitBase kit)
 {
     _probe = TestSubscriber.CreateManualProbe<int>(kit);
     p.Subscribe(_probe);
     _subscription = _probe.ExpectSubscription();
 }
Beispiel #8
0
            public TestSetup(TestKitBase kit, bool pullMode)
            {
                _kit = kit;
                _pullMode = pullMode;

                _handler = kit.CreateTestProbe();
                _handlerRef = _handler.Ref;
                _bindCommander = kit.CreateTestProbe();
                _parent = kit.CreateTestProbe();
                _selectorRouter = kit.CreateTestProbe();
                _endpoint = TestUtils.TemporaryServerAddress();

                _registerCallReceiver = kit.CreateTestProbe();
                _interestCallReceiver = kit.CreateTestProbe();

                _parentRef = new TestActorRef<ListenerParent>(kit.Sys, Props.Create(() => new ListenerParent(this, pullMode)));
            }
 public StateObj(TestKitBase testKit)
 {
     S = "";
     Finished = testKit.CreateTestBarrier(2);
 }
Beispiel #10
0
 public TcpWriteProbe(TestKitBase testkit)
 {
     PublisherProbe = testkit.CreateManualPublisherProbe<ByteString>();
     TcpWriteSubscription =
         new Lazy<StreamTestKit.PublisherProbeSubscription<ByteString>>(
             () => PublisherProbe.ExpectSubscription());
 }
Beispiel #11
0
 public TcpReadProbe(TestKitBase testkit)
 {
     SubscriberProbe = testkit.CreateManualSubscriberProbe<ByteString>();
     TcpReadSubscription = new Lazy<ISubscription>(() => SubscriberProbe.ExpectSubscription());
 }
Beispiel #12
0
 public ServerConnection(TestKitBase testkit, IActorRef connectionActor)
 {
     _connectionActor = connectionActor;
     _connectionProbe = testkit.CreateTestProbe();
 }
Beispiel #13
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="testkit">TBD</param>
 /// <param name="actorSystem">TBD</param>
 /// <param name="filters">TBD</param>
 public EventFilterFactory(TestKitBase testkit, ActorSystem actorSystem, IReadOnlyList <EventFilterBase> filters)
     : this(testkit, actorSystem)
 {
     _filters = filters;
 }
Beispiel #14
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="testkit">TBD</param>
 public EventFilterFactory(TestKitBase testkit)
 {
     _testkit = testkit;
     _system  = _testkit.Sys;
 }
Beispiel #15
0
        public LocalServerTest(TestKitBase kit)
        {
            _system = kit.Sys;

            UserHandler = kit.CreateTestProbe();
            Selector = kit.CreateTestProbe();
            RegisterCallReceiver = kit.CreateTestProbe();
            InterestCallReceiver = kit.CreateTestProbe();

            ChannelProbe = kit.CreateTestProbe();
        }
Beispiel #16
0
 public static Props Props(TestKitBase testKit, ICanTell target)
 {
     return Akka.Actor.Props.Create(() => new ProxyActor(testKit, target));
 }
 public EventFilterFactory(TestKitBase testkit, IReadOnlyList <EventFilterBase> filters)
 {
     _testkit = testkit;
     _filters = filters;
 }
 public EventFilterFactory(TestKitBase testkit)
 {
     _testkit = testkit;
 }
Beispiel #19
0
 public TestBarrier(TestKitBase testKit, int count)
 {
     _testKit = testKit;
     _count = count;
     _barrier = new Barrier(count);
 }
Beispiel #20
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="testkit">TBD</param>
 /// <param name="system">TBD</param>
 public EventFilterFactory(TestKitBase testkit, ActorSystem system)
 {
     _testkit = testkit;
     _system  = system;
 }
Beispiel #21
0
 public EstablishedConnectionTest(TestKitBase kit, bool keepOpenOnPeerClosed = false, bool useResumeWriting = true, bool pullMode = false) 
     : base(kit, pullMode)
 {
     _kit = kit;
     KeepOpenOnPeerClosed = keepOpenOnPeerClosed;
     UseResumeWriting = useResumeWriting;
     PullMode = pullMode;
 }
Beispiel #22
0
            public Server(TestKitBase testkit, EndPoint address = null)
            {
                _testkit = testkit;
                Address = address ?? TestUtils.TemporaryServerAddress();

                ServerProbe = testkit.CreateTestProbe();
                ServerRef = testkit.ActorOf(TestServerProps(Address, ServerProbe.Ref));
                ServerProbe.ExpectMsg<Tcp.Bound>();
            }
Beispiel #23
0
 public TestBarrier(TestKitBase testKit, int count)
 {
     _testKit = testKit;
     _count   = count;
     _barrier = new Barrier(count);
 }