예제 #1
0
        public override void Run(CancellationToken cancellationToken)
        {
            using var stream = RandomStream.Create(Options.Size);

            // No need to delete file in Cleanup(), since ContainerTest.GlobalCleanup() deletes the whole container
            _cloudBlockBlob.UploadFromStream(stream);
        }
예제 #2
0
        public override async Task RunAsync(CancellationToken cancellationToken)
        {
            using var stream = RandomStream.Create(Options.Size);

            // No need to delete file in Cleanup(), since ContainerTest.GlobalCleanup() deletes the whole container
            await _cloudBlockBlob.UploadFromStreamAsync(stream, cancellationToken);
        }
        public override async Task GlobalSetupAsync()
        {
            await base.GlobalSetupAsync();

            using var stream = RandomStream.Create(Options.Size);
            await _blobClient.UploadAsync(stream, overwrite : true);
        }
예제 #4
0
        public override async Task RunAsync(CancellationToken cancellationToken)
        {
            using var stream = RandomStream.Create(Options.Size);

            // No need to delete file in Cleanup(), since ContainerTest.GlobalCleanup() deletes the whole container
            await _blobClient.UploadAsync(stream, transferOptions : Options.StorageTransferOptions, cancellationToken : cancellationToken);
        }
        /// <summary>
        ///   Initializes a new instance of the <see cref="Upload"/> class.
        /// </summary>
        ///
        /// <param name="options">The set of options to consider for configuring the scenario.</param>
        ///
        public Upload(SizeOptions options) : base(options)
        {
            var serviceClient = new DataLakeServiceClient(TestEnvironment.DataLakeServiceUri, TestEnvironment.DataLakeCredential);

            FileSystemClient = serviceClient.GetFileSystemClient(FileSystemName);

            Payload = RandomStream.Create(Options.Size);
        }
예제 #6
0
        public override async Task GlobalSetupAsync()
        {
            await base.GlobalSetupAsync();

            using var stream = RandomStream.Create(Options.Size);

            // No need to delete file in GlobalCleanup(), since ContainerV11Test.GlobalCleanup() deletes the whole container
            await _cloudBlockBlob.UploadFromStreamAsync(stream);
        }
예제 #7
0
        public override async Task GlobalSetupAsync()
        {
            await base.GlobalSetupAsync();

            using Stream stream = RandomStream.Create(Options.Size);

            // No need to delete file in GlobalCleanup(), since ContainerTest.GlobalCleanup() deletes the whole container
            await _blobClient.UploadAsync(stream, overwrite : true);
        }
예제 #8
0
        /// <summary>
        ///   Performs the tasks needed to initialize and set up the environment for an instance
        ///   of the test scenario.  When multiple instances are run in parallel, setup will be
        ///   run once for each prior to its execution.
        /// </summary>
        ///
        public async override Task SetupAsync()
        {
            await base.SetupAsync();

            // Create the test file that will be used as the basis for uploading.

            using var randomStream = RandomStream.Create(1024);

            await FileClient.CreateIfNotExistsAsync();

            await FileClient.UploadAsync(randomStream, true);
        }
예제 #9
0
        public override async Task GlobalSetupAsync()
        {
            await base.GlobalSetupAsync();

            _tempFile = Path.GetTempFileName();

            using var randomStream = RandomStream.Create(Options.Size);
            using var fileStream   = File.OpenWrite(_tempFile);
            await randomStream.CopyToAsync(fileStream);

            fileStream.Close();
        }
예제 #10
0
        /// <summary>
        ///   Performs the tasks needed to initialize and set up the environment for an instance
        ///   of the test scenario.  When multiple instances are run in parallel, setup will be
        ///   run once for each prior to its execution.
        /// </summary>
        ///
        public async override Task SetupAsync()
        {
            await base.SetupAsync();

            UploadPath = Path.GetTempFileName();

            using var uploadFile   = File.OpenWrite(UploadPath);
            using var randomStream = RandomStream.Create(Options.Size);

            await randomStream.CopyToAsync(uploadFile);

            uploadFile.Close();
        }
예제 #11
0
        /// <summary>
        ///   Performs the tasks needed to initialize and set up the environment for the test scenario.
        ///   When multiple instances are run in parallel, the setup will take place once, prior to the
        ///   execution of the first test instance.
        /// </summary>
        ///
        public async override Task GlobalSetupAsync()
        {
            await base.GlobalSetupAsync();

            await FileSystemClient.CreateAsync();

            // Create the test file that will be used for reading.

            using var randomStream = RandomStream.Create(Options.Size);

            await FileClient.CreateAsync();

            await FileClient.UploadAsync(randomStream, true);
        }
예제 #12
0
 public override void Run(CancellationToken cancellationToken)
 {
     using var stream = RandomStream.Create(Options.Size);
     BlockBlobClient.StageBlock(_blockId, stream);
 }
예제 #13
0
 public override void Run(CancellationToken cancellationToken)
 {
     using var stream = RandomStream.Create(Options.Size);
     BlockBlobClient.Upload(stream, cancellationToken: cancellationToken);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UploadFile"/> class.
 /// </summary>
 /// <param name="options">The set of options to consider for configuring the scenario.</param>
 public UploadFile(SizeOptions options) : base(options)
 {
     _stream = RandomStream.Create(options.Size);
 }
예제 #15
0
 public SendReceiveTest(SizeOptions options) : base(options)
 {
     _payload = BinaryData.FromStream(RandomStream.Create(options.Size));
 }
예제 #16
0
        /// <summary>
        ///   Performs the tasks needed to initialize and set up the environment for an instance
        ///   of the test scenario.  When multiple instances are run in parallel, setup will be
        ///   run once for each prior to its execution.
        /// </summary>
        ///
        public async override Task SetupAsync()
        {
            await base.SetupAsync();

            Payload = RandomStream.Create(Options.Size);
        }
예제 #17
0
 public override async Task RunAsync(CancellationToken cancellationToken)
 {
     using var stream = RandomStream.Create(Options.Size);
     await CloudBlockBlob.UploadFromStreamAsync(stream, cancellationToken);
 }
예제 #18
0
 public override void Run(CancellationToken cancellationToken)
 {
     using var stream = RandomStream.Create(Options.Size);
     CloudBlockBlob.UploadFromStream(stream);
 }
예제 #19
0
 public UploadBlob(StorageTransferOptionsOptions options) : base(options)
 {
     _stream = RandomStream.Create(options.Size);
 }
예제 #20
0
 public override void Run(CancellationToken cancellationToken)
 {
     using var stream = RandomStream.Create(Options.Size);
     BlobClient.Upload(stream, transferOptions: Options.StorageTransferOptions, cancellationToken: cancellationToken);
 }
예제 #21
0
 public override async Task RunAsync(CancellationToken cancellationToken)
 {
     using var stream = RandomStream.Create(Options.Size);
     await BlockBlobClient.StageBlockAsync(_blockId, stream);
 }
예제 #22
0
 public override async Task RunAsync(CancellationToken cancellationToken)
 {
     using var stream = RandomStream.Create(Options.Size);
     await BlobClient.UploadAsync(stream, transferOptions : Options.StorageTransferOptions, cancellationToken : cancellationToken);
 }