public static TerminateJob ( BatchController controller, BatchAccountContext context, string jobId ) : void | ||
controller | BatchController | |
context | BatchAccountContext | |
jobId | string | |
리턴 | void |
public void TestListJobsByFilter() { BatchController controller = BatchController.NewInstance; string resourceGroupName = "test-list-job-filter"; string accountName = "testlistjobfilter"; string location = "eastus"; string workItemName = "testWorkItem"; string state = "active"; int matches = 1; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-ListJobsByFilter '{0}' '{1}' '{2}' '{3}'", accountName, workItemName, state, matches) }); }, () => { TimeSpan recurrence = TimeSpan.FromMinutes(1); context = ScenarioTestHelpers.CreateTestAccountAndResourceGroup(controller, resourceGroupName, accountName, location); ScenarioTestHelpers.CreateTestWorkItem(controller, context, workItemName, recurrence); string jobName = ScenarioTestHelpers.WaitForRecentJob(controller, context, workItemName); ScenarioTestHelpers.TerminateJob(context, workItemName, jobName); ScenarioTestHelpers.WaitForRecentJob(controller, context, workItemName, jobName); }, () => { ScenarioTestHelpers.DeleteWorkItem(controller, context, workItemName); ScenarioTestHelpers.CleanupTestAccount(controller, resourceGroupName, accountName); }, TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName()); }
public void TestListJobsUnderSchedule() { BatchController controller = BatchController.NewInstance; string jobScheduleId = "testJobSchedule"; string jobId = null; string jobId2 = null; string runOnceJob = "runOnceId"; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-ListJobsUnderSchedule '{0}' '{1}' '{2}' '{3}'", accountName, jobScheduleId, jobId, 2) }); }, () => { TimeSpan recurrence = TimeSpan.FromMinutes(1); context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName); ScenarioTestHelpers.CreateTestJob(controller, context, runOnceJob); ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, recurrence); jobId = ScenarioTestHelpers.WaitForRecentJob(controller, context, jobScheduleId); ScenarioTestHelpers.TerminateJob(controller, context, jobId); jobId2 = ScenarioTestHelpers.WaitForRecentJob(controller, context, jobScheduleId, jobId); }, () => { ScenarioTestHelpers.DeleteJob(controller, context, runOnceJob); ScenarioTestHelpers.DeleteJob(controller, context, jobId); ScenarioTestHelpers.DeleteJob(controller, context, jobId2); ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId); }, TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName()); }
public void TestListJobsByFilter() { BatchController controller = BatchController.NewInstance; string jobId1 = "filterTestId1"; string jobId2 = "filterTestId2"; string jobId3 = "thirdtestId"; string prefix = "filterTest"; int matches = 2; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-ListJobsByFilter '{0}' '{1}' '{2}'", accountName, prefix, matches) }); }, () => { context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName); ScenarioTestHelpers.CreateTestJob(controller, context, jobId1); ScenarioTestHelpers.CreateTestJob(controller, context, jobId2); ScenarioTestHelpers.CreateTestJob(controller, context, jobId3); ScenarioTestHelpers.TerminateJob(controller, context, jobId1); }, () => { ScenarioTestHelpers.DeleteJob(controller, context, jobId1); ScenarioTestHelpers.DeleteJob(controller, context, jobId2); ScenarioTestHelpers.DeleteJob(controller, context, jobId3); }, TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName()); }
public void TestListJobsWithMaxCount() { BatchController controller = BatchController.NewInstance; string workItemName = "testWorkItem"; int maxCount = 1; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-ListJobsWithMaxCount '{0}' '{1}' '{2}'", accountName, workItemName, maxCount) }); }, () => { TimeSpan recurrence = TimeSpan.FromMinutes(1); context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName); ScenarioTestHelpers.CreateTestWorkItem(controller, context, workItemName, recurrence); string jobName = ScenarioTestHelpers.WaitForRecentJob(controller, context, workItemName); ScenarioTestHelpers.TerminateJob(context, workItemName, jobName); ScenarioTestHelpers.WaitForRecentJob(controller, context, workItemName, jobName); }, () => { ScenarioTestHelpers.DeleteWorkItem(controller, context, workItemName); }, TestUtilities.GetCallingClass(), TestUtilities.GetCurrentMethodName()); }