Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public override async Task GlobalSetupAsync()
        {
            await base.GlobalSetupAsync();

            using var stream = RandomStream.Create(Options.Size);
            await _blobClient.UploadAsync(stream, overwrite : true);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
        /// <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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 12
0
 public override void Run(CancellationToken cancellationToken)
 {
     using var stream = RandomStream.Create(Options.Size);
     BlockBlobClient.StageBlock(_blockId, stream);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 15
0
 public SendReceiveTest(SizeOptions options) : base(options)
 {
     _payload = BinaryData.FromStream(RandomStream.Create(options.Size));
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 17
0
 public override async Task RunAsync(CancellationToken cancellationToken)
 {
     using var stream = RandomStream.Create(Options.Size);
     await CloudBlockBlob.UploadFromStreamAsync(stream, cancellationToken);
 }
Ejemplo n.º 18
0
 public override void Run(CancellationToken cancellationToken)
 {
     using var stream = RandomStream.Create(Options.Size);
     CloudBlockBlob.UploadFromStream(stream);
 }
Ejemplo n.º 19
0
 public UploadBlob(StorageTransferOptionsOptions options) : base(options)
 {
     _stream = RandomStream.Create(options.Size);
 }
Ejemplo n.º 20
0
 public override void Run(CancellationToken cancellationToken)
 {
     using var stream = RandomStream.Create(Options.Size);
     BlobClient.Upload(stream, transferOptions: Options.StorageTransferOptions, cancellationToken: cancellationToken);
 }
Ejemplo n.º 21
0
 public override async Task RunAsync(CancellationToken cancellationToken)
 {
     using var stream = RandomStream.Create(Options.Size);
     await BlockBlobClient.StageBlockAsync(_blockId, stream);
 }
Ejemplo n.º 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);
 }