Package org.netmelody.cieye.spies.jenkins.jsondomain

Examples of org.netmelody.cieye.spies.jenkins.jsondomain.JobDetail


public final class JobDetailTest {

    @Test public void
    correctlyDeterminesTheLastFailedBuildUrl() {
        final JobDetail jobDetail = new JobDetail();
        jobDetail.lastUnstableBuild = build(123, "http://blah/455");
        jobDetail.lastUnsuccessfulBuild = build(9, "http://blah/454");
        jobDetail.lastFailedBuild = build(456, "http://blah/456");
       
        assertThat(jobDetail.lastBadBuildUrl(), is("http://blah/456"));
    }
View Full Code Here


        assertThat(jobDetail.lastBadBuildUrl(), is("http://blah/456"));
    }
   
    @Test public void
    correctlyDeterminesTheLastFailedBuildUrlWithNonLexographicUrls() {
        final JobDetail jobDetail = new JobDetail();
        jobDetail.lastUnstableBuild = build(123, "http://blah/123");
        jobDetail.lastUnsuccessfulBuild = build(9, "http://blah/9");
        jobDetail.lastFailedBuild = build(456, "http://blah/456");
       
        assertThat(jobDetail.lastBadBuildUrl(), is("http://blah/456"));
    }
View Full Code Here

    private final Job job = defaultJob();
   
    @Test public void
    returnsInstantlyForAGreenJobThatIsNotBuilding() {
        context.checking(new Expectations() {{
            allowing(contact).makeJsonRestCall("jobUrl/api/json", JobDetail.class); will(returnValue(new JobDetail()));
        }});
       
        TargetDetail target = jobLab.analyseJob(job);
       
        assertThat(target.status(), Matchers.is(Status.GREEN));
View Full Code Here

        assertThat(target.status(), Matchers.is(Status.GREEN));
    }

    @Test public void
    includesLastStartTimeForGreenBuild() {
        final JobDetail jobDetail = new JobDetail();
        jobDetail.lastBuild = new Build();
        jobDetail.lastBuild.url = "buildUrl";
        final BuildDetail buildDetail = new BuildDetail();
        buildDetail.timestamp = 100L;
       
View Full Code Here

    }
   
    @Test public void
    alwaysAnalysesARedBuild() {
        job.color = "red";
        final JobDetail jobDetail = new JobDetail();
        jobDetail.color = "red";
       
        context.checking(new Expectations() {{
            allowing(contact).makeJsonRestCall("jobUrl/api/json", JobDetail.class); will(returnValue(jobDetail));
        }});
View Full Code Here

        final TargetDigestGroup targets = spy.targetsConstituting(feature);
        context.assertIsSatisfied();
       
        context.checking(new Expectations() {{
            oneOf(contact).makeJsonRestCall(with(any(String.class)), with(JobDetail.class));
                will(returnValue(new JobDetail()));
        }});
        spy.statusOf(targets.iterator().next().id());
        context.assertIsSatisfied();
    }
View Full Code Here

    public TargetDetail analyse(Job jobDigest) {
        if (!jobDigest.url.equals(jobEndpoint)) {
            throw new IllegalArgumentException("Incorrect job digest");
        }
       
        final JobDetail job = communicator.jobDetailFor(jobEndpoint);
        if (!job.building() && Status.BROKEN != job.status()) {
            sponsorCache.clear();
            return new TargetDetail(job.url, job.url, job.name, job.status(), startTimeOf(job));
        }
       
        return new TargetDetail(job.url, job.url, job.name, statusOf(job), startTimeOf(job), buildsFor(job), sponsorsOf(job));
    }
View Full Code Here

TOP

Related Classes of org.netmelody.cieye.spies.jenkins.jsondomain.JobDetail

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.