Package org.eclipse.egit.github.core

Examples of org.eclipse.egit.github.core.User


    public class MockPullRequestProcessor implements Processor {
        @Override
        public void process(Exchange exchange) throws Exception {
            Message in = exchange.getIn();
            PullRequest pullRequest = (PullRequest) in.getBody();
            User pullRequestUser = pullRequest.getUser();

            pullRequest.getTitle();
            pullRequest.getHtmlUrl();
            pullRequest.getUser().getLogin();
            pullRequest.getUser().getHtmlUrl();
            LOG.debug("Got PullRequest " + pullRequest.getHtmlUrl() + " [" + pullRequest.getTitle() + "] From " + pullRequestUser.getLogin());
        }
View Full Code Here


    public class GitHubCommitProcessor implements Processor {
        @Override
        public void process(Exchange exchange) throws Exception {
            Message in = exchange.getIn();
            RepositoryCommit commit = (RepositoryCommit) in.getBody();
            User author = commit.getAuthor();
            log.debug("Got commit with author: " + author.getLogin() + ": " + author.getHtmlUrl() + " SHA " + commit.getSha());
        }
View Full Code Here

    private List<RepositoryCommit> commitsList = new ArrayList<RepositoryCommit>();
    private AtomicLong fakeSha = new AtomicLong(System.currentTimeMillis());

    public synchronized RepositoryCommit addRepositoryCommit() {
        User author = new User();
        author.setEmail("someguy@gmail.com");       // TODO change
        author.setHtmlUrl("http://github/someguy");
        author.setLogin("someguy");

        RepositoryCommit rc = new RepositoryCommit();
        rc.setAuthor(author);
        rc.setSha(fakeSha.incrementAndGet() + "");
        LOG.debug("In MockCommitService added commit with sha " + rc.getSha());
View Full Code Here

            return emptyComments;
        }
    }

    private User createAuthor() {
        User author = new User();
        author.setEmail("someguy@gmail.com");
        author.setHtmlUrl("http://github/someguy");
        author.setLogin("someguy");

        return author;
    }
View Full Code Here

    }

    public CommitComment addComment(Long pullRequestId, String bodyText) {
        CommitComment commitComment = new CommitComment();

        User author = createAuthor();
        commitComment.setUser(author);
        commitComment.setCommitId("" + pullRequestId);
        commitComment.setId(commentId.getAndIncrement());
        commitComment.setBody(bodyText);
        commitComment.setBodyText(bodyText);
View Full Code Here

        return commitComment;
    }

    public PullRequest addPullRequest(String title) {
        User author = createAuthor();

        PullRequest pullRequest = new PullRequest();
        pullRequest.setUser(author);
        pullRequest.setHtmlUrl("https://github.com/someguy/somerepo/pull" + pullRequestNumber);
        pullRequest.setTitle(title);
View Full Code Here

    commit.setMessage(message);
    commit.setTree(tree);

        try {
            UserService userService = new UserService(service.getClient());
            User user = userService.getUser();

            CommitUser author = new CommitUser();
            author.setName(user.getName());
            author.setEmail(user.getEmail());
            author.setDate(new GregorianCalendar().getTime());

            commit.setAuthor(author);
            commit.setCommitter(author);
        } catch (IOException e) {
View Full Code Here

    private void minerCollaborators(List<User> collaborators) {
        EntityRepository repository = dao.findByID(repositoryToMinerId, EntityRepository.class);
        int i = 0;
        calculeSubProgress(i, collaborators.size());
        while (!canceled && i < collaborators.size()) {
            User gitCollab = collaborators.get(i);
            EntityUser colab = minerCollaborator(gitCollab);
            colab.addCollaboratedRepository(repository);
            dao.edit(colab);
            i++;
            calculeSubProgress(i, collaborators.size());
View Full Code Here

    private void minerWatchers(List<User> watchers) {
        EntityRepository repository = dao.findByID(repositoryToMinerId, EntityRepository.class);
        int i = 0;
        calculeSubProgress(i, watchers.size());
        while (!canceled && i < watchers.size()) {
            User gitWatcher = watchers.get(i);
            EntityUser watcher = minerWatcher(gitWatcher);
            watcher.addWatchedRepository(repository);
            dao.edit(watcher);
            i++;
            calculeSubProgress(i, watchers.size());
View Full Code Here

        return user;
    }

    public static User getGitUserByLogin(String login) {
        User user = null;
        try {
            user = new UserService(AuthServices.getGitHubClient()).getUser(login);
        } catch (Exception ex) {
            ex.printStackTrace();
            System.out.println("Erro ao consultar usuário \"" + login + "\": " + ex.toString());
View Full Code Here

TOP

Related Classes of org.eclipse.egit.github.core.User

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.