Package models

Examples of models.PushedBranch


        // Given
        initParameters("yobi", "HelloSocialApp", 1L);
        User currentUser = User.findByLoginId("admin");
        Project project = Project.findByOwnerAndProjectName(ownerLoginId, projectName);
        PullRequest pullRequest = PullRequest.findOne(project, pullRequestNumber);
        PushedBranch pushedBranch = new PushedBranch(new Date(), pullRequest.fromBranch,
                pullRequest.fromProject);
        pushedBranch.save();

        // When
        Result result = callAction(
                controllers.routes.ref.PullRequestApp.open(ownerLoginId, projectName, pullRequestNumber),
                fakeRequest("GET", "/" + ownerLoginId + "/" + projectName + "/pullRequest/" + pullRequestNumber)
View Full Code Here


        }
    }

    private void saveRecentlyPushedBranch(Set<String> pushedBranches) {
        for (String branch : pushedBranches) {
            PushedBranch pushedBranch = PushedBranch.find.where()
                            .eq("project", project).eq("name", branch).findUnique();

            if (pushedBranch != null) {
                pushedBranch.pushedDate = JodaDateUtil.now();
                pushedBranch.update();
            }

            if (isNotExistsPushedBranch(branch, pushedBranch) && isNotTag(branch)) {
                pushedBranch = new PushedBranch(JodaDateUtil.now(), branch, project);
                pushedBranch.save();
            }
        }
    }
View Full Code Here

        return pushedBranch == null && PullRequest.findByFromProjectAndBranch(project, branch).isEmpty();
    }

    private void deletePushedBranch(Set<String> deletedBranches) {
        for (String branch : deletedBranches) {
            PushedBranch pushedBranch = PushedBranch.find.where().eq("project", project)
                    .eq("name", branch).findUnique();
            if (pushedBranch != null) {
                pushedBranch.delete();
            }
        }
    }
View Full Code Here

TOP

Related Classes of models.PushedBranch

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.