Package com.sonyericsson.hudson.plugins.gerrit.trigger.events

Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.events.ManualPatchsetCreated


     * @throws Exception if so.
     */
    @Test
    public void testTriggerScanDoneFalse() throws Exception {
        TriggerMonitor monitor = new TriggerMonitor();
        ManualPatchsetCreated patch = Setup.createManualPatchsetCreated();
        monitor.add(patch);
        monitor.triggerScanStarting(patch);

        TriggerMonitor.EventState state = monitor.getEvents().get(0);

View Full Code Here


     * @throws Exception if so.
     */
    @Test
    public void testProjectTriggered() throws Exception {
        TriggerMonitor monitor = new TriggerMonitor();
        ManualPatchsetCreated patch = Setup.createManualPatchsetCreated();
        monitor.add(patch);
        monitor.triggerScanStarting(patch);
        AbstractProject project = PowerMockito.mock(AbstractProject.class);
        doReturn("projectX").when(project).getFullName();
        monitor.projectTriggered(patch, project);
View Full Code Here

     * @throws Exception if so.
     */
    @Test
    public void testBuildStarted() throws Exception {
        TriggerMonitor monitor = new TriggerMonitor();
        ManualPatchsetCreated patch = Setup.createManualPatchsetCreated();
        monitor.add(patch);
        monitor.triggerScanStarting(patch);
        AbstractProject project = PowerMockito.mock(AbstractProject.class);
        doReturn("projectX").when(project).getFullName();
        AbstractBuild build = mock(AbstractBuild.class);
View Full Code Here

     * @throws Exception if so.
     */
    @Test
    public void testBuildCompleted() throws Exception {
        TriggerMonitor monitor = new TriggerMonitor();
        ManualPatchsetCreated patch = Setup.createManualPatchsetCreated();
        monitor.add(patch);
        monitor.triggerScanStarting(patch);
        AbstractProject project = PowerMockito.mock(AbstractProject.class);
        doReturn("projectX").when(project).getFullName();
        AbstractBuild build = mock(AbstractBuild.class);
View Full Code Here

     * @throws Exception if so.
     */
    @Test
    public void testAllBuildsCompleted() throws Exception {
        TriggerMonitor monitor = new TriggerMonitor();
        ManualPatchsetCreated patch = Setup.createManualPatchsetCreated();
        monitor.add(patch);
        monitor.triggerScanStarting(patch);
        AbstractProject project = PowerMockito.mock(AbstractProject.class);
        doReturn("projectX").when(project).getFullName();
        AbstractBuild build = mock(AbstractBuild.class);
View Full Code Here

            session.setAttribute(SESSION_TRIGGER_MONITOR, monitor);
            logger.trace("Calling to index the search result.");
            HashMap<String, JSONObject> indexed = indexResult(result);
            logger.debug("Creating and triggering events.");
            for (String rowId : selectedRows) {
                ManualPatchsetCreated event = findAndCreatePatchSetEvent(rowId, indexed);
                logger.debug("Created event: {}", event);
                if (event != null) {
                    if (event.getProvider() == null || event.getProvider().getName() == null) {
                        event.setProvider(createProviderFromGerritServer(selectedServer));
                    }
                    monitor.add(event);
                    logger.trace("Triggering event: {}", event);
                    triggerEvent(event);
                }
View Full Code Here

                String changeId = ids[0] + ID_SEPARATOR + ids[2];
                logger.debug("ChangeId calculated to: {}", changeId);
                JSONObject change = indexed.get(changeId);
                if (change != null) {
                    logger.debug("Found the change: {}", change);
                    return new ManualPatchsetCreated(change, patch, Hudson.getAuthentication().getName());
                } else {
                    logger.trace("No change found with id {}", changeId);
                    return null;
                }
            } else {
View Full Code Here

TOP

Related Classes of com.sonyericsson.hudson.plugins.gerrit.trigger.events.ManualPatchsetCreated

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.