Package org.netmelody.cieye.spies.teamcity.jsondomain

Examples of org.netmelody.cieye.spies.teamcity.jsondomain.BuildDetail


                                                "http://foo");
    }

    @Test public void
    requestsSingularBuildChangesForTeamCitySixApi() {
        final BuildDetail buildDetail = buildDetail(1);
        channel.respondingWith("http://foo" + buildDetail.changes.href, contentFrom("tc_6.5.5_changes_1.json").replace("@", ""));
       
        final List<Change> changes = communicator.changesOf(buildDetail);
        assertThat(changes, is(Matchers.<Change>iterableWithSize(1)));
        assertThat(changes.get(0).id, is("48834"));
View Full Code Here


        assertThat(changes.get(0).id, is("48834"));
    }

    @Test public void
    requestsMultipleBuildChangesForTeamCitySixApi() {
        final BuildDetail buildDetail = buildDetail(2);
        channel.respondingWith("http://foo" + buildDetail.changes.href, contentFrom("tc_6.5.5_changes_2.json").replace("@", ""));

        final List<Change> changes = communicator.changesOf(buildDetail);
        assertThat(changes, is(Matchers.<Change>iterableWithSize(2)));
        assertThat(changes.get(0).id, is("47951"));
View Full Code Here

        assertThat(changes.get(1).id, is("47949"));
    }

    @Test public void
    requestsSingularBuildChangesForTeamCitySevenApi() {
        final BuildDetail buildDetail = buildDetail(1);
        channel.respondingWith("http://foo" + buildDetail.changes.href, contentFrom("tc_7.0.0_changes_1.json"));
       
        final List<Change> changes = communicator.changesOf(buildDetail);
        assertThat(changes, is(Matchers.<Change>iterableWithSize(1)));
        assertThat(changes.get(0).id, is("62889"));
View Full Code Here

        assertThat(changes.get(0).id, is("62889"));
    }

    @Test public void
    requestsMultipleBuildChangesForTeamCitySevenApi() {
        final BuildDetail buildDetail = buildDetail(2);
        channel.respondingWith("http://foo" + buildDetail.changes.href, contentFrom("tc_7.0.0_changes_2.json"));
       
        final List<Change> changes = communicator.changesOf(buildDetail);
        assertThat(changes, is(Matchers.<Change>iterableWithSize(2)));
        assertThat(changes.get(0).id, is("62855"));
View Full Code Here

        assertThat(changes.get(0).id, is("62855"));
        assertThat(changes.get(1).id, is("62854"));
    }

    private BuildDetail buildDetail(int size) {
        final BuildDetail buildDetail = new BuildDetail();
        buildDetail.changes = new ChangesHref();
        buildDetail.changes.count = size;
        buildDetail.changes.href = "/app/rest/changes/id:12345";
        return buildDetail;
    }
View Full Code Here

        final Set<Sponsor> sponsors = new HashSet<Sponsor>();
        final List<RunningBuild> runningBuilds = new ArrayList<RunningBuild>();
        long startTime = 0L;
           
        for(Build build : communicator.runningBuildsFor(buildType)) {
            final BuildDetail buildDetail = communicator.detailsOf(build);
            startTime = Math.max(buildDetail.startDateTime(), startTime);
            sponsors.addAll(sponsorsOf(buildDetail));
            runningBuilds.add(new RunningBuild(percentageOf(build.percentageComplete), buildDetail.status()));
        }
       
        Status currentStatus = Status.UNKNOWN;
        final Build lastCompletedBuild = communicator.lastCompletedBuildFor(buildTypeDetail);
        if (null != lastCompletedBuild) {
            currentStatus = lastCompletedBuild.status();
            if (runningBuilds.isEmpty() || Status.BROKEN.equals(currentStatus)) {
                final BuildDetail buildDetail = communicator.detailsOf(lastCompletedBuild);
                startTime = Math.max(buildDetail.startDateTime(), startTime);
                sponsors.addAll(sponsorsOf(buildDetail));
                currentStatus = buildDetail.status();
            }
        }
       
        if (Status.BROKEN.equals(currentStatus)) {
            final List<Investigation> investigations = communicator.investigationsOf(buildType);
View Full Code Here

TOP

Related Classes of org.netmelody.cieye.spies.teamcity.jsondomain.BuildDetail

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.