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

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


        GerritServer gerritServer = PluginImpl.getInstance().getServer(PluginImpl.DEFAULT_SERVER_NAME);
        gerritServer.getConfig().setCategories(Setup.createCodeReviewVerdictCategoryList());
        FreeStyleProject project = DuplicatesUtil.createGerritTriggeredJobForCommentAdded(j, "projectX");
        project.getBuildersList().add(new SleepBuilder(2000));
        server.waitForCommand(GERRIT_STREAM_EVENTS, 2000);
        CommentAdded firstEvent = Setup.createCommentAdded();
        gerritServer.triggerEvent(firstEvent);
        TestUtils.waitForBuilds(project, 1);
        assertEquals(1, project.getLastCompletedBuild().getNumber());
        assertSame(Result.SUCCESS, project.getLastCompletedBuild().getResult());
    }
View Full Code Here


        if (!super.shouldTriggerOn(event)) {
            return false;
        }
        Pattern p = Pattern
                .compile(commentAddedCommentContains, Pattern.DOTALL);
        CommentAdded ca = (CommentAdded)event;
        return p.matcher(ca.getComment()).find();
    }
View Full Code Here

    /**
     * Test that it should not block item caused by CommentAdded.
     */
    @Test
    public void shouldNotBlockItemCausedByCommentAdded() {
        assertNull("Build should not be blocked", dispatcher.canRun(createItemWithOneSlave(new CommentAdded())));
    }
View Full Code Here

    /**
     * Gives you a CommentAdded mock.
     * @return CommentAdded mock.
     */
    public static CommentAdded createCommentAdded() {
        CommentAdded event = new CommentAdded();
        Change change = new Change();
        change.setBranch("branch");
        change.setId("Iddaaddaa123456789");
        change.setNumber("1000");
        Account account = new Account();
        account.setEmail("email@domain.com");
        account.setName("Name");
        change.setOwner(account);
        change.setProject("project");
        change.setSubject("subject");
        change.setUrl("http://gerrit/1000");
        event.setChange(change);
        event.setProvider(new Provider(PluginImpl.DEFAULT_SERVER_NAME, "gerrit", "29418", "ssh", "http://gerrit/", "1"));
        PatchSet patch = new PatchSet();
        patch.setNumber("1");
        patch.setRevision("9999");
        event.setPatchset(patch);
        List<Approval> approvals = new LinkedList<Approval>();
        Approval approval = new Approval();
        approval.setType("CRVW");
        approval.setValue("1");
        approvals.add(approval);
        event.setApprovals(approvals);
        return event;
    }
View Full Code Here

TOP

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

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.