forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
62 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
sdk/core/azure-core-perf/src/main/java/com/azure/core/perf/GetBlobProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.core.perf; | ||
|
||
import com.azure.core.perf.core.ServiceTest; | ||
import com.azure.perf.test.core.PerfStressOptions; | ||
import com.azure.storage.blob.BlobContainerAsyncClient; | ||
import com.azure.storage.blob.BlobContainerClient; | ||
import com.azure.storage.blob.BlobServiceAsyncClient; | ||
import com.azure.storage.blob.BlobServiceClient; | ||
import com.azure.storage.blob.models.BlobProperties; | ||
import reactor.core.publisher.Mono; | ||
|
||
import java.util.UUID; | ||
|
||
public class GetBlobProperties extends ServiceTest<PerfStressOptions> { | ||
public GetBlobProperties(PerfStressOptions options) { | ||
super(options); | ||
} | ||
|
||
@Override | ||
public Mono<Void> globalSetupAsync() { | ||
return super.globalSetupAsync(); | ||
} | ||
|
||
@Override | ||
public Mono<Void> globalCleanupAsync() { | ||
return super.globalCleanupAsync(); | ||
} | ||
|
||
@Override | ||
public void run() { | ||
String blobName = "perfblobtest-" + UUID.randomUUID(); | ||
|
||
BlobServiceClient storageClient = blobServiceClientBuilder.buildClient(); | ||
|
||
BlobContainerClient blobContainerClient = storageClient.createBlobContainer("perfupload" + UUID.randomUUID()); | ||
BlobProperties blobProperties = blobContainerClient.getBlobClient(blobName).getProperties(); | ||
assert blobProperties.getCreationTime() != null; | ||
assert blobProperties.getExpiresOn() != null; | ||
} | ||
|
||
@Override | ||
public Mono<Void> runAsync() { | ||
String blobName = "perfblobtest-" + UUID.randomUUID(); | ||
|
||
BlobServiceAsyncClient storageAsyncClient = blobServiceClientBuilder.buildAsyncClient(); | ||
|
||
BlobContainerAsyncClient | ||
blobContainerAsyncClient = storageAsyncClient.createBlobContainer("perfupload" + UUID.randomUUID()).block(); | ||
return blobContainerAsyncClient.getBlobAsyncClient(blobName) | ||
.getProperties() | ||
.then(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters