• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# MiniNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: SetUp

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

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

            _connection.SetStreamMetadataAsync(Stream, ExpectedVersion.EmptyStream, StreamMetadata.Build().SetMaxCount(3)).Wait();

            _testEvents = Enumerable.Range(0, 5).Select(x => TestEvent.NewTestEvent(data: x.ToString())).ToArray();
            _connection.AppendToStreamAsync(Stream, ExpectedVersion.EmptyStream, _testEvents).Wait();
        }
开发者ID:czcz1024,项目名称:EventStore,代码行数:14,代码来源:when_having_max_count_set_for_stream.cs


示例17: TestFixtureSetUp

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

            _conn = BuildConnection(_node);
            _conn.ConnectAsync().Wait();
            //Create 80000 events
            for(var i = 0; i < 80; i++)
            {
                _conn.AppendToStreamAsync(_streamName, ExpectedVersion.Any, CreateThousandEvents()).Wait();
            }

            _settings = new CatchUpSubscriptionSettings(100, 1, false, true);
        }
开发者ID:EventStore,项目名称:EventStore,代码行数:16,代码来源:catchup_subscription_handles_small_batch_sizes.cs


示例18: TestFixtureSetUp

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

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

            _eventId0 = Guid.NewGuid();
            _eventId1 = Guid.NewGuid();

            _conn.AppendToStream("test-stream",
                                 -1, 
                                 new EventData(_eventId0, "event0", false, new byte[3], new byte[2]),
                                 new EventData(_eventId1, "event1", false, new byte[7], new byte[10]));
            _conn.DeleteStream("deleted-stream", -1, hardDelete: true);
        }
开发者ID:msbahrul,项目名称:EventStore,代码行数:18,代码来源:read_event_should.cs


示例19: SetUp

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

            _firstEvent = TestEvent.NewTestEvent();

            _connection = BuildConnection(_node);
            _connection.ConnectAsync().Wait();

            Assert.AreEqual(2, _connection.AppendToStreamAsync("test-stream",
                                                          ExpectedVersion.NoStream,
                                                          _firstEvent,
                                                          TestEvent.NewTestEvent(),
                                                          TestEvent.NewTestEvent()).Result.NextExpectedVersion);

            using (var transaction = _connection.StartTransactionAsync("test-stream", 2).Result)
            {
                Assert.AreEqual(2, transaction.CommitAsync().Result.NextExpectedVersion);
            }
        }
开发者ID:czcz1024,项目名称:EventStore,代码行数:22,代码来源:when_committing_empty_transaction.cs


示例20: SetUp

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

            _firstEvent = TestEvent.NewTestEvent();

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

            _connection.AppendToStream("test-stream",
                                       ExpectedVersion.NoStream,
                                       _firstEvent,
                                       TestEvent.NewTestEvent(),
                                       TestEvent.NewTestEvent());

            using (var transaction = _connection.StartTransaction("test-stream", 3))
            {
                transaction.Commit();
            }
        }
开发者ID:johlrich,项目名称:EventStore,代码行数:22,代码来源:when_committing_empty_transaction.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MiniProfiler类代码示例发布时间:2022-05-24
下一篇:
C# MinecraftServer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap