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

Examples of com.sonymobile.tools.gerrit.gerritevents.dto.attr.Change


     * test.
     */
    @Test
    public void testMakeRefSpec1() {
        PatchsetCreated event = new PatchsetCreated();
        Change change = new Change();
        change.setNumber("1");
        event.setChange(change);
        PatchSet patch = new PatchSet();
        patch.setNumber("1");
        event.setPatchset(patch);
        String expResult = StringUtil.REFSPEC_PREFIX + "01/1/1";
View Full Code Here


     */
    @Test
    public void testMakeRefSpec2() {

        PatchsetCreated event = new PatchsetCreated();
        Change change = new Change();
        change.setNumber("12");
        event.setChange(change);
        PatchSet patch = new PatchSet();
        patch.setNumber("1");
        event.setPatchset(patch);
        String expResult = StringUtil.REFSPEC_PREFIX + "12/12/1";
View Full Code Here

     */
    @Test
    public void testMakeRefSpec3() {

        PatchsetCreated event = new PatchsetCreated();
        Change change = new Change();
        change.setNumber("123");
        event.setChange(change);
        PatchSet patch = new PatchSet();
        patch.setNumber("1");
        event.setPatchset(patch);
        String expResult = StringUtil.REFSPEC_PREFIX + "23/123/1";
View Full Code Here

     * test.
     */
    @Test
    public void testMakeRefSpec4() {
        PatchsetCreated event = new PatchsetCreated();
        Change change = new Change();
        change.setNumber("2131");
        event.setChange(change);
        PatchSet patch = new PatchSet();
        patch.setNumber("1");
        event.setPatchset(patch);
        String expResult = StringUtil.REFSPEC_PREFIX + "31/2131/1";
View Full Code Here

        JSONObject jsonAccount = new JSONObject();
        jsonAccount.put(EMAIL, "robert.sandell@sonyericsson.com");
        jsonAccount.put(NAME, "Bobby");

        Change changeWithQuotes = prepareChangeObjForMockTest("project", "branch", "I2343434344",
                "100", stringWithQuotes, "commitMessage", jsonAccount, "http://localhost:8080");
        Change changeWithoutQuotes = prepareChangeObjForMockTest("project", "branch", "I2343434344",
                "100", stringWithoutQuotes, "commitMessage", jsonAccount, "http://localhost:8080");

        PatchsetCreated eventWithQuotes = preparePatchsetCreatedObjForMockTest(changeWithQuotes,
                new PatchSet(patch), GerritEventType.PATCHSET_CREATED);
        PatchsetCreated eventWithoutQuotes = preparePatchsetCreatedObjForMockTest(changeWithoutQuotes,
View Full Code Here

        JSONObject jsonAccount = new JSONObject();
        jsonAccount.put(EMAIL, "robert.sandell@sonyericsson.com");
        jsonAccount.put(NAME, "Bobby");

        Change changeWithQuotes = prepareChangeObjForMockTest("project", "branch", "I2343434344",
                "100", stringWithQuotes, "commitMessage", jsonAccount, "http://localhost:8080");
        Change changeWithoutQuotes = prepareChangeObjForMockTest("project", "branch", "I2343434344",
                "100", stringWithoutQuotes, "commitMessage", jsonAccount, "http://localhost:8080");

        PatchsetCreated eventWithQuotes = preparePatchsetCreatedObjForMockTest(changeWithQuotes,
                new PatchSet(patch), GerritEventType.PATCHSET_CREATED);
        PatchsetCreated eventWithoutQuotes = preparePatchsetCreatedObjForMockTest(changeWithoutQuotes,
View Full Code Here

        JSONObject jsonAccount = new JSONObject();
        jsonAccount.put(EMAIL, "robert.sandell@sonyericsson.com");
        jsonAccount.put(NAME, "Bobby");

        Change change = prepareChangeObjForMockTest("project", "branch", "I2343434344",
                "100", "Subject", stringReadable, jsonAccount, "http://localhost:8080");

        PatchsetCreated event = preparePatchsetCreatedObjForMockTest(change,
                new PatchSet(patch), GerritEventType.PATCHSET_CREATED);
        //mock the returned url
View Full Code Here

        JSONObject jsonAccount = new JSONObject();
        jsonAccount.put(EMAIL, "robert.sandell@sonyericsson.com");
        jsonAccount.put(NAME, "Bobby");

        Change change = prepareChangeObjForMockTest("project", "branch", "I2343434344",
                "100", "Subject", stringReadable, jsonAccount, "http://localhost:8080");

        PatchsetCreated event = preparePatchsetCreatedObjForMockTest(change,
                new PatchSet(patch), GerritEventType.PATCHSET_CREATED);
View Full Code Here

            String number,
            String subject,
            String commitMessage,
            JSONObject jsonAccount,
            String url) {
        Change change = PowerMockito.mock(Change.class);
        doReturn(project).when(change).getProject();
        doReturn(branch).when(change).getBranch();
        doReturn(id).when(change).getId();
        doReturn(number).when(change).getNumber();
        when(change.getSubject()).thenReturn(subject);
        doReturn(commitMessage).when(change).getCommitMessage();
        doReturn(new Account(jsonAccount)).when(change).getOwner();
        doReturn(url).when(change).getUrl();
        return change;
    }
View Full Code Here

     * @param ref The ref
     * @return a pactchsetCreated event
     */
    public static PatchsetCreated createPatchsetCreated(String serverName, String project, String ref) {
        PatchsetCreated event = new PatchsetCreated();
        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");
        patch.setRef(ref);
View Full Code Here

TOP

Related Classes of com.sonymobile.tools.gerrit.gerritevents.dto.attr.Change

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.