Пример #1
0
        private static AzureHDInsightJob TestJobStop(ClusterDetails testCluster, string jobId)
        {
            IStopAzureHDInsightJobCommand stopJobCommand = ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateStopJob();

            stopJobCommand.Cluster    = testCluster.ConnectionUrl;
            stopJobCommand.Credential = GetPSCredential(testCluster.HttpUserName, testCluster.HttpPassword);
            stopJobCommand.JobId      = jobId;
            stopJobCommand.EndProcessing();

            if (stopJobCommand.Output.Count != 0)
            {
                AzureHDInsightJob jobCancellationResults = stopJobCommand.Output.ElementAt(0);
                Assert.IsNotNull(jobCancellationResults.JobId, "Should get a non-null jobDetails id");
                Assert.IsNotNull(jobCancellationResults.StatusDirectory, "StatusDirectory should be set on jobDetails");
                return(jobCancellationResults);
            }
            return(null);
        }
 /// <summary>
 ///     Initializes a new instance of the StopAzureHDInsightJobCmdlet class.
 /// </summary>
 public StopAzureHDInsightJobCmdlet()
 {
     this.command = ServiceLocator.Instance.Locate<IAzureHDInsightCommandFactory>().CreateStopJob();
 }
 /// <summary>
 ///     Initializes a new instance of the StopAzureHDInsightJobCmdlet class.
 /// </summary>
 public StopAzureHDInsightJobCmdlet()
 {
     this.command = ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateStopJob();
 }