private TestKitBase(TestKitAssertions assertions, ActorSystem system, Config config, string actorSystemName, string testActorName) { if(assertions == null) throw new ArgumentNullException("assertions"); if(system == null) { var configWithDefaultFallback = config.SafeWithFallback(_defaultConfig); system = ActorSystem.Create(actorSystemName ?? "test", configWithDefaultFallback); } _assertions = assertions; _system = system; system.RegisterExtension(new TestKitExtension()); system.RegisterExtension(new TestKitAssertionsExtension(assertions)); _testKitSettings = TestKitExtension.For(_system); _queue = new BlockingQueue<MessageEnvelope>(); _log = Logging.GetLogger(system, GetType()); _eventFilterFactory = new EventFilterFactory(this); if (string.IsNullOrEmpty(testActorName)) testActorName = "testActor" + _testActorId.IncrementAndGet(); var testActor = CreateTestActor(system, testActorName); //Wait for the testactor to start AwaitCondition(() => { var repRef = testActor as RepointableRef; return repRef == null || repRef.IsStarted; }, TimeSpan.FromSeconds(5), TimeSpan.FromMilliseconds(10)); if(!(this is NoImplicitSender)) { InternalCurrentActorCellKeeper.Current = (ActorCell)((ActorRefWithCell)testActor).Underlying; } _testActor = testActor; }
private TestKitBase(TestKitAssertions assertions, ActorSystem system, Config config, string actorSystemName = null) { if (assertions == null) { throw new ArgumentNullException("assertions"); } if (system == null) { var configWithDefaultFallback = config.SafeWithFallback(_defaultConfig); system = ActorSystem.Create(actorSystemName ?? "test", configWithDefaultFallback); } _assertions = assertions; _system = system; system.RegisterExtension(new TestKitExtension()); system.RegisterExtension(new TestKitAssertionsExtension(assertions)); _testKitSettings = TestKitExtension.For(_system); _queue = new BlockingQueue <MessageEnvelope>(); _log = Logging.GetLogger(system, GetType()); var testActor = CreateTestActor(system, "testActor" + _testActorId.IncrementAndGet()); _testActor = testActor; //Wait for the testactor to start AwaitCondition(() => { var repRef = _testActor as RepointableRef; return(repRef == null || repRef.IsStarted); }, TimeSpan.FromSeconds(1), TimeSpan.FromMilliseconds(10)); }
private TestKitBase(TestKitAssertions assertions, ActorSystem system, Config config, string actorSystemName = null) { if(assertions == null) throw new ArgumentNullException("assertions"); if(system == null) { var configWithDefaultFallback = config.SafeWithFallback(_defaultConfig); system = ActorSystem.Create(actorSystemName ?? "test", configWithDefaultFallback); } _assertions = assertions; _system = system; system.RegisterExtension(new TestKitExtension()); system.RegisterExtension(new TestKitAssertionsExtension(assertions)); _testKitSettings = TestKitExtension.For(_system); _queue = new BlockingQueue<MessageEnvelope>(); _log = Logging.GetLogger(system, GetType()); var testActor = CreateTestActor(system, "testActor" + _testActorId.IncrementAndGet()); _testActor = testActor; //Wait for the testactor to start AwaitCondition(() => { var repRef = _testActor as RepointableRef; return repRef == null || repRef.IsStarted; }, TimeSpan.FromSeconds(1), TimeSpan.FromMilliseconds(10)); }
private TestKitBase(TestKitAssertions assertions, ActorSystem system, Config config, string actorSystemName, string testActorName) { if (assertions == null) { throw new ArgumentNullException("assertions"); } if (system == null) { var configWithDefaultFallback = config.SafeWithFallback(_defaultConfig); system = ActorSystem.Create(actorSystemName ?? "test", configWithDefaultFallback); } _assertions = assertions; _system = system; system.RegisterExtension(new TestKitExtension()); system.RegisterExtension(new TestKitAssertionsExtension(assertions)); _testKitSettings = TestKitExtension.For(_system); _queue = new BlockingQueue <MessageEnvelope>(); _log = Logging.GetLogger(system, GetType()); _eventFilterFactory = new EventFilterFactory(this); if (string.IsNullOrEmpty(testActorName)) { testActorName = "testActor" + _testActorId.IncrementAndGet(); } var testActor = CreateTestActor(system, testActorName); //Wait for the testactor to start AwaitCondition(() => { var repRef = testActor as RepointableRef; return(repRef == null || repRef.IsStarted); }, TimeSpan.FromSeconds(5), TimeSpan.FromMilliseconds(10)); if (!(this is NoImplicitSender)) { InternalCurrentActorCellKeeper.Current = (ActorCell)((ActorRefWithCell)testActor).Underlying; } _testActor = testActor; }
/// <summary> /// Create a new instance of the <see cref="TestKitBase"/> class. /// If no <paramref name="system"/> is passed in, a new system /// with <see cref="DefaultConfig"/> will be created. /// </summary> /// <param name="assertions"></param> /// <param name="system">Optional: The actor system.</param> /// <param name="testActorName">Optional: The name of the TestActor.</param> protected TestKitBase(TestKitAssertions assertions, ActorSystem system = null, string testActorName = null) : this(assertions, system, _defaultConfig, null, testActorName) { }
public TestKitAssertionsProvider(TestKitAssertions assertions) { _assertions = assertions; }
/// <summary> /// Create a new instance of the <see cref="TestKitBase"/> class. /// If no <paramref name="system"/> is passed in, a new system /// with <see cref="DefaultConfig"/> will be created. /// </summary> /// <param name="assertions"></param> /// <param name="system">Optional: The actor system.</param> protected TestKitBase(TestKitAssertions assertions, ActorSystem system = null) : this(assertions, system, _defaultConfig) { }
protected MultiNodeClusterSpec(MultiNodeConfig config) : base(config) { _assertions = new XunitAssertions(); _roleNameComparer = new RoleNameComparer(this); }
/// <summary> /// Create a new instance of the <see cref="TestKitBase"/> class. /// If no <paramref name="system"/> is passed in, a new system /// with <see cref="DefaultConfig"/> will be created. /// </summary> /// <param name="assertions"></param> /// <param name="system">Optional: The actor system.</param> /// <param name="testActorName">Optional: The name of the TestActor.</param> protected TestKitBase(TestKitAssertions assertions, ActorSystem system = null, string testActorName=null) : this(assertions, system, _defaultConfig, null, testActorName) { }
public TestProbe(ActorSystem system, TestKitAssertions assertions) : base(assertions, system) { }
public TestProbe(ActorSystem system, TestKitAssertions assertions, string testProbeName=null) : base(assertions, system, testProbeName) { }
public TestProbe(ActorSystem system, TestKitAssertions assertions, string testProbeName = null) : base(assertions, system, testProbeName) { }
/// <summary> /// Create a new instance of the <see cref="TestKitBase"/> class. /// A new system with the specified configuration will be created. /// </summary> /// <param name="config">The configuration to use for the system.</param> /// <param name="testActorName">Optional: The name of the TestActor.</param> /// <param name="assertions"></param> /// <param name="actorSystemName"></param> protected TestKitBase(TestKitAssertions assertions, Config config, string actorSystemName = null, string testActorName = null) : this(assertions, null, config ?? ConfigurationFactory.Empty, actorSystemName, testActorName) { }
public TestKitAssertionsExtension(TestKitAssertions assertions) { _assertions = assertions; }