Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 0 additions & 139 deletions src/EventStore.Core.Tests/Http/PersistentSubscription/deleting.cs

This file was deleted.

154 changes: 2 additions & 152 deletions src/EventStore.Core.Tests/Http/PersistentSubscription/statistics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,6 @@ public void returns_not_found()
}
}

[Category("LongRunning")]
[TestFixture(typeof(LogFormat.V2), typeof(string))]
class when_getting_non_existent_stream_statistics<TLogFormat, TStreamId> : with_admin_user<TLogFormat, TStreamId>
{
private HttpResponseMessage _response;

protected override Task Given() => Task.CompletedTask;

protected override async Task When()
{
var request = CreateRequest("/subscriptions/fubar", null, "GET", "text/xml", null);
_response = await GetRequestResponse(request);
}

[Test]
[Retry(5)]
public void returns_not_found()
{
Assert.AreEqual(HttpStatusCode.NotFound, _response.StatusCode);
}
}

[Category("LongRunning")]
[TestFixture(typeof(LogFormat.V2), typeof(string))]
class when_getting_subscription_statistics_for_individual<TLogFormat, TStreamId> : SpecificationWithPersistentSubscriptionAndConnections<TLogFormat, TStreamId>
Expand Down Expand Up @@ -168,9 +146,9 @@ public void detail_rel_href_is_correct()

[Test]
[Retry(5)]
public void has_two_rel_links()
public void has_detail_rel_link()
{
Assert.AreEqual(2,
Assert.AreEqual(1,
_json["links"].Count());
}

Expand Down Expand Up @@ -393,134 +371,6 @@ public void second_subscription_there_are_three_connections()
}
}

[Category("LongRunning")]
[TestFixture(typeof(LogFormat.V2), typeof(string))]
class when_getting_subscription_statistics_for_stream<TLogFormat, TStreamId> : SpecificationWithPersistentSubscriptionAndConnections<TLogFormat, TStreamId>
{
private readonly PersistentSubscriptionSettings _settings = PersistentSubscriptionSettings.Create()
.DoNotResolveLinkTos()
.StartFromCurrent();

private JArray _json;
private EventStorePersistentSubscriptionBase _sub4;
private EventStorePersistentSubscriptionBase _sub3;
private EventStorePersistentSubscriptionBase _sub5;

protected override async Task Given()
{
await base.Given();
await _conn.CreatePersistentSubscriptionAsync(_streamName, "secondgroup", _settings,
DefaultData.AdminCredentials);
_sub3 = _conn.ConnectToPersistentSubscription(_streamName, "secondgroup",
(subscription, @event) =>
{
Console.WriteLine();
return Task.CompletedTask;
},
(subscription, reason, arg3) => Console.WriteLine(), DefaultData.AdminCredentials);
_sub4 = _conn.ConnectToPersistentSubscription(_streamName, "secondgroup",
(subscription, @event) =>
{
Console.WriteLine();
return Task.CompletedTask;
},
(subscription, reason, arg3) => Console.WriteLine(),
DefaultData.AdminCredentials);
_sub5 = _conn.ConnectToPersistentSubscription(_streamName, "secondgroup",
(subscription, @event) =>
{
Console.WriteLine();
return Task.CompletedTask;
},
(subscription, reason, arg3) => Console.WriteLine(),
DefaultData.AdminCredentials);
}

protected override async Task When()
{
//make mcs stop bitching
Console.WriteLine(_sub3);
Console.WriteLine(_sub4);
Console.WriteLine(_sub5);
_json = await GetJson<JArray>("/subscriptions/" + _streamName, ContentType.Json);
}

[Test]
[Retry(5)]
public void the_response_code_is_ok()
{
Assert.AreEqual(HttpStatusCode.OK, _lastResponse.StatusCode);
}

[Test]
[Retry(5)]
public void the_first_event_stream_is_correct()
{
Assert.AreEqual(_streamName, _json[0]["eventStreamId"].Value<string>());
}

[Test]
[Retry(5)]
public void the_first_groupname_is_correct()
{
Assert.AreEqual(_groupName, _json[0]["groupName"].Value<string>());
}

[Test]
[Retry(5)]
public void the_first_event_stream_detail_uri_is_correct()
{
Assert.AreEqual(
string.Format("http://{0}/subscriptions/{1}/{2}/info", _node.HttpEndPoint, _streamName, _groupName),
_json[0]["links"][0]["href"].Value<string>());
}

[Test]
[Retry(5)]
public void the_second_event_stream_detail_uri_is_correct()
{
Assert.AreEqual(
string.Format("http://{0}/subscriptions/{1}/{2}/info", _node.HttpEndPoint, _streamName,
"secondgroup"),
_json[1]["links"][0]["href"].Value<string>());
}

[Test]
[Retry(5)]
public void the_status_is_live()
{
Assert.AreEqual("Live", _json[0]["status"].Value<string>());
}

[Test]
[Retry(5)]
public void there_are_two_connections()
{
Assert.AreEqual(2, _json[0]["connectionCount"].Value<int>());
}

[Test]
[Retry(5)]
public void the_second_subscription_event_stream_is_correct()
{
Assert.AreEqual(_streamName, _json[1]["eventStreamId"].Value<string>());
}

[Test]
[Retry(5)]
public void the_second_subscription_groupname_is_correct()
{
Assert.AreEqual("secondgroup", _json[1]["groupName"].Value<string>());
}

[Test]
[Retry(5)]
public void second_subscription_there_are_three_connections()
{
Assert.AreEqual(3, _json[1]["connectionCount"].Value<int>());
}
}

public abstract class SpecificationWithPersistentSubscriptionAndConnections<TLogFormat, TStreamId> : with_admin_user<TLogFormat, TStreamId>
{
protected string _streamName = Guid.NewGuid().ToString();
Expand Down
Loading
Loading