Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.URIish


      throw new IllegalArgumentException(NLS.bind(
          CoreText.ProjectReference_InvalidTokensCount, new Object[] {
              4, tokens.length, tokens }));

    this.version = tokens[0];
    this.repository = new URIish(tokens[1]);
    if (!"".equals(tokens[2])) //$NON-NLS-1$
      this.branch = tokens[2];
    this.projectDir = tokens[3];
  }
View Full Code Here


    secureStoreForTest.flush();
  }

  @Test
  public void testPutUserAndPassword() throws Exception {
    URIish uri = new URIish("http://testRepo.example.com/testrepo");
    UserPasswordCredentials credentials = new UserPasswordCredentials(
        "agitter", "letmein");
    store.putCredentials(uri, credentials);

    ISecurePreferences node = secureStoreForTest.node(EGitSecureStore
View Full Code Here

    assertEquals("letmein", node.get("password", null));
  }

  @Test
  public void testGetUserAndPassword() throws Exception {
    URIish uri = new URIish("http://testRepo.example.com/testrepo");
    UserPasswordCredentials credentials = new UserPasswordCredentials(
        "agitter", "letmein");
    store.putCredentials(uri, credentials);

    UserPasswordCredentials storedCredentials = store.getCredentials(uri);
View Full Code Here

    assertEquals("letmein", storedCredentials.getPassword());
  }

  @Test
  public void testGetUserAndPasswordUnknownURI() throws Exception {
    URIish uri = new URIish("http://testRepo.example.com/testrepo");

    UserPasswordCredentials storedCredentials = store.getCredentials(uri);
    assertNull(storedCredentials);
  }
View Full Code Here

  }

  @Test
  public void testPutUserAndPasswordURIContainingUserAndPass()
      throws Exception {
    URIish uri = new URIish(
        "http://user:pass@testRepo.example.com/testrepo");
    UserPasswordCredentials credentials = new UserPasswordCredentials(
        "agitter", "letmein");
    store.putCredentials(uri, credentials);
View Full Code Here

  @Test
  public void testGetUserAndPasswordURIContainingUserAndPass()
      throws Exception {
    store.putCredentials(
        new URIish("http://testRepo.example.com/testrepo"),
        new UserPasswordCredentials("agitter", "letmein"));
    UserPasswordCredentials credentials = store.getCredentials(new URIish(
        "http://agitter:letmein@testRepo.example.com/testrepo"));
    assertEquals("agitter", credentials.getUser());
    assertEquals("letmein", credentials.getPassword());
  }
View Full Code Here

  @Test
  public void testGetUserAndPasswordURIContainingOtherUserAndPass()
      throws Exception {
    store.putCredentials(
        new URIish("http://testRepo.example.com/testrepo"),
        new UserPasswordCredentials("agitter", "letmein"));
    assertNull(store.getCredentials(new URIish(
        "http://otheruser:otherpass@testRepo.example.com/testrepo")));
  }
View Full Code Here

        "http://otheruser:otherpass@testRepo.example.com/testrepo")));
  }

  @Test
  public void testClearCredentials() throws Exception {
    URIish uri = new URIish("http://testRepo.example.com/testrepo");
    UserPasswordCredentials credentials = new UserPasswordCredentials(
        "agitter", "letmein");
    store.putCredentials(uri, credentials);
    store.clearCredentials(uri);
    assertEquals(null, store.getCredentials(uri));
View Full Code Here

    assertEquals(null, store.getCredentials(uri));
  }

  @Test
  public void testEnsureDefaultPortHttp() throws Exception {
    URIish uri = new URIish("http://testRepo.example.com/testrepo");
    UserPasswordCredentials credentials = new UserPasswordCredentials(
        "agitter", "letmein");
    store.putCredentials(uri, credentials);
    URIish uri2 = new URIish("http://testRepo.example.com:80/testrepo");
    assertEquals(credentials.getUser(), store.getCredentials(uri2).getUser());
    assertEquals(credentials.getPassword(), store.getCredentials(uri2).getPassword());
  }
View Full Code Here

    assertEquals(credentials.getPassword(), store.getCredentials(uri2).getPassword());
  }

  @Test
  public void testEnsureDefaultPortHttps() throws Exception {
    URIish uri = new URIish("https://testRepo.example.com/testrepo");
    UserPasswordCredentials credentials = new UserPasswordCredentials(
        "agitter", "letmein");
    store.putCredentials(uri, credentials);
    URIish uri2 = new URIish("https://testRepo.example.com:443/testrepo");
    assertEquals(credentials.getUser(), store.getCredentials(uri2).getUser());
    assertEquals(credentials.getPassword(), store.getCredentials(uri2).getPassword());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.transport.URIish

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.