Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Service Bus]Update tests for improved describe and it names #1237

Merged
merged 4 commits into from
Feb 15, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async function beforeEachTest(
async function afterEachTest(): Promise<void> {
await ns.close();
}
describe("Batch Receiver - Complete/Abandon/Defer/Deadletter normal message", function(): void {
describe("Batch Receiver - Settle message", function(): void {
afterEach(async () => {
await afterEachTest();
});
Expand Down Expand Up @@ -598,7 +598,7 @@ describe("Batch Receiver - Complete/Abandon/Defer/Deadletter normal message", fu
});
});

describe("Batch Receiver - Abandon/Defer/Deadletter deadlettered message", function(): void {
describe("Batch Receiver - Settle deadlettered message", function(): void {
afterEach(async () => {
await afterEachTest();
});
Expand Down Expand Up @@ -1025,7 +1025,7 @@ describe("Batch Receiver - Multiple ReceiveBatch calls", function(): void {
});
});

describe("Batch Receiver - Batching Receiver Misc Tests", function(): void {
describe("Batch Receiver - Others", function(): void {
afterEach(async () => {
await afterEachTest();
});
Expand Down
12 changes: 0 additions & 12 deletions packages/@azure/servicebus/data-plane/test/deferredMessage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,6 @@ describe("Abandon/Defer/Deadletter deferred message", function(): void {
);
await testAbandon(true);
});
});

describe("Deferring a deferred message puts it back to the deferred queue.", function(): void {
afterEach(async () => {
await afterEachTest();
});

async function testDefer(useSessions?: boolean): Promise<void> {
const testMessages = useSessions ? testMessagesWithSessions : testSimpleMessages;
Expand Down Expand Up @@ -343,12 +337,6 @@ describe("Deferring a deferred message puts it back to the deferred queue.", fun
);
await testDefer(true);
});
});

describe("Deadlettering a deferred message moves it to dead letter queue.", function(): void {
afterEach(async () => {
await afterEachTest();
});

async function testDeadletter(useSessions?: boolean): Promise<void> {
const testMessages = useSessions ? testMessagesWithSessions : testSimpleMessages;
Expand Down
8 changes: 3 additions & 5 deletions packages/@azure/servicebus/data-plane/test/namespace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("Create Namespace", function(): void {
});
});

describe("Create Queue/Topic/Subscription Clients with no name", function(): void {
describe("Clients with no name", function(): void {
let namespace: Namespace;
beforeEach(() => {
namespace = Namespace.createFromConnectionString(
Expand Down Expand Up @@ -88,7 +88,7 @@ describe("Create Queue/Topic/Subscription Clients with no name", function(): voi
});
});

describe("Errors when send/receive to/from non existing Namespace", function(): void {
describe("Errors with non existing Namespace", function(): void {
let namespace: Namespace;
let errorWasThrown: boolean;
beforeEach(() => {
Expand Down Expand Up @@ -198,9 +198,7 @@ describe("Errors when send/receive to/from non existing Namespace", function():
});
});

describe("Errors when send/receive to/from non existing Queue/Topic/Subscription", async function(): Promise<
void
> {
describe("Errors with non existing Queue/Topic/Subscription", async function(): Promise<void> {
let namespace: Namespace;
let errorWasThrown: boolean;
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function afterEachTest(): Promise<void> {
await ns.close();
}

describe("ReceiveBatch from Queue/Subscription", function(): void {
describe("Batch Receiver in ReceiveAndDelete mode", function(): void {
afterEach(async () => {
await afterEachTest();
});
Expand Down Expand Up @@ -191,7 +191,7 @@ describe("ReceiveBatch from Queue/Subscription", function(): void {
});
});

describe("Streaming Receiver from Queue/Subscription", function(): void {
describe("Streaming Receiver in ReceiveAndDelete mode", function(): void {
let errorFromErrorHandler: Error | undefined;

afterEach(async () => {
Expand Down Expand Up @@ -391,7 +391,7 @@ describe("Streaming Receiver from Queue/Subscription", function(): void {
});
});

describe("Throws error when Complete/Abandon/Defer/Deadletter/RenewLock of message", function(): void {
describe("Unsupported features in ReceiveAndDelete mode", function(): void {
afterEach(async () => {
await afterEachTest();
});
Expand Down
65 changes: 32 additions & 33 deletions packages/@azure/servicebus/data-plane/test/renewLock.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function afterEachTest(): Promise<void> {
await ns.close();
}

describe("Unpartitioned Queue - Lock Renewal Tests", function(): void {
describe("Unpartitioned Queue - Lock Renewal", function(): void {
beforeEach(async () => {
await beforeEachTest(ClientType.UnpartitionedQueue, ClientType.UnpartitionedQueue);
});
Expand All @@ -57,36 +57,35 @@ describe("Unpartitioned Queue - Lock Renewal Tests", function(): void {
await afterEachTest();
});

it(`renewLock() with Batch Receiver resets lock duration each time.`, async function(): Promise<
it("Batch Receiver: renewLock() resets lock duration each time.", async function(): Promise<
void
> {
await testBatchReceiverManualLockRenewalHappyCase(senderClient, receiverClient);
});

it(`Receive a msg using Batch Receiver, wait until its lock expires, completing it now results in error`, async function(): Promise<
it("Batch Receiver: complete() after lock expiry with throws error", async function(): Promise<
void
> {
await testBatchReceiverManualLockRenewalErrorOnLockExpiry(senderClient, receiverClient);
});

it("Receives a message using Streaming Receiver renewLock() resets lock duration each time.", async function(): Promise<
it("Streaming Receiver: renewLock() resets lock duration each time.", async function(): Promise<
void
> {
await testStreamingReceiverManualLockRenewalHappyCase(senderClient, receiverClient);
});

it("Receive a msg using Streaming Receiver, lock expires after 30 sec when auto renewal is disabled", async function(): Promise<
it("Streaming Receiver: complete() after lock expiry with auto-renewal disabled throws error", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
maxAutoRenewDurationInSeconds: 0,
delayBeforeAttemptingToCompleteMessageInSeconds: 31,
willCompleteFail: true
});
// Complete fails as expected
});

it("Receive a msg using Streaming Receiver, lock will not expire until configured time", async function(): Promise<
it("Streaming Receiver: lock will not expire until configured time", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -96,7 +95,7 @@ describe("Unpartitioned Queue - Lock Renewal Tests", function(): void {
});
});

it("Receive a msg using Streaming Receiver, lock will expire sometime after the configured time", async function(): Promise<
it("Streaming Receiver: lock expires sometime after configured time", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -106,7 +105,7 @@ describe("Unpartitioned Queue - Lock Renewal Tests", function(): void {
});
}).timeout(90000);

it("Receive a msg using Streaming Receiver, lock renewal does not take place when config value is less than lock duration", async function(): Promise<
it("Streaming Receiver: No lock renewal when config value is less than lock duration", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -117,7 +116,7 @@ describe("Unpartitioned Queue - Lock Renewal Tests", function(): void {
});
});

describe("Partitioned Queue - Lock Renewal Tests", function(): void {
describe("Partitioned Queue - Lock Renewal", function(): void {
beforeEach(async () => {
await beforeEachTest(ClientType.PartitionedQueue, ClientType.PartitionedQueue);
});
Expand All @@ -126,25 +125,25 @@ describe("Partitioned Queue - Lock Renewal Tests", function(): void {
await afterEachTest();
});

it(`renewLock() with Batch Receiver resets lock duration each time.`, async function(): Promise<
it("Batch Receiver: renewLock() resets lock duration each time.", async function(): Promise<
void
> {
await testBatchReceiverManualLockRenewalHappyCase(senderClient, receiverClient);
});

it(`Receive a msg using Batch Receiver, wait until its lock expires, completing it now results in error`, async function(): Promise<
it("Batch Receiver: complete() after lock expiry with throws error", async function(): Promise<
void
> {
await testBatchReceiverManualLockRenewalErrorOnLockExpiry(senderClient, receiverClient);
});

it("Receives a message using Streaming Receiver renewLock() resets lock duration each time.", async function(): Promise<
it("Streaming Receiver: renewLock() resets lock duration each time.", async function(): Promise<
void
> {
await testStreamingReceiverManualLockRenewalHappyCase(senderClient, receiverClient);
});

it("Receive a msg using Streaming Receiver, lock expires after 30 sec when auto renewal is disabled", async function(): Promise<
it("Streaming Receiver: complete() after lock expiry with auto-renewal disabled throws error", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -155,7 +154,7 @@ describe("Partitioned Queue - Lock Renewal Tests", function(): void {
// Complete fails as expected
});

it("Receive a msg using Streaming Receiver, lock will not expire until configured time", async function(): Promise<
it("Streaming Receiver: lock will not expire until configured time", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -165,7 +164,7 @@ describe("Partitioned Queue - Lock Renewal Tests", function(): void {
});
});

it("Receive a msg using Streaming Receiver, lock will expire sometime after the configured time", async function(): Promise<
it("Streaming Receiver: lock expires sometime after configured time", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -175,7 +174,7 @@ describe("Partitioned Queue - Lock Renewal Tests", function(): void {
});
}).timeout(90000);

it("Receive a msg using Streaming Receiver, lock renewal does not take place when config value is less than lock duration", async function(): Promise<
it("Streaming Receiver: No lock renewal when config value is less than lock duration", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -186,7 +185,7 @@ describe("Partitioned Queue - Lock Renewal Tests", function(): void {
});
});

describe("Unpartitioned Subscription - Lock Renewal Tests", function(): void {
describe("Unpartitioned Subscription - Lock Renewal", function(): void {
beforeEach(async () => {
await beforeEachTest(ClientType.UnpartitionedTopic, ClientType.UnpartitionedSubscription);
});
Expand All @@ -195,25 +194,25 @@ describe("Unpartitioned Subscription - Lock Renewal Tests", function(): void {
await afterEachTest();
});

it(`renewLock() with Batch Receiver resets lock duration each time.`, async function(): Promise<
it("Batch Receiver: renewLock() resets lock duration each time.", async function(): Promise<
void
> {
await testBatchReceiverManualLockRenewalHappyCase(senderClient, receiverClient);
});

it(`Receive a msg using Batch Receiver, wait until its lock expires, completing it now results in error`, async function(): Promise<
it("Batch Receiver: complete() after lock expiry with throws error", async function(): Promise<
void
> {
await testBatchReceiverManualLockRenewalErrorOnLockExpiry(senderClient, receiverClient);
});

it("Receives a message using Streaming Receiver renewLock() resets lock duration each time.", async function(): Promise<
it("Streaming Receiver: renewLock() resets lock duration each time.", async function(): Promise<
void
> {
await testStreamingReceiverManualLockRenewalHappyCase(senderClient, receiverClient);
});

it("Receive a msg using Streaming Receiver, lock expires after 30 sec when auto renewal is disabled", async function(): Promise<
it("Streaming Receiver: complete() after lock expiry with auto-renewal disabled throws error", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -224,7 +223,7 @@ describe("Unpartitioned Subscription - Lock Renewal Tests", function(): void {
// Complete fails as expected
});

it("Receive a msg using Streaming Receiver, lock will not expire until configured time", async function(): Promise<
it("Streaming Receiver: lock will not expire until configured time", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -234,7 +233,7 @@ describe("Unpartitioned Subscription - Lock Renewal Tests", function(): void {
});
});

it("Receive a msg using Streaming Receiver, lock will expire sometime after the configured time", async function(): Promise<
it("Streaming Receiver: lock expires sometime after configured time", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -244,7 +243,7 @@ describe("Unpartitioned Subscription - Lock Renewal Tests", function(): void {
});
}).timeout(90000);

it("Receive a msg using Streaming Receiver, lock renewal does not take place when config value is less than lock duration", async function(): Promise<
it("Streaming Receiver: No lock renewal when config value is less than lock duration", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -255,7 +254,7 @@ describe("Unpartitioned Subscription - Lock Renewal Tests", function(): void {
});
});

describe("Partitioned Subscription - Lock Renewal Tests", function(): void {
describe("Partitioned Subscription - Lock Renewal", function(): void {
beforeEach(async () => {
await beforeEachTest(ClientType.PartitionedTopic, ClientType.PartitionedSubscription);
});
Expand All @@ -264,25 +263,25 @@ describe("Partitioned Subscription - Lock Renewal Tests", function(): void {
await afterEachTest();
});

it(`renewLock() with Batch Receiver resets lock duration each time.`, async function(): Promise<
it("Batch Receiver: renewLock() resets lock duration each time.", async function(): Promise<
void
> {
await testBatchReceiverManualLockRenewalHappyCase(senderClient, receiverClient);
});

it(`Receive a msg using Batch Receiver, wait until its lock expires, completing it now results in error`, async function(): Promise<
it("Batch Receiver: complete() after lock expiry with throws error", async function(): Promise<
void
> {
await testBatchReceiverManualLockRenewalErrorOnLockExpiry(senderClient, receiverClient);
});

it("Receives a message using Streaming Receiver renewLock() resets lock duration each time.", async function(): Promise<
it("Streaming Receiver: renewLock() resets lock duration each time.", async function(): Promise<
void
> {
await testStreamingReceiverManualLockRenewalHappyCase(senderClient, receiverClient);
});

it("Receive a msg using Streaming Receiver, lock expires after 30 sec when auto renewal is disabled", async function(): Promise<
it("Streaming Receiver: complete() after lock expiry with auto-renewal disabled throws error", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -293,7 +292,7 @@ describe("Partitioned Subscription - Lock Renewal Tests", function(): void {
// Complete fails as expected
});

it("Receive a msg using Streaming Receiver, lock will not expire until configured time", async function(): Promise<
it("Streaming Receiver: lock will not expire until configured time", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -303,7 +302,7 @@ describe("Partitioned Subscription - Lock Renewal Tests", function(): void {
});
});

it("Receive a msg using Streaming Receiver, lock will expire sometime after the configured time", async function(): Promise<
it("Streaming Receiver: lock expires sometime after configured time", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand All @@ -313,7 +312,7 @@ describe("Partitioned Subscription - Lock Renewal Tests", function(): void {
});
}).timeout(90000);

it("Receive a msg using Streaming Receiver, lock renewal does not take place when config value is less than lock duration", async function(): Promise<
it("Streaming Receiver: No lock renewal when config value is less than lock duration", async function(): Promise<
void
> {
await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, {
Expand Down
Loading