Examples of FreeStyleProject


Examples of hudson.model.FreeStyleProject

   
    @Test
    public void testDoCheckDisplayNameUnique() throws Exception {
        final String curJobName = "curJobName";
        final String jobName = "jobName";
        FreeStyleProject curProject = createFreeStyleProject(curJobName);
        curProject.setDisplayName("currentProjectDisplayName");
       
        FreeStyleProject p = createFreeStyleProject(jobName);
        p.setDisplayName("displayName");
       
        Jenkins jenkins = Jenkins.getInstance();
        FormValidation v = jenkins.doCheckDisplayName("1displayName", curJobName);
        Assert.assertEquals(FormValidation.ok(), v);
    }
View Full Code Here

Examples of hudson.model.FreeStyleProject

    @Test
    public void testDoCheckDisplayNameSameAsDisplayName() throws Exception {
        final String curJobName = "curJobName";
        final String jobName = "jobName";
        final String displayName = "displayName";
        FreeStyleProject curProject = createFreeStyleProject(curJobName);
        curProject.setDisplayName("currentProjectDisplayName");
       
        FreeStyleProject p = createFreeStyleProject(jobName);
        p.setDisplayName(displayName);
       
        Jenkins jenkins = Jenkins.getInstance();
        FormValidation v = jenkins.doCheckDisplayName(displayName, curJobName);
        Assert.assertEquals(FormValidation.Kind.WARNING, v.kind);       
    }
View Full Code Here

Examples of hudson.model.FreeStyleProject

    @Test
    public void testDoCheckDisplayNameSameAsJobName() throws Exception {
        final String curJobName = "curJobName";
        final String jobName = "jobName";
        final String displayName = "displayName";
        FreeStyleProject curProject = createFreeStyleProject(curJobName);
        curProject.setDisplayName("currentProjectDisplayName");
       
        FreeStyleProject p = createFreeStyleProject(jobName);
        p.setDisplayName(displayName);
       
        Jenkins jenkins = Jenkins.getInstance();
        FormValidation v = jenkins.doCheckDisplayName(jobName, curJobName);
        Assert.assertEquals(FormValidation.Kind.WARNING, v.kind);               
    }
View Full Code Here

Examples of hudson.model.FreeStyleProject

* @author Kohsuke Kawaguchi
*/
public class FileSystemProvisionerTest extends HudsonTestCase {
    @Bug(13165)
    public void test13165() throws Exception {
        FreeStyleProject p = createFreeStyleProject();
        FreeStyleBuild b = assertBuildStatusSuccess(p.scheduleBuild2(0));
        b.getWorkspace().child(".dot").touch(0);
        StreamTaskListener listener = StreamTaskListener.fromStdout();

        WorkspaceSnapshot s = jenkins.getFileSystemProvisioner().snapshot(b, b.getWorkspace(), "**/*", listener);
        FilePath tmp = new FilePath(createTmpDir());
View Full Code Here

Examples of hudson.model.FreeStyleProject

/**
* @author Kohsuke Kawaguchi
*/
public class ExceptionAnnotationTest extends HudsonTestCase {
    public void test1() throws Exception {
        FreeStyleProject p = createFreeStyleProject();
        p.getBuildersList().add(new TestBuilder() {
            @Override
            public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
                new Throwable().printStackTrace(listener.error("Injecting a failure"));
                return true;
            }
View Full Code Here

Examples of hudson.model.FreeStyleProject

        String recipient = "you <you@sun.com>";
        Mailbox yourInbox = Mailbox.get(new InternetAddress(recipient));
        yourInbox.clear();

        // create a project to simulate a build failure
        FreeStyleProject project = createFreeStyleProject();
        project.getBuildersList().add(new FailureBuilder());
        Mailer m = new Mailer();
        m.recipients = recipient;
        project.getPublishersList().add(m);

        project.scheduleBuild2(0).get();

        assertEquals(1,yourInbox.size());
        Address[] senders = yourInbox.get(0).getFrom();
        assertEquals(1,senders.length);
        assertEquals("me <me@sun.com>",senders[0].toString());
View Full Code Here

Examples of hudson.model.FreeStyleProject

    /**
     * Let the build complete, and see if stateless {@link ConsoleAnnotator} annotations happen as expected.
     */
    @Bug(6031)
    public void testCompletedStatelessLogAnnotation() throws Exception {
        FreeStyleProject p = createFreeStyleProject();
        p.getBuildersList().add(new TestBuilder() {
            public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
                listener.getLogger().println("---");
                listener.getLogger().println("ooo");
                listener.getLogger().println("ooo");
                return true;
View Full Code Here

Examples of hudson.model.FreeStyleProject

        m.sendToIndividuals = false;
        verifyRoundtrip(m);
    }

    private void verifyRoundtrip(Mailer before) throws Exception {
        FreeStyleProject p = createFreeStyleProject();
        p.getPublishersList().add(before);
        submit(new WebClient().getPage(p,"configure").getFormByName("config"));
        Mailer after = p.getPublishersList().get(Mailer.class);
        assertNotSame(before,after);
        assertEqualBeans(before,after,"recipients,dontNotifyEveryUnstableBuild,sendToIndividuals");
    }
View Full Code Here

Examples of hudson.model.FreeStyleProject

        }
    }

    @Bug(6034)
    public void testConsoleAnnotationFilterOut() throws Exception {
        FreeStyleProject p = createFreeStyleProject();
        p.getBuildersList().add(new TestBuilder() {
            public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
                listener.getLogger().print("abc\n");
                listener.getLogger().print(HyperlinkNote.encodeTo("http://infradna.com/","def")+"\n");
                return true;
            }
View Full Code Here

Examples of hudson.model.FreeStyleProject

     * maintained across different progressiveLog calls.
     */
    public void testProgressiveOutput() throws Exception {
        final SequenceLock lock = new SequenceLock();
        WebClient wc = createWebClient();
        FreeStyleProject p = createFreeStyleProject();
        p.getBuildersList().add(new TestBuilder() {
            public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
                lock.phase(0);
                // make sure the build is now properly started
                lock.phase(2);
                listener.getLogger().println("line1");
                lock.phase(4);
                listener.getLogger().println("line2");
                lock.phase(6);
                return true;
            }
        });
        Future<FreeStyleBuild> f = p.scheduleBuild2(0);


        lock.phase(1);
        FreeStyleBuild b = p.getBuildByNumber(1);
        ProgressiveLogClient plc = new ProgressiveLogClient(wc,b);
        // the page should contain some output indicating the build has started why and etc.
        plc.next();

        lock.phase(3);
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.