Package hudson.model

Examples of hudson.model.Build


    }

    @Override
    public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp) {
        try {
            Build item = getRun(Combination.fromString(token));
            if (item != null) {
                if (item.getNumber() == this.getNumber()) {
                    return item;
                } else {
                    // redirect the user to the correct URL
                    String url = Functions.joinPath(item.getUrl(), req.getRestOfPath());
                    String qs = req.getQueryString();
                    if (qs != null) {
                        url += '?' + qs;
                    }
                    throw HttpResponses.redirectViaContextPath(url);
View Full Code Here


    public Build getRun() {
        return dynamicBuild.getRun(combination);
    }

    public String getNearestRunUrl() {
        @SuppressWarnings("rawtypes")
        Build r = getRun();
        if (r == null) {
            return null;
        }
        if (dynamicBuild.getNumber() == r.getNumber()) {
            return getShortUrl() + "/console";
        }
        return Stapler.getCurrentRequest().getContextPath() + '/' + r.getUrl();
    }
View Full Code Here

    public String getShortUrl() {
        return Util.rawEncode(combination.toString());
    }

    public String getTooltip() {
        Build r = getRun();
        if (r != null) {
            return r.getIconColor().getDescription();
        }
        Queue.Item item = Jenkins.getInstance().getQueue().getItem(dynamicBuild.getParent().getItem(combination));
        if (item != null) {
            return item.getWhy();
        }
View Full Code Here

   
    @Test
    public void testNoBuildData() throws Exception, InterruptedException  {
        FreeStyleProject prj = createFreeStyleProject("23641_noBuildData");
        prj.getBuildersList().add(new GitHubSetCommitStatusBuilder());
        Build b = prj.scheduleBuild2(0).get();
        assertBuildStatus(Result.FAILURE, b);
        assertLogContains(org.jenkinsci.plugins.github.util.Messages.BuildDataHelper_NoBuildDataError(), b);
    }
View Full Code Here

    @Test
    @Bug(23641)
    public void testNoBuildData() throws Exception, InterruptedException  {
        FreeStyleProject prj = createFreeStyleProject("23641_noBuildData");
        prj.getPublishersList().add(new GitHubCommitNotifier());
        Build b = prj.scheduleBuild2(0).get();
        assertBuildStatus(Result.FAILURE, b);
        assertLogContains(org.jenkinsci.plugins.github.util.Messages.BuildDataHelper_NoBuildDataError(), b);
    }
View Full Code Here

    @Bug(23641)
    public void testNoBuildRevision() throws Exception, InterruptedException {
        FreeStyleProject prj = createFreeStyleProject();
        prj.setScm(new GitSCM("http://non.existent.git.repo.nowhere/repo.git"));
        prj.getPublishersList().add(new GitHubCommitNotifier());
        Build b = prj.scheduleBuild2(0).get();
        assertBuildStatus(Result.FAILURE, b);
        assertLogContains(org.jenkinsci.plugins.github.util.Messages.BuildDataHelper_NoLastRevisionError(), b);
    }
View Full Code Here

  
    @Bug(25312)
    public @Test void testMarkUnstableOnCommitNotifierFailure() throws Exception, InterruptedException {
        FreeStyleProject prj = createFreeStyleProject();
        prj.getPublishersList().add(new GitHubCommitNotifier(Result.UNSTABLE.toString()));
        Build b = prj.scheduleBuild2(0).get();
        assertBuildStatus(Result.UNSTABLE, b);
    }
View Full Code Here

   
    @Bug(25312)
    public @Test void testMarkSuccessOnCommitNotifierFailure() throws Exception, InterruptedException {
        FreeStyleProject prj = createFreeStyleProject();
        prj.getPublishersList().add(new GitHubCommitNotifier(Result.SUCCESS.toString()));
        Build b = prj.scheduleBuild2(0).get();
        assertBuildStatus(Result.SUCCESS, b);
    }
View Full Code Here

TOP

Related Classes of hudson.model.Build

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.