Package org.eclipse.egit.github.core.client

Examples of org.eclipse.egit.github.core.client.GitHubClient


   * @throws Exception
   */
  @Test
  public void validUserNameAndPassword() throws Exception {
    TestMojo mojo = new TestMojo();
    GitHubClient client = mojo.createClient(null, "a", "b", null, null,
        null, null);
    assertNotNull(client);
    assertEquals("a", mojo.user.get());
    assertEquals("b", mojo.password.get());
    assertNull(mojo.token.get());
View Full Code Here


   * @throws Exception
   */
  @Test
  public void validOAuth2Token() throws Exception {
    TestMojo mojo = new TestMojo();
    GitHubClient client = mojo.createClient(null, null, null, "token",
        null, null, null);
    assertNotNull(client);
    assertNull(mojo.user.get());
    assertNull(mojo.password.get());
    assertEquals(mojo.token.get(), "token");
View Full Code Here

   * @throws Exception
   */
  @Test
  public void validOAuth2TokenWithUsername() throws Exception {
    TestMojo mojo = new TestMojo();
    GitHubClient client = mojo.createClient(null, "a", null, "token", null,
        null, null);
    assertNotNull(client);
    assertNull(mojo.user.get());
    assertNull(mojo.password.get());
    assertEquals(mojo.token.get(), "token");
View Full Code Here

    Server server = new Server();
    server.setId("server");
    server.setUsername("a");
    server.setPassword("b");
    settings.addServer(server);
    GitHubClient client = mojo.createClient(null, null, null, null,
        "server", settings, null);
    assertNotNull(client);
    assertEquals("a", mojo.user.get());
    assertEquals("b", mojo.password.get());
    assertNull(mojo.token.get());
View Full Code Here

    Settings settings = new Settings();
    Server server = new Server();
    server.setId("server");
    server.setPassword("b");
    settings.addServer(server);
    GitHubClient client = mojo.createClient(null, null, null, null,
        "server", settings, null);
    assertNotNull(client);
    assertNull(mojo.user.get());
    assertNull(mojo.password.get());
    assertEquals("b", mojo.token.get());
View Full Code Here

      catch ( ContextException ce )
      {
        ce.printStackTrace( System.err );
      }

      return new GitHubClient() {
        public GitHubClient setCredentials(String user, String password) {
          TestMojo.this.user.set(user);
          TestMojo.this.password.set(password);
          return super.setCredentials(user, password);
        }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void validHostname() throws Exception {
    TestMojo mojo = new TestMojo();
    GitHubClient client = mojo.createClient("h", "a", "b", null, null,
        null, null);
    assertNotNull(client);
    assertEquals("h", mojo.host.get());
  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void nullHostname() throws Exception {
    TestMojo mojo = new TestMojo();
    GitHubClient client = mojo.createClient(null, "a", "b", null, null,
        null, null);
    assertNotNull(client);
    assertNull(mojo.host.get());
  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void emptyHost() throws Exception {
    TestMojo mojo = new TestMojo();
    GitHubClient client = mojo.createClient("", "a", "b", null, null, null,
        null);
    assertNotNull(client);
    assertNull(mojo.host.get());
  }
View Full Code Here

   */
  protected GitHubClient createClient(String host, String userName,
      String password, String oauth2Token, String serverId,
      Settings settings, MavenSession session)
      throws MojoExecutionException {
    GitHubClient client;
    if (!StringUtils.isEmpty(host)) {
      if (isDebug())
        debug("Using custom host: " + host);
      client = createClient(host);
    } else
View Full Code Here

TOP

Related Classes of org.eclipse.egit.github.core.client.GitHubClient

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.