Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Can now get tasks from job

  • Loading branch information...
commit 809002d6acc037b4fc5b6e8f0e189f163add3d02 1 parent ab3a2ab
@christav christav authored
View
12 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Task.java
@@ -78,6 +78,18 @@ public static CreateBatchOperation create(String mediaProcessorId, String taskBo
}
/**
+ * Create an operation that will list the tasks pointed to by the given link
+ *
+ * @param link
+ * link to tasks
+ * @return the list operation.
+ */
+ public static DefaultListOperation<TaskInfo> list(LinkInfo link) {
+ return new DefaultListOperation<TaskInfo>(link.getHref(), new GenericType<ListResult<TaskInfo>>() {
+ });
+ }
+
+ /**
* The Class CreateBatchOperation.
*/
public static class CreateBatchOperation extends EntityBatchOperation {
View
21 ...azure-api/src/test/java/com/microsoft/windowsazure/services/media/JobIntegrationTest.java
@@ -42,6 +42,7 @@
import com.microsoft.windowsazure.services.media.models.LocatorInfo;
import com.microsoft.windowsazure.services.media.models.Task;
import com.microsoft.windowsazure.services.media.models.Task.CreateBatchOperation;
+import com.microsoft.windowsazure.services.media.models.TaskInfo;
public class JobIntegrationTest extends IntegrationTestBase {
@@ -289,13 +290,6 @@ public void deleteJobInvalidIdFail() throws ServiceException {
public void canGetInputOutputAssetsFromJob() throws Exception {
String name = testJobPrefix + "canGetInputOutputAssetsFromJob";
int priority = 3;
- double duration = 0.0;
- JobState state = JobState.Queued;
- String templateId = null;
- Date created = new Date();
- Date lastModified = new Date();
- Date stateTime = null;
- Date endTime = null;
JobInfo actualJob = service.create(Job.create().setName(name).setPriority(priority)
.addInputMediaAsset(assetInfo.getId()).addTaskCreator(getTaskCreator(0)));
@@ -309,4 +303,17 @@ public void canGetInputOutputAssetsFromJob() throws Exception {
assertEquals(1, outputs.size());
assertTrue(outputs.get(0).getName().contains(name));
}
+
+ @Test
+ public void canGetTasksFromJob() throws Exception {
+ String name = testJobPrefix + "canGetTaskAssetsFromJob";
+ int priority = 3;
+
+ JobInfo actualJob = service.create(Job.create().setName(name).setPriority(priority)
+ .addInputMediaAsset(assetInfo.getId()).addTaskCreator(getTaskCreator(0)));
+
+ ListResult<TaskInfo> tasks = service.list(Task.list(actualJob.getTasksLink()));
+
+ assertEquals(1, tasks.size());
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.