当前位置: 首页>>代码示例>>C#>>正文


C# MiniNode类代码示例

本文整理汇总了C#中MiniNode的典型用法代码示例。如果您正苦于以下问题:C# MiniNode类的具体用法?C# MiniNode怎么用?C# MiniNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MiniNode类属于命名空间,在下文中一共展示了MiniNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateNode

        protected void CreateNode()
		{
            var projections = new ProjectionsSubsystem(1, runProjections: ProjectionType.All, startStandardProjections: false);
            Node = new MiniNode(
                PathName, inMemDb: true, skipInitializeStandardUsersCheck: false, subsystems: new ISubsystem[] { projections });
            Node.Start();
		}
开发者ID:EventStore,项目名称:EventStore,代码行数:7,代码来源:ProjectionsManagerTestSuiteMarkerBase.cs

示例2: should_return_stream_not_found

        public void should_return_stream_not_found()
        {
            const string stream1 = "account--696193173";
            const string stream2 = "LPN-FC002_LPK51001";
            using (var store = BuildConnection(_node))
            {
                store.ConnectAsync().Wait();
                //Write event to stream 1
                Assert.AreEqual(0, store.AppendToStreamAsync(stream1, ExpectedVersion.EmptyStream, new EventData(Guid.NewGuid(), "TestEvent", true, null, null)).Result.NextExpectedVersion);
                //Write 100 events to stream 2 which will have the same hash as stream 1.
                for(int i = 0; i < 100; i++){
                    Assert.AreEqual(i, store.AppendToStreamAsync(stream2, ExpectedVersion.Any, new EventData(Guid.NewGuid(), "TestEvent", true, null, null)).Result.NextExpectedVersion);
                }
            }
            var tcpPort = _node.TcpEndPoint.Port;
            var tcpSecPort = _node.TcpSecEndPoint.Port;
            var httpPort = _node.ExtHttpEndPoint.Port;
            _node.Shutdown(keepDb: true, keepPorts: true);

            //Restart the node to ensure the read index stream info cache is empty
            _node = new MiniNode(PathName, 
                tcpPort, tcpSecPort, httpPort, inMemDb: false,
                memTableSize: 20,
                hashCollisionReadLimit: 1,
                indexBitnessVersion: EventStore.Core.Index.PTableVersions.Index32Bit);
           _node.Start();
            using (var store = BuildConnection(_node))
            {
                store.ConnectAsync().Wait();
                Assert.AreEqual(SliceReadStatus.StreamNotFound, store.ReadStreamEventsForwardAsync(stream1, 0, 1, true).Result.Status);
            }
        }
开发者ID:EventStore,项目名称:EventStore,代码行数:32,代码来源:read_stream_events_forward_with_hash_collision.cs

示例3: TestFixtureSetUp

 public override void TestFixtureSetUp()
 {
     base.TestFixtureSetUp();
     _node = new MiniNode(PathName);
     _node.Start();
     _manager = new UsersManager(new NoopLogger(), _node.ExtHttpEndPoint, TimeSpan.FromSeconds(5));
 }
开发者ID:czcz1024,项目名称:EventStore,代码行数:7,代码来源:TestWithNode.cs

示例4: TestFixtureSetUp

 public override void TestFixtureSetUp()
 {
     base.TestFixtureSetUp();
     _node = new MiniNode(PathName, skipInitializeStandardUsersCheck: false);
     _node.Start();
     _conn = TestConnection.Create(_node.TcpEndPoint);
     _conn.Connect();
     When();
 }
开发者ID:kijanawoodard,项目名称:EventStore,代码行数:9,代码来源:SpecificationWithMiniNode.cs

示例5: TestFixtureSetUp

        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            _node = new MiniNode(PathName);
            _node.Start();

            _connection = TestConnection.Create(_node.TcpEndPoint);
            _connection.Connect();
        }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:9,代码来源:when_working_with_stream_metadata_as_byte_array.cs

示例6: TestFixtureSetUp

        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            _node = new MiniNode(PathName);
            _node.Start();

            _conn = EventStoreConnection.Create(_node.TcpEndPoint);
            _conn.ConnectAsync().Wait();
        }
开发者ID:MariuszTrybus,项目名称:EventStore,代码行数:9,代码来源:soft_delete.cs

示例7: TestFixtureSetUp

        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            _node = new MiniNode(PathName);
            _node.Start();

            _connection = BuildConnection(_node);
            _connection.ConnectAsync().Wait();
        }
开发者ID:czcz1024,项目名称:EventStore,代码行数:9,代码来源:when_working_with_stream_metadata_as_structured_info.cs

示例8: TestFixtureSetUp

 public override void TestFixtureSetUp()
 {
     base.TestFixtureSetUp();
     _node = new MiniNode(PathName, 
         inMemDb: false,
         memTableSize: 20,
         hashCollisionReadLimit: 1,
         indexBitnessVersion: EventStore.Core.Index.PTableVersions.Index32Bit);
     _node.Start();
 }
开发者ID:EventStore,项目名称:EventStore,代码行数:10,代码来源:read_stream_events_forward_with_hash_collision.cs

