Package com.netflix.genie.common.model

Examples of com.netflix.genie.common.model.Job


    @Test
    public void testSetCommandInfoForJob() throws GenieException {
        final String id = UUID.randomUUID().toString();
        final String name = UUID.randomUUID().toString();
        this.service.setCommandInfoForJob(JOB_1_ID, id, name);
        final Job job = this.service.getJob(JOB_1_ID);
        Assert.assertEquals(id, job.getCommandId());
        Assert.assertEquals(name, job.getCommandName());
    }
View Full Code Here


    @Test
    public void testSetApplicationInfoForJob() throws GenieException {
        final String id = UUID.randomUUID().toString();
        final String name = UUID.randomUUID().toString();
        this.service.setApplicationInfoForJob(JOB_1_ID, id, name);
        final Job job = this.service.getJob(JOB_1_ID);
        Assert.assertEquals(id, job.getApplicationId());
        Assert.assertEquals(name, job.getApplicationName());
    }
View Full Code Here

    @Test
    public void testSetClusterInfoForJob() throws GenieException {
        final String id = UUID.randomUUID().toString();
        final String name = UUID.randomUUID().toString();
        this.service.setClusterInfoForJob(JOB_1_ID, id, name);
        final Job job = this.service.getJob(JOB_1_ID);
        Assert.assertEquals(id, job.getExecutionClusterId());
        Assert.assertEquals(name, job.getExecutionClusterName());
    }
View Full Code Here

        final JobRepository jobRepo = Mockito.mock(JobRepository.class);
        final GenieNodeStatistics stats = Mockito.mock(GenieNodeStatistics.class);
        final JobManagerFactory jobManagerFactory = Mockito.mock(JobManagerFactory.class);
        final JobServiceJPAImpl impl = new JobServiceJPAImpl(jobRepo, stats, jobManagerFactory);

        final Job job = Mockito.mock(Job.class);
        Mockito.when(job.getId()).thenReturn(JOB_1_ID);
        Mockito.when(jobRepo.findOne(JOB_1_ID)).thenReturn(job);

        final JobManager manager = Mockito.mock(JobManager.class);
        Mockito.when(jobManagerFactory.getJobManager(job)).thenReturn(manager);
View Full Code Here

        final JobRepository jobRepo = Mockito.mock(JobRepository.class);
        final GenieNodeStatistics stats = Mockito.mock(GenieNodeStatistics.class);
        final JobManagerFactory jobManagerFactory = Mockito.mock(JobManagerFactory.class);
        final JobServiceJPAImpl impl = new JobServiceJPAImpl(jobRepo, stats, jobManagerFactory);

        final Job job = Mockito.mock(Job.class);
        Mockito.when(job.getId()).thenReturn(JOB_1_ID);
        Mockito.when(jobRepo.findOne(JOB_1_ID)).thenReturn(job);

        final JobManager manager = Mockito.mock(JobManager.class);
        Mockito.when(jobManagerFactory.getJobManager(job))
                .thenThrow(new GenieException(
View Full Code Here

     *
     * @throws GenieException
     */
    @Test(expected = GenieConflictException.class)
    public void testSubmitJobThatExists() throws GenieException {
        final Job job = new Job();
        job.setId(JOB_1_ID);
        this.xs.submitJob(job);
    }
View Full Code Here

        two.set(2014, Calendar.JANUARY, 3, 1, 50, 0);
        final Calendar three = Calendar.getInstance();
        three.clear();
        three.set(2014, Calendar.JANUARY, 4, 1, 50, 0);
        // should return immediately despite bogus killURI
        final Job job1 = this.xs.killJob(JOB_1_ID);
        Assert.assertEquals(JobStatus.SUCCEEDED, job1.getStatus());
        Assert.assertEquals(one.getTimeInMillis(), job1.getUpdated().getTime());
        final Job job2 = this.xs.killJob(JOB_2_ID);
        Assert.assertEquals(JobStatus.KILLED, job2.getStatus());
        Assert.assertEquals(two.getTimeInMillis(), job2.getUpdated().getTime());
        final Job job3 = this.xs.killJob(JOB_3_ID);
        Assert.assertEquals(JobStatus.FAILED, job3.getStatus());
        Assert.assertEquals(three.getTimeInMillis(), job3.getUpdated().getTime());
    }
View Full Code Here

     *
     * @throws GenieException On any error.
     */
    @Test(expected = GeniePreconditionException.class)
    public void testBuildRequestNullRequestUri() throws GenieException {
        BaseGenieClient.buildRequest(HttpRequest.Verb.PUT, null, null, new Job());
    }
View Full Code Here

     *
     * @throws GenieException On any error.
     */
    @Test(expected = GeniePreconditionException.class)
    public void testBuildRequestEmptyRequestUri() throws GenieException {
        BaseGenieClient.buildRequest(HttpRequest.Verb.PUT, "", null, new Job());
    }
View Full Code Here

     *
     * @throws GenieException On any error.
     */
    @Test(expected = GeniePreconditionException.class)
    public void testBuildRequestBlankRequestUri() throws GenieException {
        BaseGenieClient.buildRequest(HttpRequest.Verb.PUT, "   ", null, new Job());
    }
View Full Code Here

TOP

Related Classes of com.netflix.genie.common.model.Job

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.