Package com.microsoft.windowsazure.services.media.models

Examples of com.microsoft.windowsazure.services.media.models.JobInfo


    }

    @Test
    public void listJobSuccess() throws ServiceException {
        // Arrange
        JobInfo jobInfo = createJob(testJobPrefix + "listJobSuccess");
        List<JobInfo> jobInfos = new ArrayList<JobInfo>();
        jobInfos.add(jobInfo);
        ListResult<JobInfo> expectedListJobsResult = new ListResult<JobInfo>(
                jobInfos);
View Full Code Here


    @Test
    public void canListJobsWithOptions() throws ServiceException {
        String[] assetNameSuffixes = new String[] { "A", "B", "C", "D" };
        List<JobInfo> expectedJobs = new ArrayList<JobInfo>();
        for (String suffix : assetNameSuffixes) {
            JobInfo jobInfo = createJob(testJobPrefix + "assetListOptions"
                    + suffix);
            expectedJobs.add(jobInfo);
        }

        ListResult<JobInfo> listJobsResult = service.list(Job.list().setTop(2));
View Full Code Here

    }

    @Test
    public void cancelJobSuccess() throws ServiceException {
        // Arrange
        JobInfo jobInfo = createJob(testJobPrefix + "cancelJobSuccess");

        // Act
        service.action(Job.cancel(jobInfo.getId()));

        // Assert
        JobInfo canceledJob = service.get(Job.get(jobInfo.getId()));
        assertEquals(JobState.Canceling, canceledJob.getState());

    }
View Full Code Here

    @Test
    public void deleteJobSuccess() throws ServiceException,
            InterruptedException {
        // Arrange
        JobInfo jobInfo = createJob(testJobPrefix + "deleteJobSuccess");
        service.action(Job.cancel(jobInfo.getId()));
        JobInfo cancellingJobInfo = service.get(Job.get(jobInfo.getId()));
        int retryCounter = 0;
        while (cancellingJobInfo.getState() == JobState.Canceling
                && retryCounter < 100) {
            Thread.sleep(2000);
            cancellingJobInfo = service.get(Job.get(jobInfo.getId()));
            retryCounter++;
        }
View Full Code Here

    @Test
    public void canGetInputOutputAssetsFromJob() throws Exception {
        String name = testJobPrefix + "canGetInputOutputAssetsFromJob";
        int priority = 3;

        JobInfo actualJob = service.create(Job.create().setName(name)
                .setPriority(priority).addInputMediaAsset(assetInfo.getId())
                .addTaskCreator(getTaskCreator(0)));

        ListResult<AssetInfo> inputs = service.list(Asset.list(actualJob
                .getInputAssetsLink()));
        ListResult<AssetInfo> outputs = service.list(Asset.list(actualJob
                .getOutputAssetsLink()));

        assertEquals(1, inputs.size());
        assertEquals(assetInfo.getId(), inputs.get(0).getId());
View Full Code Here

    @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());
    }
View Full Code Here

    @Test
    public void canGetErrorDetailsFromTask() throws Exception {
        String name = testJobPrefix + "canGetErrorDetailsFromTask";

        JobInfo actualJob = service.create(Job.create().setName(name)
                .addInputMediaAsset(assetInfo.getId())
                .addTaskCreator(getTaskCreator(0)));

        JobInfo currentJobInfo = actualJob;
        int retryCounter = 0;
        while (currentJobInfo.getState().getCode() < 3 && retryCounter < 30) {
            Thread.sleep(10000);
            currentJobInfo = service.get(Job.get(actualJob.getId()));
            retryCounter++;
        }
View Full Code Here

    @Test
    public void canGetInputOutputAssetsFromTask() throws Exception {
        String name = testJobPrefix + "canGetInputOutputAssetsFromTask";
        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()));
        ListResult<AssetInfo> inputs = service.list(Asset.list(tasks.get(0)
                .getInputAssetsLink()));
        ListResult<AssetInfo> outputs = service.list(Asset.list(tasks.get(0)
                .getOutputAssetsLink()));
View Full Code Here

        String jobName = testJobPrefix + "canGetTaskHistoricalEventsFromTask";
        int priority = 3;
        int retryCounter = 0;

        // Act
        JobInfo actualJobInfo = service.create(Job.create().setName(jobName)
                .setPriority(priority).addInputMediaAsset(assetInfo.getId())
                .addTaskCreator(getTaskCreator(0)));

        while (actualJobInfo.getState().getCode() < 3 && retryCounter < 30) {
            Thread.sleep(10000);
            actualJobInfo = service.get(Job.get(actualJobInfo.getId()));
            retryCounter++;
        }
        ListResult<TaskInfo> tasks = service.list(Task.list(actualJobInfo
                .getTasksLink()));
        TaskInfo taskInfo = tasks.get(0);
        List<TaskHistoricalEvent> historicalEvents = taskInfo
                .getHistoricalEvents();
        TaskHistoricalEvent historicalEvent = historicalEvents.get(0);
View Full Code Here

                AssetOption.None);
        wrapper.uploadFilesToAsset(asset, 10, getTestAssetFiles());
        signalSetupFinished();

        String jobName = testJobPrefix + UUID.randomUUID().toString();
        JobInfo job = wrapper.createJob(jobName, asset, createTasks());
        validator.validateJob(job, jobName, asset, createTasks());
    }
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.services.media.models.JobInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.