Package jenkins.model

Examples of jenkins.model.InterruptedBuildAction


        InputStream is = XStream2Test.class.getResourceAsStream("runMatrix.xml");
        MatrixRun result = (MatrixRun) Run.XSTREAM.fromXML(is);
        assertNotNull(result);
        assertNotNull(result.getPersistentActions());
        assertEquals(2, result.getPersistentActions().size());
        InterruptedBuildAction action = (InterruptedBuildAction) result.getPersistentActions().get(1);
        assertNotNull(action.getCauses());
        assertEquals(1, action.getCauses().size());
        CauseOfInterruption.UserInterruption cause =
            (CauseOfInterruption.UserInterruption) action.getCauses().get(0);
        assertNotNull(cause);
    }
View Full Code Here


        FreeStyleBuild b = r.get();

        // make sure this information is recorded
        assertEquals(b.getResult(),Result.FAILURE);
        InterruptedBuildAction iba = b.getAction(InterruptedBuildAction.class);
        assertEquals(1,iba.getCauses().size());
        assertEquals(((UserInterruption) iba.getCauses().get(0)).getUser(),johnny);

        // make sure it shows up in the log
        assertTrue(b.getLog().contains("Johnny"));
    }
View Full Code Here

            if (causes.isEmpty())   return;
            r = new ArrayList<CauseOfInterruption>(causes);
            causes.clear();
        }

        build.addAction(new InterruptedBuildAction(r));
        for (CauseOfInterruption c : r)
            c.print(listener);
    }
View Full Code Here

        Throwable t = execution.getCauseOfFailure();
        if (t instanceof AbortException) {
            listener.error(t.getMessage());
        } else if (t instanceof FlowInterruptedException) {
            List<CauseOfInterruption> causes = ((FlowInterruptedException) t).getCauses();
            addAction(new InterruptedBuildAction(causes));
            for (CauseOfInterruption cause : causes) {
                cause.print(listener);
            }
        } else if (t != null) {
            t.printStackTrace(listener.getLogger());
View Full Code Here

                    e2.waitForSuspension();
                    e3.waitForSuspension();
                    Thread.sleep(1000); // TODO why is this necessary?
                    assertFalse(b2.isBuilding());
                    assertEquals(Result.NOT_BUILT, b2.getResult());
                    InterruptedBuildAction iba = b2.getAction(InterruptedBuildAction.class);
                    assertNotNull(iba);
                    List<CauseOfInterruption> causes = iba.getCauses();
                    assertEquals(1, causes.size());
                    assertEquals(StageStepExecution.CanceledCause.class, causes.get(0).getClass());
                    assertEquals(b3, ((StageStepExecution.CanceledCause) causes.get(0)).getNewerBuild());
                    assertTrue(b3.isBuilding());
                    story.j.assertLogNotContains("done", b1);
View Full Code Here

TOP

Related Classes of jenkins.model.InterruptedBuildAction

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.