Package hudson.model

Examples of hudson.model.TaskListener


    /**
     * Reports a user-friendly error message for {@link MissingContextVariableException}.
     */
    private void reportMissingContextVariableException(CpsStepContext context, MissingContextVariableException e) {
        TaskListener tl;
        try {
            tl = context.get(TaskListener.class);
            if (tl==null)       return; // if we can't report an error, give up
        } catch (IOException _) {
            return;
        } catch (InterruptedException _) {
            return;
        }

        StringBuilder names = new StringBuilder();
        for (StepDescriptor p : e.getProviders()) {
            if (names.length()>0)   names.append(',');
            names.append(p.getFunctionName());
        }

        PrintStream logger = tl.getLogger();
        logger.println(e.getMessage());
        if (names.length()>0)
            logger.println("Perhaps you forgot to surround the code with a step that provides this, such as: "+names);
    }
View Full Code Here


        return HttpResponses.redirectToDot();
    }

    public HttpResponse doWriteLog() throws IOException {
        System.out.println("JenkowWorkflowRun.doWriteLog");
        TaskListener l = createListener();
        l.getLogger().println("Current time is "+new Date());
        return HttpResponses.redirectTo("console");
    }
View Full Code Here

public class XCodeBuildOutputParserTest {
    XCodeBuildOutputParser parser;

    @Before
    public void setUp() throws IOException, InterruptedException {
        parser = new XCodeBuildOutputParser(new FilePath(new File(".")), new TaskListener() {

            public PrintStream getLogger() {
                try {
                    return new PrintStream("test-output.txt");
                } catch(FileNotFoundException e) {
View Full Code Here

     * test.
     * @throws Exception Exception
     */
    @Test
    public void testGetBuildStartedCommand() throws Exception {
        TaskListener taskListener = mock(TaskListener.class);

        GerritTrigger trigger = mock(GerritTrigger.class);
        when(trigger.getGerritBuildStartedVerifiedValue()).thenReturn(null);
        when(trigger.getGerritBuildStartedCodeReviewValue()).thenReturn(32);
        AbstractProject project = mock(AbstractProject.class);
View Full Code Here

        IGerritHudsonTriggerConfig config = Setup.createConfig();

        Hudson hudson = PowerMockito.mock(Hudson.class);
        when(hudson.getRootUrl()).thenReturn("http://localhost/");

        TaskListener taskListener = mock(TaskListener.class);

        GerritTrigger trigger = mock(GerritTrigger.class);
        when(trigger.getGerritBuildSuccessfulVerifiedValue()).thenReturn(null);
        when(trigger.getGerritBuildSuccessfulCodeReviewValue()).thenReturn(32);
        when(trigger.getCustomUrl()).thenReturn(customUrl);
View Full Code Here

        IGerritHudsonTriggerConfig config = Setup.createConfig();

        Hudson hudson = PowerMockito.mock(Hudson.class);
        when(hudson.getRootUrl()).thenReturn("http://localhost/");

        TaskListener taskListener = mock(TaskListener.class);

        GerritTrigger trigger = mock(GerritTrigger.class);
        when(trigger.getGerritBuildSuccessfulVerifiedValue()).thenReturn(null);
        when(trigger.getGerritBuildSuccessfulCodeReviewValue()).thenReturn(32);
        AbstractProject project = mock(AbstractProject.class);
View Full Code Here

        when(hudson.getRootUrl()).thenReturn("http://localhost/");

        PowerMockito.mockStatic(GerritMessageProvider.class);
        when(GerritMessageProvider.all()).thenReturn(null);

        TaskListener taskListener = mock(TaskListener.class);

        GerritCmdRunner mockGerritCmdRunner = mock(GerritCmdRunner.class);

        AbstractBuild build = mock(AbstractBuild.class);
        when(build.getResult()).thenReturn(Result.SUCCESS);
View Full Code Here

        when(hudson.getRootUrl()).thenReturn("http://localhost/");

        PowerMockito.mockStatic(GerritMessageProvider.class);
        when(GerritMessageProvider.all()).thenReturn(null);

        TaskListener taskListener = mock(TaskListener.class);

        GerritCmdRunner mockGerritCmdRunner = mock(GerritCmdRunner.class);

        AbstractBuild build = mock(AbstractBuild.class);
        when(build.getResult()).thenReturn(Result.FAILURE);
View Full Code Here

        when(hudson.getRootUrl()).thenReturn("http://localhost/");

        PowerMockito.mockStatic(GerritMessageProvider.class);
        when(GerritMessageProvider.all()).thenReturn(null);

        TaskListener taskListener = mock(TaskListener.class);

        GerritCmdRunner mockGerritCmdRunner = mock(GerritCmdRunner.class);

        AbstractBuild build = mock(AbstractBuild.class);
        when(build.getResult()).thenReturn(Result.SUCCESS);
View Full Code Here

TOP

Related Classes of hudson.model.TaskListener

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.