本文整理汇总了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();
}
示例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);
}
}
示例3: TestFixtureSetUp
public override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_node = new MiniNode(PathName);
_node.Start();
_manager = new UsersManager(new NoopLogger(), _node.ExtHttpEndPoint, TimeSpan.FromSeconds(5));
}
示例4: TestFixtureSetUp
public override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_node = new MiniNode(PathName, skipInitializeStandardUsersCheck: false);
_node.Start();
_conn = TestConnection.Create(_node.TcpEndPoint);
_conn.Connect();
When();
}
示例5: TestFixtureSetUp
public override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_node = new MiniNode(PathName);
_node.Start();
_connection = TestConnection.Create(_node.TcpEndPoint);
_connection.Connect();
}
示例6: TestFixtureSetUp
public override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_node = new MiniNode(PathName);
_node.Start();
_conn = EventStoreConnection.Create(_node.TcpEndPoint);
_conn.ConnectAsync().Wait();
}
示例7: TestFixtureSetUp
public override void TestFixtureSetUp()
{
base.TestFixtureSetUp();
_node = new MiniNode(PathName);
_node.Start();
_connection = BuildConnection(_node);
_connection.ConnectAsync().Wait();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
}
示例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();
}
示例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);
}