Package hudson.model

Examples of hudson.model.FreeStyleProject.scheduleBuild2()


            public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
                build.getWorkspace().child("test.pdf").copyFrom(new FilePath(attachment));
                return true;
            }
        });
        FreeStyleBuild b = project.scheduleBuild2(0).get();    
        j.assertBuildStatusSuccess(b);
       
        Mailbox mbox = Mailbox.get("mickey@disney.com");
        assertEquals("Should have an email from success", 1, mbox.size());
       
View Full Code Here


                build.getWorkspace().child("testreport").mkdirs();
                build.getWorkspace().child("testreport").child("test.pdf").copyFrom(new FilePath(attachment));
                return true;
            }
        });
        FreeStyleBuild b = project.scheduleBuild2(0).get();    
        j.assertBuildStatusSuccess(b);
       
        Mailbox mbox = Mailbox.get("mickey@disney.com");
        assertEquals("Should have an email from success", 1, mbox.size());
       
View Full Code Here

                return true;
            }
        });
        TaskListener listener = StreamTaskListener.fromStdout();
        project.scheduleBuild2(0).get();
        FailedTestsContent failedTestsContent = new FailedTestsContent();
        failedTestsContent.onlyRegressions = true;
        String content = failedTestsContent.evaluate(project.getLastBuild(), listener, FailedTestsContent.MACRO_NAME);
        assertTrue("The failing test should be reported the first time it fails", content.contains("hudson.plugins.emailext"));
View Full Code Here

        FailedTestsContent failedTestsContent = new FailedTestsContent();
        failedTestsContent.onlyRegressions = true;
        String content = failedTestsContent.evaluate(project.getLastBuild(), listener, FailedTestsContent.MACRO_NAME);
        assertTrue("The failing test should be reported the first time it fails", content.contains("hudson.plugins.emailext"));

        project.scheduleBuild2(0).get();
        content = failedTestsContent.evaluate(project.getLastBuild(), listener, FailedTestsContent.MACRO_NAME);
        assertFalse("The failing test should not be reported the second time it fails", content.contains("hudson.plugins.emailext"));
        assertTrue("The content should state that there are other failing tests still", content.contains("and 1 other failed test"));
    }
}
View Full Code Here

       
        for(EmailTrigger trigger : publisher.configuredTriggers) {
            trigger.getEmail().addRecipientProvider(new ListRecipientProvider());
        }
       
        FreeStyleBuild build = prj.scheduleBuild2(0).get();
        j.assertBuildStatusSuccess(build);

        assertEquals(2, Mailbox.get("mickey@disney.com").size());       
    }
   
View Full Code Here

       
        for(EmailTrigger trigger : publisher.configuredTriggers) {
            trigger.getEmail().addRecipientProvider(new ListRecipientProvider());
        }
       
        FreeStyleBuild build = prj.scheduleBuild2(0).get();
        j.assertBuildStatusSuccess(build);
       
        assertEquals(0, Mailbox.get("mickey@disney.com").size());       
        assertThat("Publisher is disabled, should have message in build log", build.getLog(100),
                hasItem("Extended Email Publisher is currently disabled in project settings"));       
View Full Code Here

            public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
                build.getWorkspace().child("foo").write("Hello, world!", "UTF-8");
                return true;
            }
        });
        FreeStyleBuild build = project.scheduleBuild2(0).get();

        WorkspaceFileContent content = new WorkspaceFileContent();
        content.path = "foo";
        assertEquals("Hello, world!", content.evaluate(build, listener, WorkspaceFileContent.MACRO_NAME));
        content.path = "no-such-file";
View Full Code Here

    public void testTakeBlockedByProperty() throws Exception {
        Slave slave = createSlave();
        FreeStyleProject project = createFreeStyleProject();

        // First, attempt to run our project before adding the property
        Future<FreeStyleBuild> build = project.scheduleBuild2(0);
        assertBuildStatus(Result.SUCCESS, build.get(20, TimeUnit.SECONDS));

        // Add the build-blocker property and try again
        slave.getNodeProperties().add(new RejectAllTasksProperty());
View Full Code Here

        assertBuildStatus(Result.SUCCESS, build.get(20, TimeUnit.SECONDS));

        // Add the build-blocker property and try again
        slave.getNodeProperties().add(new RejectAllTasksProperty());

        build = project.scheduleBuild2(0);
        try {
            build.get(10, TimeUnit.SECONDS);
            fail("Expected timeout exception");
        } catch (TimeoutException e) {
            List<BuildableItem> buildables = hudson.getQueue().getBuildableItems();
View Full Code Here

            private Object writeReplace() { // don't really care about save
                return new NullSCM();
            }
        });
        p.scheduleBuild2(0).get();
        p.delete();
        assertTrue(callback[0]);
    }
   
    @Bug(4605)
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.