Package org.gradle.logging.internal

Examples of org.gradle.logging.internal.TestStyledTextOutput


    private BuildListener listener;
    private Clock buildTimeClock;

    @Before
    public void setup() {
        textOutput = new TestStyledTextOutput();
        buildTimeClock = context.mock(Clock.class);
        textOutputFactory = context.mock(StyledTextOutputFactory.class);
        listener = new BuildResultLogger(textOutputFactory, buildTimeClock);
    }
View Full Code Here


    }

    @Test
    public void writeRootProjectHeader() throws IOException {
        final Project project = context.mock(Project.class);
        TestStyledTextOutput textOutput = new TestStyledTextOutput();

        context.checking(new Expectations() {{
            allowing(project).getRootProject();
            will(returnValue(project));
            allowing(project).getDescription();
            will(returnValue(null));
        }});

        renderer.setOutput(textOutput);
        renderer.startProject(project);
        renderer.completeProject(project);
        renderer.complete();

        assertThat(textOutput.toString(), containsLine("Root Project"));
    }
View Full Code Here

    }

    @Test
    public void writeSubProjectHeader() throws IOException {
        final Project project = context.mock(Project.class);
        TestStyledTextOutput textOutput = new TestStyledTextOutput();

        context.checking(new Expectations() {{
            allowing(project).getRootProject();
            will(returnValue(context.mock(Project.class, "root")));
            allowing(project).getDescription();
            will(returnValue(null));
            allowing(project).getPath();
            will(returnValue("<path>"));
        }});

        renderer.setOutput(textOutput);
        renderer.startProject(project);
        renderer.completeProject(project);
        renderer.complete();

        assertThat(textOutput.toString(), containsLine("Project <path>"));
    }
View Full Code Here

    }

    @Test
    public void includesProjectDescriptionInHeader() throws IOException {
        final Project project = context.mock(Project.class);
        TestStyledTextOutput textOutput = new TestStyledTextOutput();

        context.checking(new Expectations() {{
            allowing(project).getRootProject();
            will(returnValue(project));
            allowing(project).getDescription();
            will(returnValue("this is the root project"));
        }});

        renderer.setOutput(textOutput);
        renderer.startProject(project);
        renderer.completeProject(project);
        renderer.complete();

        assertThat(textOutput.toString(), containsLine("Root Project - this is the root project"));
    }
View Full Code Here

TOP

Related Classes of org.gradle.logging.internal.TestStyledTextOutput

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.