Package hudson.model

Examples of hudson.model.AbstractBuild


        if (StringUtils.isEmpty(format)) {
            format = getDefaultFormatValue();
        }

        StringBuffer sb = new StringBuffer();
        final AbstractBuild startBuild;
        final AbstractBuild endBuild;
        if (reverse) {
            startBuild = build;
            endBuild = getFirstIncludedBuild(build, listener);
        } else {
            startBuild = getFirstIncludedBuild(build, listener);
View Full Code Here


            }
        } else {
            buf.append(def);
        }
        if (showDependencies) {
            AbstractBuild previousBuild = ExtendedEmailPublisher.getPreviousBuild(build, listener);
            if (previousBuild != null) {
                for (Entry<AbstractProject, DependencyChange> e : build.getDependencyChanges(previousBuild).entrySet()) {
                    buf.append("\n=======================\n");
                    buf.append("\nChanges in ").append(e.getKey().getName())
                            .append(":\n");
View Full Code Here

    }

    @Test
    public void testShouldGetChangesForLatestBuild()
            throws Exception {
        AbstractBuild currentBuild = createBuild(Result.SUCCESS, 42, "Changes for a successful build.");

        String content = changesSinceLastBuildContent.evaluate(currentBuild, listener, ChangesSinceLastBuildContent.MACRO_NAME);

        assertEquals("[Ash Lux] Changes for a successful build.\n\n", content);
    }
View Full Code Here

    }

    @Test
    public void testShouldGetChangesForLatestBuildEvenWhenPreviousBuildsExist()
            throws Exception {
        AbstractBuild failureBuild = createBuild(Result.FAILURE, 41, "Changes for a failed build.");

        AbstractBuild currentBuild = createBuild(Result.SUCCESS, 42, "Changes for a successful build.");
        when(currentBuild.getPreviousBuild()).thenReturn(failureBuild);
        when(failureBuild.getNextBuild()).thenReturn(currentBuild);

        String content = changesSinceLastBuildContent.evaluate(currentBuild, listener, ChangesSinceLastBuildContent.MACRO_NAME);

        assertEquals("[Ash Lux] Changes for a successful build.\n\n", content);
View Full Code Here

    @Test
    public void testShouldPrintDate()
            throws Exception {
        changesSinceLastBuildContent.format = "%d";

        AbstractBuild currentBuild = createBuild(Result.SUCCESS, 42, "Changes for a successful build.");

        String content = changesSinceLastBuildContent.evaluate(currentBuild, listener, ChangesSinceLastBuildContent.MACRO_NAME);

        assertEquals("Oct 21, 2013 7:39:00 PM", content);
    }
View Full Code Here

    @Test
    public void testShouldPrintRevision()
            throws Exception {
        changesSinceLastBuildContent.format = "%r";

        AbstractBuild currentBuild = createBuild(Result.SUCCESS, 42, "Changes for a successful build.");

        String content = changesSinceLastBuildContent.evaluate(currentBuild, listener, ChangesSinceLastBuildContent.MACRO_NAME);

        assertEquals("REVISION", content);
    }
View Full Code Here

    @Test
    public void testShouldPrintPath()
            throws Exception {
        changesSinceLastBuildContent.format = "%p";

        AbstractBuild currentBuild = createBuild(Result.SUCCESS, 42, "Changes for a successful build.");

        String content = changesSinceLastBuildContent.evaluate(currentBuild, listener, ChangesSinceLastBuildContent.MACRO_NAME);

        assertEquals("\tPATH1\n\tPATH2\n\tPATH3\n", content);
    }
View Full Code Here

    @Test
    public void testWhenShowPathsIsTrueShouldPrintPath()
            throws Exception {
        changesSinceLastBuildContent.showPaths = true;

        AbstractBuild currentBuild = createBuild(Result.SUCCESS, 42, "Changes for a successful build.");

        String content = changesSinceLastBuildContent.evaluate(currentBuild, listener, ChangesSinceLastBuildContent.MACRO_NAME);

        assertEquals("[Ash Lux] Changes for a successful build.\n" + "\tPATH1\n" + "\tPATH2\n" + "\tPATH3\n" + "\n", content);
    }
View Full Code Here

    public void testDateFormatString()
        throws Exception {
        changesSinceLastBuildContent.format = "%d";
        changesSinceLastBuildContent.dateFormat = "MMM d, yyyy HH:mm:ss";

        AbstractBuild currentBuild = createBuild(Result.SUCCESS, 42, "Changes for a successful build.");

        String content = changesSinceLastBuildContent.evaluate(currentBuild, listener, ChangesSinceLastBuildContent.MACRO_NAME);

        assertEquals("Oct 21, 2013 19:39:00", content);
    }
View Full Code Here

    public void testTypeFormatStringWithNoGetAffectedFiles()
        throws Exception {
        changesSinceLastBuildContent.showPaths = true;
        changesSinceLastBuildContent.pathFormat = "\t%p\t%a\n";

        AbstractBuild currentBuild = createBuild(Result.SUCCESS, 42, "Changes for a successful build.");

        String content = changesSinceLastBuildContent.evaluate(currentBuild, listener, ChangesSinceLastBuildContent.MACRO_NAME);

        assertEquals("[Ash Lux] Changes for a successful build.\n" + "\tPATH1\tUnknown\n" + "\tPATH2\tUnknown\n" + "\tPATH3\tUnknown\n" + "\n", content);
    }
View Full Code Here

TOP

Related Classes of hudson.model.AbstractBuild

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.