Examples of AbstractBuild


Examples of hudson.model.AbstractBuild

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

        AbstractBuild currentBuild = createBuildWithAffectedFiles(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\tadd - The file was added\n" + "\tPATH2\tdelete - The file was removed\n" + "\tPATH3\tedit - The file was modified\n" + "\n", content);
    }
View Full Code Here

Examples of hudson.model.AbstractBuild

            throws Exception {
        changesSinceLastBuildContent.regex = "<defectId>(DEFECT-[0-9]+)</defectId><message>(.*)</message>";
        changesSinceLastBuildContent.replace = "[$1] $2";
        changesSinceLastBuildContent.format = "%m\\n";

        AbstractBuild currentBuild = createBuildWithAffectedFiles(Result.SUCCESS, 42, "<defectId>DEFECT-666</defectId><message>Initial commit</message>");

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

        assertEquals("[DEFECT-666] Initial commit\n\n", content);
    }
View Full Code Here

Examples of hudson.model.AbstractBuild

    }

    @Test
    public void testShouldPrintDefaultMessageWhenNoChanges()
            throws Exception {
        AbstractBuild currentBuild = createBuildWithNoChanges(Result.SUCCESS, 42);

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

        assertEquals(ChangesSinceLastBuildContent.DEFAULT_DEFAULT_VALUE, content);
    }
View Full Code Here

Examples of hudson.model.AbstractBuild

    @Test
    public void testShouldPrintMessageWhenNoChanges()
            throws Exception {
        changesSinceLastBuildContent.def = "another default message\n";
        AbstractBuild currentBuild = createBuildWithNoChanges(Result.SUCCESS, 42);

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

        assertEquals("another default message\n", content);
    }
View Full Code Here

Examples of hudson.model.AbstractBuild

        assertEquals("another default message\n", content);
    }

    private AbstractBuild createBuild(Result result, int buildNumber, String message) {
        AbstractBuild build = mock(AbstractBuild.class);
        when(build.getResult()).thenReturn(result);
        ChangeLogSet changes1 = createChangeLog(message);
        when(build.getChangeSet()).thenReturn(changes1);
        when(build.getNumber()).thenReturn(buildNumber);

        return build;
    }
View Full Code Here

Examples of hudson.model.AbstractBuild

        return build;
    }
   
    private AbstractBuild createBuildWithAffectedFiles(Result result, int buildNumber, String message) {
        AbstractBuild build = mock(AbstractBuild.class);
        when(build.getResult()).thenReturn(result);
        ChangeLogSet changes1 = createChangeLogWithAffectedFiles(message);
        when(build.getChangeSet()).thenReturn(changes1);
        when(build.getNumber()).thenReturn(buildNumber);

        return build;
    }
View Full Code Here

Examples of hudson.model.AbstractBuild

        return changes;
    }
   
    private AbstractBuild createBuildWithNoChanges(Result result, int buildNumber) {
        AbstractBuild build = mock(AbstractBuild.class);
        when(build.getResult()).thenReturn(result);
        ChangeLogSet changes1 = createEmptyChangeLog();
        when(build.getChangeSet()).thenReturn(changes1);
        when(build.getNumber()).thenReturn(buildNumber);

        return build;
    }
View Full Code Here

Examples of hudson.model.AbstractBuild

    }
   
    @Test
    public void testGetContent_shouldGetNoContentSinceSuccessfulBuildIfNoPreviousBuild()
            throws Exception {
        AbstractBuild build = mock(AbstractBuild.class);
        String contentStr = content.evaluate(build, listener, ChangesSinceLastSuccessfulBuildContent.MACRO_NAME);
        assertEquals("", contentStr);
    }
View Full Code Here

Examples of hudson.model.AbstractBuild

    }

    @Test
    public void testGetContent_shouldGetPreviousBuildFailures()
            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 contentStr = content.evaluate(currentBuild, listener, ChangesSinceLastSuccessfulBuildContent.MACRO_NAME);

        assertEquals("Changes for Build #41\n"
View Full Code Here

Examples of hudson.model.AbstractBuild

    @Test
    public void testGetContent_whenReverseOrderIsTrueShouldReverseOrderOfChanges()
            throws Exception {
        content.reverse = true;

        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 contentStr = content.evaluate(currentBuild, listener, ChangesSinceLastSuccessfulBuildContent.MACRO_NAME);

        assertEquals("Changes for Build #42\n" + "[Ash Lux] Changes for a successful build.\n" + "\n" + "\n"
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.