Package hudson.tasks

Examples of hudson.tasks.Shell


  public void testSimpleWfRun() throws Exception{
    FreeStyleProject launcher = createFreeStyleProject("launcher");
        DescribableList<Builder,Descriptor<Builder>> bl = launcher.getBuildersList();
    // TODO 4: if we have a way a script task can print into the job console, we no longer need the Shell build step
        bl.add(new JenkowBuilder(getWfName("workflow")));
    bl.add(new Shell("echo wf.done"));
       
        FreeStyleBuild build = launcher.scheduleBuild2(0).get();
       
        // TODO 9: we need to somehow mark the user task as complete
        System.out.println(build.getDisplayName()+" completed");
View Full Code Here


  public void testSimpleWfRun() throws Exception{
    FreeStyleProject launcher = createFreeStyleProject("launcher");
        DescribableList<Builder,Descriptor<Builder>> bl = launcher.getBuildersList();
    // TODO 4: if we have a way a script task can print into the job console, we no longer need the Shell build step
        bl.add(new JenkowBuilder(getWfName("workflow")));
    bl.add(new Shell("echo wf.done"));
       
        FreeStyleBuild build = launcher.scheduleBuild2(0).get();
        System.out.println(build.getDisplayName()+" completed");

        String s = FileUtils.readFileToString(build.getLogFile());
View Full Code Here

  public void testScriptSleepScript() throws Exception{
    FreeStyleProject launcher = createFreeStyleProject("launcher");
        DescribableList<Builder,Descriptor<Builder>> bl = launcher.getBuildersList();
    // TODO 4: if we have a way a script task can print into the job console, we no longer need the Shell build step
        bl.add(new JenkowBuilder(getWfName("workflow")));
    bl.add(new Shell("echo wf.done"));
       
        FreeStyleBuild build = launcher.scheduleBuild2(0).get();
        System.out.println(build.getDisplayName()+" completed");

        String s = FileUtils.readFileToString(build.getLogFile());
View Full Code Here

  public void testParallelJobs() throws Exception{
    Jenkins.getInstance().setNumExecutors(3);
   
    FreeStyleProject one = createFreeStyleProject("one");
        one.getBuildersList().add(new Shell("echo \"one running\"; sleep 5; exit 0"));
       
    FreeStyleProject two = createFreeStyleProject("two");
        two.getBuildersList().add(new Shell("echo \"two running\"; sleep 8; exit 0"));
   
        FreeStyleProject three = createFreeStyleProject("three");
        three.getBuildersList().add(new Shell("echo \"three running\"; sleep 11; exit 0"));

        FreeStyleProject launcher = createFreeStyleProject("launcher");
        DescribableList<Builder,Descriptor<Builder>> bl = launcher.getBuildersList();
    // TODO 4: if we have a way a script task can print into the job console, we no longer need the Shell build step
        bl.add(new JenkowBuilder(getWfName("workflow")));
    bl.add(new Shell("echo wf.done"));
       
        FreeStyleBuild build = launcher.scheduleBuild2(0).get();
        System.out.println(build.getDisplayName()+" completed");
       
        String s = FileUtils.readFileToString(build.getLogFile());
View Full Code Here

        repo.ensureWorkflowDefinition("wf1");
       
        FreeStyleProject launcher = createFreeStyleProject("j1");
        DescribableList<Builder,Descriptor<Builder>> bl = launcher.getBuildersList();
        bl.add(new JenkowBuilder("wf1"));
        bl.add(new Shell("echo wf.done"));
        configRoundtrip(launcher)// work around the problem in the core of not registering our builder's project actions

        testImage("job/j1/jenkow/graph","default");
        testImage("job/j1/jenkow/graph/0","0");
        testImage("job/j1/jenkow/graph/wf1","wf1");
View Full Code Here

                      + "\n"
                    + cmd+"\n";
   
    FreeStyleProject launcher = createFreeStyleProject(id);
        DescribableList<Builder,Descriptor<Builder>> bl = launcher.getBuildersList();
    bl.add(new Shell(script));
       
        FreeStyleBuild build = launcher.scheduleBuild2(0).get();
        System.out.println(build.getDisplayName()+" completed");

        String s = FileUtils.readFileToString(build.getLogFile());
View Full Code Here

   
    public void testManualTriggerSuccess() throws Exception{
        setNumExecutors(10);
       
        FreeStyleProject one = createFreeStyleProject("one");
        one.getBuildersList().add(new Shell("echo \"one running\"; sleep 5; exit 0"));
       
        FreeStyleProject two = createFreeStyleProject("two");
        two.getBuildersList().add(new Shell("echo \"two running\"; sleep 8; exit 0"));
       
        FreeStyleProject launcher = createFreeStyleProject("launcher");
        DescribableList<Builder,Descriptor<Builder>> bl = launcher.getBuildersList();
        bl.add(new JenkowBuilder(getWfName("workflow")));
        bl.add(new Shell("echo wf.done"));
       
        Future<FreeStyleBuild> launcherBF = launcher.scheduleBuild2(0);
       
        Thread.sleep(5000);
        one.scheduleBuild2(0);
View Full Code Here

        assertTrue(s.contains("+ echo wf.done"));
    }

    public void testManualTriggerTimeout() throws Exception{
        FreeStyleProject one = createFreeStyleProject("one");
        one.getBuildersList().add(new Shell("echo \"one running\"; sleep 5; exit 0"));
       
        FreeStyleProject two = createFreeStyleProject("two");
        two.getBuildersList().add(new Shell("echo \"two running\"; sleep 8; exit 0"));
       
        FreeStyleProject launcher = createFreeStyleProject("launcher");
        DescribableList<Builder,Descriptor<Builder>> bl = launcher.getBuildersList();
        bl.add(new JenkowBuilder(getWfName("workflow")));
        bl.add(new Shell("echo wf.done"));
       
        Future<FreeStyleBuild> launcherBF = launcher.scheduleBuild2(0);
     
        Thread.sleep(5000);
        one.scheduleBuild2(0);
View Full Code Here

        assertFalse(property.allowOverrideValue(new DescribableList(project), new DescribableList(project)));
        //Don't need to override Describable lists which has same Describable#data values, even if owners are not equal.
        assertFalse(property.allowOverrideValue(new DescribableList(project), new DescribableList(project)));
        assertFalse(property.allowOverrideValue(new DescribableList(project), new DescribableList(parent)));
        DescribableList describableList1 = new DescribableList(project,
            Arrays.asList(new Shell("echo 'test3'"), new Shell("echo 'test2'")));
        DescribableList describableList2 = new DescribableList(project,
            Arrays.asList(new Shell("echo 'test2'"), new Shell("echo 'test3'")));
        assertFalse(property.allowOverrideValue(describableList1, describableList2));

        DescribableList describableList3 = new DescribableList(parent, describableList2.toList());
        assertFalse(property.allowOverrideValue(describableList1, describableList3));

        describableList1 = new DescribableList(project, Arrays.asList(new Object()));
        describableList2 = new DescribableList(project, Arrays.asList(new Object()));
        assertFalse(property.allowOverrideValue(describableList1, describableList2));

        //Allow override if cascading or candidate are null
        assertTrue(property.allowOverrideValue(null, new DescribableList(project)));
        assertTrue(property.allowOverrideValue(new DescribableList(project), null));

        assertTrue(property.allowOverrideValue(new DescribableList(project),
            new DescribableList(project, Arrays.asList(new Shell("echo 'test1'")))));
        assertTrue(property.allowOverrideValue(new DescribableList(project, Arrays.asList(new Shell("echo 'test1'"))),
            new DescribableList(project)));
    }
View Full Code Here

    @Test
    public void testHashCode() throws IOException {
        assertEquals(new PersistedList().hashCode(), new PersistedList().hashCode());
        assertEquals(persistedList1.hashCode(), new PersistedList(owner1).hashCode());
        assertFalse(persistedList1.hashCode() == persistedList2.hashCode());
        persistedList1.add(new Shell("echo 'test1'"));
        assertFalse(persistedList1.hashCode() == persistedList2.hashCode());
        persistedList2.add(new Shell("echo 'test1'"));
        assertFalse(persistedList1.hashCode() == persistedList2.hashCode());
        persistedList3.add(new Shell("echo 'test1'"));
        assertEquals(persistedList1.hashCode(), persistedList3.hashCode());
        persistedList3.replaceBy(Arrays.asList(new Shell("echo 'test2'")));
        assertFalse(persistedList1.hashCode() == persistedList3.hashCode());
    }
View Full Code Here

TOP

Related Classes of hudson.tasks.Shell

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.