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

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


     */
    @Test
    public void testMarshalWithOthersChangeMerged() throws Exception {
        TriggeredItemEntity entity = new TriggeredItemEntity(100, "projectX");

        ChangeMerged event = Setup.createChangeMerged();

        TriggerContext context = new TriggerContext(event);
        context.setThisBuild(entity);
        LinkedList<TriggeredItemEntity> otherBuilds = new LinkedList<TriggeredItemEntity>();
        otherBuilds.add(new TriggeredItemEntity(1, "projectY"));
View Full Code Here


        Calendar cal = Calendar.getInstance();
        cal.setTime(new Date());
        cal.add(Calendar.HOUR, HOURSBEFORECHANGEMERGEDFORPATCHSET);
        Date dateBefore8Hours = cal.getTime();

        ChangeMerged changeMerged = Setup.createChangeMergedWithPatchSetDate("someGerritServer", "someProject",
                "refs/changes/1/1/1", dateBefore8Hours);
        Item item = createItem(changeMerged, new String[] {"slaveA"});

        // item is NOT blocked since patchset createdOn date is older than cache
        // we assume it was
View Full Code Here

        Calendar cal = Calendar.getInstance();
        cal.setTime(new Date());
        cal.add(Calendar.HOUR, HOURBEFOREREPLICATIONCACHECREATED);
        Date dateBefore1Hours = cal.getTime();

        ChangeMerged changeMerged = Setup.createChangeMergedWithPatchSetDate("someGerritServer", "someProject",
                "refs/changes/1/1/1", dateBefore1Hours);
        Item item = createItem(changeMerged, new String[] {"slaveA"});

        // item is NOT blocked since patchset createdOn date is older than cache
        // we assume it was
View Full Code Here

     * After the Change Merged event is received.
     */
    @Test
    public void shouldBlockItemUntilIfPatchSetIsReplicatedToOneSlaveAfterChangeMerged() {

        ChangeMerged changeMerged = Setup.createChangeMerged("someGerritServer", "someProject",
                "refs/changes/1/1/1");
        patchSetIsReplicatedToOneSlaveAfterChangeBasedEvent(changeMerged);

    }
View Full Code Here

        //send the replication event before change merged event
        dispatcher.gerritEvent(Setup.createRefReplicatedEvent("someProject", "refs/changes/1/1/1", "someGerritServer",
                "slaveA", RefReplicated.SUCCEEDED_STATUS));

        ChangeMerged changeMerged = Setup.createChangeMerged("someGerritServer", "someProject",
                "refs/changes/1/1/1");
        Item item = createItem(changeMerged, new String[] {"slaveA"});

        assertNull("Item should not be blocked", dispatcher.canRun(item));
        assertNull("Item should not be tagged with replicationFailedAction",
View Full Code Here

    /**
     * Gives you a ChangeMerged mock.
     * @return ChangeMerged mock.
     */
    public static ChangeMerged createChangeMerged() {
        ChangeMerged event = new ChangeMerged();
        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);
        PatchSet patch = new PatchSet();
        patch.setNumber("1");
        patch.setRevision("9999");
        event.setPatchset(patch);
        return event;
    }
View Full Code Here

     * @param date The patchset's createdOn date
     * @return ChangeMerged mock.
     */
    public static ChangeMerged createChangeMergedWithPatchSetDate(String serverName, String project,
            String ref, Date date) {
        ChangeMerged event = new ChangeMerged();
        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);
        PatchSet patch = new PatchSet();
        patch.setNumber("1");
        patch.setRevision("9999");
        event.setPatchset(patch);
        patch.setRef(ref);
        patch.setCreatedOn(date);
        event.setProvider(new Provider(serverName, "gerrit", "29418", "ssh", "http://gerrit/", "1"));
        return event;
    }
View Full Code Here

TOP

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

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.