Package com.sonymobile.tools.gerrit.gerritevents.dto.events

Examples of com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent


        assertNotNull(freeStyleBuild.getAction(RetriggerAction.class));
        GerritManualCause cause = freeStyleBuild.getCause(GerritManualCause.class);
        assertNotNull(cause);
        BadgeAction action = freeStyleBuild.getAction(BadgeAction.class);
        assertNotNull(action);
        GerritTriggeredEvent event = action.getEvent();
        assertNotNull(event);
        GerritEventType eventType = event.getEventType();
        assertEquals(eventType.getEventRepresentative(), PatchsetCreated.class);
    }
View Full Code Here


            implements BuildChooserContext.ContextCallable<AbstractBuild<?, ?>, String> {
        @Override
        public String invoke(AbstractBuild<?, ?> build, VirtualChannel channel) {
            GerritCause cause = (GerritCause)build.getCause(GerritCause.class);
            if (cause != null) {
                GerritTriggeredEvent event = cause.getEvent();
                if (event instanceof ChangeBasedEvent) {
                    return ((ChangeBasedEvent)event).getPatchSet().getRevision();
                }
                if (event instanceof RefUpdated) {
                    return ((RefUpdated)event).getRefUpdate().getNewRev();
View Full Code Here

        //Not gerrit-triggered
        if (cause == null) {
            logger.debug("Not a gerrit cause: {}", cause);
            return null;
        }
        GerritTriggeredEvent event = cause.getEvent();
        //The GerritCause should contain an event, but just in case.
        if (event == null) {
            logger.debug("Does not contain an event");
            return null;
        }
View Full Code Here

    @Override
    public void gerritEvent(GerritEvent event) {
        logger.trace("event: {}", event);
        if (event instanceof GerritTriggeredEvent) {
            GerritTriggeredEvent triggeredEvent = (GerritTriggeredEvent)event;
            if (isInteresting(triggeredEvent)) {
                logger.trace("The event is interesting.");
                notifyOnTriggered(triggeredEvent);
                schedule(new GerritCause(triggeredEvent, silentMode), triggeredEvent);
            }
View Full Code Here

        while (reader.hasMoreChildren()) {
            reader.moveDown();
            if ("event".equalsIgnoreCase(reader.getNodeName())) {
                String clazz = reader.getAttribute("class");
                Class<? extends GerritTriggeredEvent> theClass = calculateEventClass(clazz);
                GerritTriggeredEvent event = (GerritTriggeredEvent)context.convertAnother(tc, theClass);
                tc.setEvent(event);
            } else if ("thisBuild".equalsIgnoreCase(reader.getNodeName())) {
                TriggeredItemEntity entity = unmarshalItemEntity(reader, context);
                tc.setThisBuild(entity);
            } else if ("others".equalsIgnoreCase(reader.getNodeName())) {
View Full Code Here

     * @param memoryImprint the memory of the builds.
     * @return serverName the server name.
     */
    private String getServerName(BuildMemory.MemoryImprint memoryImprint) {
        if (memoryImprint != null) {
            GerritTriggeredEvent event = memoryImprint.getEvent();
            if (event != null) {
                return getServerName(event);
            } else {
                logger.error("Could not get the GerritTriggeredEvent from memoryImprint");
            }
View Full Code Here

    public synchronized void onCompleted(AbstractBuild r, TaskListener listener) {
        GerritCause cause = getCause(r);
        logger.debug("Completed. Build: {} Cause: {}", r, cause);
        if (cause != null) {
            cleanUpGerritCauses(cause, r);
            GerritTriggeredEvent event = cause.getEvent();
            GerritTrigger trigger = GerritTrigger.getTrigger(r.getProject());
            if (trigger != null) {
                // There won't be a trigger if this job was run through a unit test
                trigger.notifyBuildEnded(event);
            }
View Full Code Here

TOP

Related Classes of com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent

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.