< Summary

Class:Microsoft.Azure.HDInsight.Job.Models.MapReduceJobSubmissionParameters
Assembly:Microsoft.Azure.HDInsight.Job
File(s):C:\Git\azure-sdk-for-net\sdk\hdinsight\Microsoft.Azure.HDInsight.Job\src\Customizations\Models\MapReduceJobSubmissionParameters.cs
Covered lines:19
Uncovered lines:5
Coverable lines:24
Total lines:97
Line coverage:79.1% (19 of 24)
Covered branches:16
Total branches:20
Branch coverage:80% (16 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Arguments()-100%100%
get_Defines()-100%100%
get_Files()-0%100%
get_JarClass()-100%100%
get_JarFile()-100%100%
get_LibJars()-0%100%
get_StatusDir()-0%100%
.ctor()-100%100%
GetJobPostRequestContent()-86.67%80%

File(s)

C:\Git\azure-sdk-for-net\sdk\hdinsight\Microsoft.Azure.HDInsight.Job\src\Customizations\Models\MapReduceJobSubmissionParameters.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 MapReduce job definition.
 11    /// </summary>
 12    public partial class MapReduceJobSubmissionParameters
 13    {
 14        /// <summary>
 15        /// Optional. Gets the arguments for the jobDetails.
 16        /// </summary>
 2417        public IList<string> Arguments { get; set; }
 18
 19        /// <summary>
 20        /// Optional. Gets or sets define parameter list.
 21        /// </summary>
 2422        public IDictionary<string, string> Defines { get; set; }
 23
 24        /// <summary>
 25        /// Optional. List of files to be copied to the cluster.
 26        /// </summary>
 027        public IList<string> Files { get; set; }
 28
 29        /// <summary>
 30        /// Optional. Gets or sets the class.
 31        /// </summary>
 1832        public string JarClass { get; set; }
 33
 34        /// <summary>
 35        /// Optional. Gets or sets the Jar file.
 36        /// </summary>
 1837        public string JarFile { get; set; }
 38
 39        /// <summary>
 40        /// Optional. List of files to include in the classpath.
 41        /// </summary>
 042        public IList<string> LibJars { get; set; }
 43
 44        /// <summary>
 45        /// Optional. Status directory in the default storage account to store job files stderr, stdout and exit.
 46        /// </summary>
 047        public string StatusDir { get; set; }
 48
 49        /// <summary>
 50        /// Initializes a new instance of the MapReduceJobSubmissionParameters
 51        /// class.
 52        /// </summary>
 653        public MapReduceJobSubmissionParameters()
 54        {
 655        }
 56
 57        internal string GetJobPostRequestContent()
 58        {
 59            // Check input parameters and transform them to required format before sending request to templeton.
 660            var values = new List<KeyValuePair<string, string>>();
 61
 662            if (!string.IsNullOrEmpty(this.JarFile))
 63            {
 664                values.Add(new KeyValuePair<string, string>("jar", this.JarFile));
 65            }
 66
 667            if (!string.IsNullOrEmpty(this.JarClass))
 68            {
 669                values.Add(new KeyValuePair<string, string>("class", this.JarClass));
 70            }
 71
 672            if (this.Arguments != null && this.Arguments.Count > 0)
 73            {
 674                values.AddRange(ModelHelper.BuildList("arg", this.Arguments));
 75            }
 76
 677            if (this.Defines != null && this.Defines.Count > 0)
 78            {
 679                values.AddRange(ModelHelper.BuildNameValueList("define", this.Defines));
 80            }
 81
 682            if (this.LibJars != null && this.LibJars.Count > 0)
 83            {
 084                values.Add(new KeyValuePair<string, string>("libjars", ModelHelper.BuildListToCommaSeparatedString(this.
 85            }
 86
 687            if (this.Files != null && this.Files.Count > 0)
 88            {
 089                values.Add(new KeyValuePair<string, string>("files", ModelHelper.BuildListToCommaSeparatedString(this.Fi
 90            }
 91
 692            values.Add(new KeyValuePair<string, string>("statusdir", ModelHelper.GetStatusDirectory(this.StatusDir)));
 93
 694            return ModelHelper.ConvertItemsToString(values);
 95        }
 96    }
 97}