Package org.codinjutsu.tools.jenkins.logic

Examples of org.codinjutsu.tools.jenkins.logic.BuildStatusAggregator


            }
        }

        @Override
        public void onSuccess() {
            final BuildStatusAggregator buildStatusAggregator = new BuildStatusAggregator(jenkins.getJobs().size());

            GuiUtil.runInSwingThread(new Runnable() {
                @Override
                public void run() {
                    fillJobTree(buildStatusAggregator);
View Full Code Here


        return ServiceManager.getService(project, JenkinsWidget.class);
    }

    public JenkinsWidget(Project project) {
        this.project = project;
        JComponent buildStatusIcon = createStatusIcon(new BuildStatusAggregator(0));
        setLayout(new BorderLayout());
        add(buildStatusIcon, BorderLayout.CENTER);
    }
View Full Code Here

public class BuildStatusIconTest {

    @Test
    public void noBuildsShouldDisplayGreyIcon() throws Exception {
        BuildStatusAggregator aggregatorMock = Mockito.mock(BuildStatusAggregator.class);
        Mockito.when(aggregatorMock.hasNoResults()).thenReturn(true);

        BuildStatusIcon statusIcon = (BuildStatusIcon) BuildStatusIcon.createIcon(aggregatorMock);
        assertIconEquals("grey.png", statusIcon.icon);
        assertEquals("No builds", statusIcon.toolTipText);
        assertEquals(0, statusIcon.numberToDisplay);
View Full Code Here

        assertEquals(0, statusIcon.numberToDisplay);
    }

    @Test
    public void brokenBuildsShouldDisplayRedIcon() throws Exception {
        BuildStatusAggregator aggregatorMock = Mockito.mock(BuildStatusAggregator.class);
        Mockito.when(aggregatorMock.hasNoResults()).thenReturn(false);
        Mockito.when(aggregatorMock.getNbBrokenBuilds()).thenReturn(4);
        Mockito.when(aggregatorMock.getNbUnstableBuilds()).thenReturn(2);

        BuildStatusIcon statusIcon = (BuildStatusIcon) BuildStatusIcon.createIcon(aggregatorMock);
        assertIconEquals("red.png", statusIcon.icon);
        assertEquals("4 broken builds", statusIcon.toolTipText);
        assertEquals(4, statusIcon.numberToDisplay);
View Full Code Here

        assertEquals(4, statusIcon.numberToDisplay);
    }

    @Test
    public void unstableBuildsShouldDisplayYellowIcon() throws Exception {
        BuildStatusAggregator aggregatorMock = Mockito.mock(BuildStatusAggregator.class);
        Mockito.when(aggregatorMock.hasNoResults()).thenReturn(false);
        Mockito.when(aggregatorMock.getNbBrokenBuilds()).thenReturn(0);
        Mockito.when(aggregatorMock.getNbUnstableBuilds()).thenReturn(2);

        BuildStatusIcon statusIcon = (BuildStatusIcon) BuildStatusIcon.createIcon(aggregatorMock);
        assertIconEquals("yellow.png", statusIcon.icon);
        assertEquals("2 unstable builds", statusIcon.toolTipText);
        assertEquals(2, statusIcon.numberToDisplay);
View Full Code Here

        assertEquals(2, statusIcon.numberToDisplay);
    }

    @Test
    public void noBrokenBuildsShouldDisplayYellowIcon() throws Exception {
        BuildStatusAggregator aggregatorMock = Mockito.mock(BuildStatusAggregator.class);
        Mockito.when(aggregatorMock.hasNoResults()).thenReturn(false);
        Mockito.when(aggregatorMock.getNbBrokenBuilds()).thenReturn(0);
        Mockito.when(aggregatorMock.getNbUnstableBuilds()).thenReturn(0);

        BuildStatusIcon statusIcon = (BuildStatusIcon) BuildStatusIcon.createIcon(aggregatorMock);
        assertIconEquals("blue.png", statusIcon.icon);
        assertEquals("No broken builds", statusIcon.toolTipText);
        assertEquals(0, statusIcon.numberToDisplay);
View Full Code Here

TOP

Related Classes of org.codinjutsu.tools.jenkins.logic.BuildStatusAggregator

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.