< Summary

Class:Microsoft.Azure.HDInsight.Job.Models.SqoopJobSubmissionParameters
Assembly:Microsoft.Azure.HDInsight.Job
File(s):C:\Git\azure-sdk-for-net\sdk\hdinsight\Microsoft.Azure.HDInsight.Job\src\Customizations\Models\SqoopJobSubmissionParameters.cs
Covered lines:12
Uncovered lines:6
Coverable lines:18
Total lines:77
Line coverage:66.6% (12 of 18)
Covered branches:6
Total branches:10
Branch coverage:60% (6 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Command()-100%100%
get_File()-0%100%
get_Files()-0%100%
get_LibDir()-0%100%
get_StatusDir()-100%100%
.ctor()-100%100%
GetJobPostRequestContent()-72.73%60%

File(s)

C:\Git\azure-sdk-for-net\sdk\hdinsight\Microsoft.Azure.HDInsight.Job\src\Customizations\Models\SqoopJobSubmissionParameters.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for
 3// license information.
 4
 5namespace Microsoft.Azure.HDInsight.Job.Models
 6{
 7    using System.Collections.Generic;
 8
 9    /// <summary>
 10    /// Parameters specifying the HDInsight Hive job definition.
 11    /// </summary>
 12    public partial class SqoopJobSubmissionParameters
 13    {
 14        /// <summary>
 15        /// Optional. Gets or sets the command to use for a Sqoop job.
 16        /// </summary>
 1217        public string Command { get; set; }
 18
 19        /// <summary>
 20        /// Optional. Gets or sets the command file to use for a Sqoop job.
 21        /// </summary>
 022        public string File { get; set; }
 23
 24        /// <summary>
 25        /// Optional. Gets or sets the files to be copied to the cluster.
 26        /// </summary>
 027        public IList<string> Files { get; set; }
 28
 29        /// <summary>
 30        /// Optional. Directory where libjar can be found to use by Sqoop.
 31        /// </summary>
 032        public string LibDir { get; set; }
 33
 34        /// <summary>
 35        /// Optional. Status directory in the default storage account to store job files stderr, stdout and exit.
 36        /// </summary>
 837        public string StatusDir { get; set; }
 38
 39        /// <summary>
 40        /// Initializes a new instance of the SqoopJobSubmissionParameters
 41        /// class.
 42        /// </summary>
 443        public SqoopJobSubmissionParameters()
 44        {
 445        }
 46
 47        internal string GetJobPostRequestContent()
 48        {
 49            // Check input parameters and transform them to required format before sending request to templeton.
 450            var values = new List<KeyValuePair<string, string>>();
 51
 452            if (!string.IsNullOrEmpty(this.Command))
 53            {
 454                values.Add(new KeyValuePair<string, string>("command", this.Command));
 55            }
 56
 457            if (!string.IsNullOrEmpty(this.File))
 58            {
 059                values.Add(new KeyValuePair<string, string>("file", this.File));
 60            }
 61
 462            if (!string.IsNullOrEmpty(this.LibDir))
 63            {
 064                values.Add(new KeyValuePair<string, string>("libdir", this.LibDir));
 65            }
 66
 467            if (this.Files != null && this.Files.Count > 0)
 68            {
 069                values.Add(new KeyValuePair<string, string>("files", ModelHelper.BuildListToCommaSeparatedString(this.Fi
 70            }
 71
 472            values.Add(new KeyValuePair<string, string>("statusdir", ModelHelper.GetStatusDirectory(this.StatusDir)));
 73
 474            return ModelHelper.ConvertItemsToString(values);
 75        }
 76    }
 77}