@Override public Repository getRepository(final String id, final Map<String, String> env) { return getRepository(credentials, id, env); }
public GitHub(final GitCredentials credentials, final ConfigProperties configProperties) { this.id = toHex("GitHub"); this.name = "GitHub"; this.credentials = credentials; this.configProperties = configProperties; }
@Test public void hello() throws Exception { final GitHub gitHub = new GitHub(); final GitRepository repository = (GitRepository) gitHub.getRepository("salaboy/drools-workshop", new HashMap<String, String>() {{ put("out-dir", tempPath.getAbsolutePath()); }}); final Source source = repository.getSource("master"); assertNotNull(source); } }
@Test public void buildAppAndWaitForMavenOutputTest() throws IOException { final GitHub gitHub = new GitHub(); gitHub.getRepository("salaboy/drools-workshop", new HashMap<String, String>() {
@Test public void repositoryVisitorDiffDeletedTest() throws IOException { final GitHub gitHub = new GitHub(); final GitRepository repository = (GitRepository) gitHub.getRepository("mbarkley/appformer-playground", new HashMap<String, String>() {
GitHub github = GitHub.connectUsingPassword("Username","Password"); github.getRepository("Repository name");
@Test @InSequence(2) public void waitForAppBuildTest() { final GitHub gitHub = new GitHub(); final GitRepository repository = (GitRepository) gitHub.getRepository("salaboy/drools-workshop", new HashMap<String, String>() {
@Override public Repository getRepository(final String id) { return getRepository(id, Collections.emptyMap()); }
Properties props = new Properties(); props.setProperty("login", "somebody@somewhere.com"); props.setProperty("password", "YourGithubPassword"); GitHub gitHub = GitHubBuilder.fromProperties(props).build(); GHRepository repository = gitHub.getRepository("your/repo"); Calendar cal = Calendar.getInstance(); cal.set(2014, 0, 4); Date since = cal.getTime(); cal.set(2014, 0, 14); Date until = cal.getTime(); GHCommitQueryBuilder queryBuilder = repository.queryCommits().since(since).until(until); PagedIterable<GHCommit> commits = queryBuilder.list(); Iterator<GHCommit> iterator = commits.iterator(); while (iterator.hasNext()) { GHCommit commit = iterator.next(); System.out.println("Commit: " + commit.getSHA1() + ", info: " + commit.getCommitShortInfo().getMessage() + ", author: " + commit.getAuthor()); }