Package org.eclipse.jgit.transport.OpenSshConfig

Examples of org.eclipse.jgit.transport.OpenSshConfig.Host


    fw.close();
  }

  @Test
  public void testNoConfig() {
    final Host h = osc.lookup("repo.or.cz");
    assertNotNull(h);
    assertEquals("repo.or.cz", h.getHostName());
    assertEquals("jex_junit", h.getUser());
    assertEquals(22, h.getPort());
    assertEquals(1, h.getConnectionAttempts());
    assertNull(h.getIdentityFile());
  }
View Full Code Here


  }

  @Test
  public void testAlias_DoesNotMatch() throws Exception {
    config("Host orcz\n" + "\tHostName repo.or.cz\n");
    final Host h = osc.lookup("repo.or.cz");
    assertNotNull(h);
    assertEquals("repo.or.cz", h.getHostName());
    assertEquals("jex_junit", h.getUser());
    assertEquals(22, h.getPort());
    assertNull(h.getIdentityFile());
  }
View Full Code Here

  @Test
  public void testAlias_OptionsSet() throws Exception {
    config("Host orcz\n" + "\tHostName repo.or.cz\n" + "\tPort 2222\n"
        + "\tUser jex\n" + "\tIdentityFile .ssh/id_jex\n"
        + "\tForwardX11 no\n");
    final Host h = osc.lookup("orcz");
    assertNotNull(h);
    assertEquals("repo.or.cz", h.getHostName());
    assertEquals("jex", h.getUser());
    assertEquals(2222, h.getPort());
    assertEquals(new File(home, ".ssh/id_jex"), h.getIdentityFile());
  }
View Full Code Here

  @Test
  public void testAlias_OptionsKeywordCaseInsensitive() throws Exception {
    config("hOsT orcz\n" + "\thOsTnAmE repo.or.cz\n" + "\tPORT 2222\n"
        + "\tuser jex\n" + "\tidentityfile .ssh/id_jex\n"
        + "\tForwardX11 no\n");
    final Host h = osc.lookup("orcz");
    assertNotNull(h);
    assertEquals("repo.or.cz", h.getHostName());
    assertEquals("jex", h.getUser());
    assertEquals(2222, h.getPort());
    assertEquals(new File(home, ".ssh/id_jex"), h.getIdentityFile());
  }
View Full Code Here

  public void testAlias_OptionsInherit() throws Exception {
    config("Host orcz\n" + "\tHostName repo.or.cz\n" + "\n" + "Host *\n"
        + "\tHostName not.a.host.example.com\n" + "\tPort 2222\n"
        + "\tUser jex\n" + "\tIdentityFile .ssh/id_jex\n"
        + "\tForwardX11 no\n");
    final Host h = osc.lookup("orcz");
    assertNotNull(h);
    assertEquals("repo.or.cz", h.getHostName());
    assertEquals("jex", h.getUser());
    assertEquals(2222, h.getPort());
    assertEquals(new File(home, ".ssh/id_jex"), h.getIdentityFile());
  }
View Full Code Here

    assertEquals(new File(home, ".ssh/id_jex"), h.getIdentityFile());
  }

  @Test
  public void testAlias_PreferredAuthenticationsDefault() throws Exception {
    final Host h = osc.lookup("orcz");
    assertNotNull(h);
    assertNull(h.getPreferredAuthentications());
  }
View Full Code Here

  }

  @Test
  public void testAlias_PreferredAuthentications() throws Exception {
    config("Host orcz\n" + "\tPreferredAuthentications publickey\n");
    final Host h = osc.lookup("orcz");
    assertNotNull(h);
    assertEquals("publickey", h.getPreferredAuthentications());
  }
View Full Code Here

  @Test
  public void testAlias_InheritPreferredAuthentications() throws Exception {
    config("Host orcz\n" + "\tHostName repo.or.cz\n" + "\n" + "Host *\n"
        + "\tPreferredAuthentications publickey, hostbased\n");
    final Host h = osc.lookup("orcz");
    assertNotNull(h);
    assertEquals("publickey,hostbased", h.getPreferredAuthentications());
  }
View Full Code Here

    assertEquals("publickey,hostbased", h.getPreferredAuthentications());
  }

  @Test
  public void testAlias_BatchModeDefault() throws Exception {
    final Host h = osc.lookup("orcz");
    assertNotNull(h);
    assertFalse(h.isBatchMode());
  }
View Full Code Here

  }

  @Test
  public void testAlias_BatchModeYes() throws Exception {
    config("Host orcz\n" + "\tBatchMode yes\n");
    final Host h = osc.lookup("orcz");
    assertNotNull(h);
    assertTrue(h.isBatchMode());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.transport.OpenSshConfig.Host

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.