Package hudson.triggers

Examples of hudson.triggers.Trigger


    public static GitlabBuildTriggerDescriptor getDesc() {
        return DESCRIPTOR;
    }

    public static GitlabBuildTrigger getTrigger(AbstractProject project) {
        Trigger trigger = project.getTrigger(GitlabBuildTrigger.class);

        if (trigger == null || !(trigger instanceof GitlabBuildTrigger)) {
            return null;
        }
View Full Code Here


    @Override public Map<TriggerDescriptor, Trigger<?>> getTriggers() {
        return triggers.toMap();
    }

    public void addTrigger(Trigger trigger) {
        Trigger old = triggers.get(trigger.getDescriptor());
        if (old != null) {
            old.stop();
            triggers.remove(old);
        }
        triggers.add(trigger);
        trigger.start(this, true);
    }
View Full Code Here

        this.commentFilePath = commentFilePath;
        this.allowMembersOfWhitelistedOrgsAsAdmin = allowMembersOfWhitelistedOrgsAsAdmin;
    }

    public static GhprbTrigger extractTrigger(AbstractProject<?, ?> p) {
        Trigger trigger = p.getTrigger(GhprbTrigger.class);
        if (trigger == null || (!(trigger instanceof GhprbTrigger))) {
            return null;
        }
        return (GhprbTrigger) trigger;
    }
View Full Code Here

    @Test
    public void testClearOriginalValue() throws ANTLRException {
        //Overridden flag should be cleared to false. Pre-set true value
        property.setOverridden(true);
        assertTrue(property.isOverridden());
        Trigger trigger = new TimerTrigger("* * * * *");
        property.clearOriginalValue(trigger);
        //Original value should be set with overridden flag == false
        assertFalse(property.isOverridden());
        assertTrue(trigger == property.getOriginalValue());
    }
View Full Code Here

     *
     * @throws antlr.ANTLRException if any
     */
    @Test
    public void testUpdateOriginalValue() throws ANTLRException {
        Trigger originalTrigger = new TimerTrigger("* * * * *");
        Trigger cascadingTrigger = new TimerTrigger("* * * * *");
        property.updateOriginalValue(originalTrigger, cascadingTrigger);
        //Property isn't overridden because of values equal.
        assertFalse(property.isOverridden());
        //If trigger property value equals to cascading be sure that sets original value instead of cascading.
        assertEquals(property.getOriginalValue(), originalTrigger);
View Full Code Here

     *
     * @throws antlr.ANTLRException if any
     */
    @Test
    public void testOnCascadingProjectRemoved() throws ANTLRException {
        Trigger trigger = new TimerTrigger("* * * * *");
        property.setOriginalValue(trigger, false);
        assertTrue(trigger == property.getOriginalValue());
        assertFalse(property.isOverridden());
        property.onCascadingProjectRemoved();
        assertFalse(property.isOverridden());
View Full Code Here

        assertNull(project.getProperty(scmTriggerPropertyKey));
        assertNull(project.getProperty(timerTriggerPropertyKey));
        project.convertTriggerProperties();

        assertNotNull(project.getProperty(scmTriggerPropertyKey));
        Trigger trigger = (Trigger) project.getProperty(scmTriggerPropertyKey).getValue();
        assertEquals("5 * * * *", trigger.getSpec());

        assertNotNull(project.getProperty(timerTriggerPropertyKey));
        trigger = (Trigger) project.getProperty(timerTriggerPropertyKey).getValue();
        assertEquals("*/10 * * * *", trigger.getSpec());
        verifyAll();
    }
View Full Code Here

                                          JSONObject json) throws Descriptor.FormException {
        TriggerProjectProperty property = CascadingUtil.getTriggerProjectProperty(job, key);
        if (property.getValue() != null) {
            property.getValue().stop();
        }
        Trigger trigger = null;
        if (json.has(key)) {
            trigger = descriptor.newInstance(req, json.getJSONObject(key));
            trigger.start(job, true);
        }
        property.setValue(trigger);
        Set<String> cascadingChildrenNames = job.getCascadingChildrenNames();
        if (null != cascadingChildrenNames) {
            for (String childName : cascadingChildrenNames) {
View Full Code Here

TOP

Related Classes of hudson.triggers.Trigger

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.