示例9: TestFixtureSetUp

        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            _node = new MiniNode(PathName);
            _node.Start();

            _connection = TestConnection.Create(_node.TcpEndPoint);
            _connection.Connect();

            _testEvents = Enumerable.Range(0, 5).Select(x => TestEvent.NewTestEvent(data: x.ToString())).ToArray();
        }
开发者ID:msbahrul,项目名称:EventStore,代码行数:11,代码来源:when_having_truncatebefore_set_for_stream.cs

示例10: TestFixtureSetUp

 public override void TestFixtureSetUp()
 {
     base.TestFixtureSetUp();
     _node = new MiniNode(PathName, skipInitializeStandardUsersCheck: false);
     _node.Start();
     _HttpEndPoint = _node.HttpEndPoint;
     _conn = BuildConnection(_node);
     _conn.ConnectAsync().Wait();
     Given();
     When();
 }
开发者ID:adbrowne,项目名称:EventStore,代码行数:11,代码来源:SpecificationWithMiniNode.cs

示例11: TestFixtureSetUp

		public override void TestFixtureSetUp()
        {
			base.TestFixtureSetUp();

			_node = new MiniNode(PathName, skipInitializeStandardUsersCheck: false);
			_node.Start();

			var scavengeMessage = new ClientMessage.ScavengeDatabase(new NoopEnvelope(), Guid.NewGuid(), SystemAccount.Principal);
			_node.Node.MainQueue.Publish(scavengeMessage);

			When();
        }
开发者ID:EventStore,项目名称:EventStore,代码行数:12,代码来源:when_running_a_scavenge_from_storage_scavenger.cs

示例12: SetUp

        public void SetUp()
        {
            WebRequest.DefaultWebProxy = new WebProxy();
            _counter = 0;
            _directory = new SpecificationWithDirectoryPerTestFixture();
            _directory.TestFixtureSetUp();
            _node = new MiniNode(_directory.PathName, skipInitializeStandardUsersCheck: false, enableTrustedAuth: true);
            _node.Start();

            _connection = TestConnection.Create(_node.TcpEndPoint);
            _connection.ConnectAsync().Wait();
        }
开发者ID:danieldeb,项目名称:EventStore,代码行数:12,代码来源:TestSuiteMarkerBase.cs

示例13: TestFixtureSetUp

        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            _credentials = new UserCredentials(SystemUsers.Admin, SystemUsers.DefaultAdminPassword);
            var createdMiniNode = false;
            _timeout = TimeSpan.FromSeconds(10);
            // Check if a node is running in ProjectionsManagerTestSuiteMarkerBase
            if (SetUpFixture.Connection != null && SetUpFixture.Node != null)
            {
                _tag = "_" + (++SetUpFixture.Counter);
                _node = SetUpFixture.Node;
                _connection = SetUpFixture.Connection;
            }
            else
            {
                createdMiniNode = true;
                _tag = "_1";

                _node = CreateNode();
                _node.Start();

                _connection = TestConnection.Create(_node.TcpEndPoint);
                _connection.ConnectAsync().Wait();
            }

            try
            {
                _projManager = new ProjectionsManager(new ConsoleLogger(), _node.ExtHttpEndPoint, _timeout);
                Given();
                When();
            }
            catch
            {
                if (createdMiniNode)
                {
                    if (_connection != null)
                    {
                        try {
                            _connection.Close();
                        } catch { 
                        }
                    }
                    if (_node != null)
                    {
                        try { 
                        	_node.Shutdown();
                        } catch {
                        }
                    }
                }
                throw;
            }
        }
开发者ID:SzymonPobiega,项目名称:EventStore,代码行数:53,代码来源:SpecificationWithNodeAndProjectionsManager.cs

示例14: SetUp

        public override void SetUp()
        {
            base.SetUp();
            _node = new MiniNode(PathName, skipInitializeStandardUsersCheck: false);
            _node.Start();

            _conn = TestConnection.Create(_node.TcpEndPoint);
            _conn.ConnectAsync().Wait();
            _conn.SetStreamMetadataAsync("$all", -1,
                                    StreamMetadata.Build().SetReadRole(SystemRoles.All),
                                    new UserCredentials(SystemUsers.Admin, SystemUsers.DefaultAdminPassword)).Wait();
        }
开发者ID:MariuszTrybus,项目名称:EventStore,代码行数:12,代码来源:subscribe_to_all_should.cs

示例15: TestFixtureSetUp

        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            _node = new MiniNode(PathName, skipInitializeStandardUsersCheck: false);
            _node.Start();
            _conn = TestConnection.Create(_node.TcpEndPoint);
            _conn.Connect();
            _conn.SetStreamMetadata("$all", -1,
                                    StreamMetadata.Build().SetReadRole(SystemRoles.All),
                                    new UserCredentials(SystemUsers.Admin, SystemUsers.DefaultAdminPassword));

            _testEvents = Enumerable.Range(0, 20).Select(x => TestEvent.NewTestEvent(x.ToString())).ToArray();
            _conn.AppendToStream("stream", ExpectedVersion.EmptyStream, _testEvents);
        }
开发者ID:msbahrul,项目名称:EventStore,代码行数:14,代码来源:read_all_events_backward_should.cs


注:本文中的MiniNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。