Package net.sourceforge.cruisecontrol.builders

Examples of net.sourceforge.cruisecontrol.builders.MockBuilder


        } catch (CruiseControlException expected) {
        }
    }

    public void testSelectBuilder_MultipleBuildersWithDaySet() throws CruiseControlException {
        Builder thursdayBuilder = new MockBuilder();
        thursdayBuilder.setDay("thursday");
        Schedule scheduledByDay = new Schedule();
        scheduledByDay.addBuilder(thursdayBuilder);
        assertEquals(thursdayBuilder, scheduledByDay.selectBuilder(1, THURSDAY_1001, THURSDAY_1101));
        assertEquals(thursdayBuilder, scheduledByDay.selectBuilder(1, THURSDAY_1001, FRIDAY_0000));       

        Builder fridayBuilder = new MockBuilder();
        fridayBuilder.setDay("friday");
        scheduledByDay.addBuilder(fridayBuilder);
        assertEquals(thursdayBuilder, scheduledByDay.selectBuilder(1, THURSDAY_1001, THURSDAY_1101));
        assertEquals(fridayBuilder, scheduledByDay.selectBuilder(1, THURSDAY_1001, FRIDAY_0000));
    }
View Full Code Here


            schedule.getTimeToNextBuild(THURSDAY_2301, ONE_HOUR));
    }
   
    public void testGetTimeToNextBuild_MultipleBuilderWithDaySet() {
        Schedule intervalThursdaysSchedule = new Schedule();
        Builder intervalThursdays = new MockBuilder();
        intervalThursdays.setDay("thursday");
        intervalThursdaysSchedule.addBuilder(intervalThursdays);
        assertEquals(ONE_MINUTE, intervalThursdaysSchedule.getTimeToNextBuild(THURSDAY_2301, ONE_MINUTE));
        assertEquals(6 * ONE_DAY + ONE_HOUR - ONE_MINUTE,
                intervalThursdaysSchedule.getTimeToNextBuild(THURSDAY_2301, ONE_HOUR));
        assertEquals(6 * ONE_DAY + ONE_HOUR - ONE_MINUTE,
View Full Code Here

            dailyBuildSchedule.getTimeToNextBuild(THURSDAY_1201, ONE_MINUTE));
    }

    public void testGetTimeToNextBuild_WeeklyBuild() {
        schedule = new Schedule();
        Builder weeklyBuilder = new MockBuilder();
        weeklyBuilder.setTime("0100");
        weeklyBuilder.setDay("Sunday");
        schedule.addBuilder(weeklyBuilder);

        assertEquals((ONE_DAY * 2) + ONE_HOUR,
                schedule.getTimeToNextBuild(FRIDAY_0000, ONE_MINUTE));
    }
View Full Code Here

                schedule.getTimeToNextBuild(FRIDAY_0000, ONE_MINUTE));
    }

    public void testGetTimeToNextBuild_MonthlyBuild() {
        schedule = new Schedule();
        Builder monthlyBuilder = new MockBuilder() {
            private long targetTime = FRIDAY_0000.getTime() + (30 * ONE_DAY);
            public boolean isValidDay(Date now) {
                return targetTime <= now.getTime() ? true : false;
            }
        };
        monthlyBuilder.setTime("0000");
        schedule.addBuilder(monthlyBuilder);

        assertEquals(ONE_DAY * 30,
                schedule.getTimeToNextBuild(FRIDAY_0000, ONE_MINUTE));

View Full Code Here

            dailyBuildSchedule.getTimeToNextBuild(THURSDAY_1201, ONE_MINUTE));
    }

    public void testGetTimeToNextBuild_WeeklyBuild() {
        schedule = new Schedule();
        Builder weeklyBuilder = new MockBuilder();
        weeklyBuilder.setTime("0100");
        weeklyBuilder.setDay("Sunday");
        schedule.addBuilder(weeklyBuilder);

        assertEquals((ONE_DAY * 2) + ONE_HOUR,
                schedule.getTimeToNextBuild(FRIDAY_0000, ONE_MINUTE));
    }
View Full Code Here

                schedule.getTimeToNextBuild(FRIDAY_0000, ONE_MINUTE));
    }

    public void testGetTimeToNextBuild_MonthlyBuild() {
        schedule = new Schedule();
        Builder monthlyBuilder = new MockBuilder() {
            private long targetTime = FRIDAY_0000.getTime() + (30 * ONE_DAY);
            public boolean isValidDay(Date now) {
                return targetTime <= now.getTime() ? true : false;
            }
        };
        monthlyBuilder.setTime("0000");
        schedule.addBuilder(monthlyBuilder);

        assertEquals(ONE_DAY * 30,
                schedule.getTimeToNextBuild(FRIDAY_0000, ONE_MINUTE));

View Full Code Here

        assertEquals(cvstimestamp, map.get("cvstimestamp"));
    }
   
    public void testGetTimeToNextBuild_AfterShortBuild() {
        Schedule schedule = new Schedule();
        MockBuilder noonBuilder = new MockBuilder();
        noonBuilder.setTime("1200");
        noonBuilder.setBuildLogXML(new Element("builder1"));
        schedule.addBuilder(noonBuilder);
        project.setSchedule(schedule);
       
        Calendar cal = Calendar.getInstance();
        cal.set(2001, Calendar.NOVEMBER, 22);
View Full Code Here

TOP

Related Classes of net.sourceforge.cruisecontrol.builders.MockBuilder

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.