diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2014-06-21 01:28:55 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2014-06-21 01:28:55 +0200 |
commit | 64dde09b8524a92230bacd93b2bb86e4ceab741f (patch) | |
tree | d6d601cae52e68c317469969f44f9069f7161445 /org.eclipse.jgit.test | |
parent | 79792c59b663072820c442d0a2d34a9c5de27cf9 (diff) | |
parent | 7865d7100e2a5f9d02f6679daada0c64ae14935f (diff) | |
download | jgit-64dde09b8524a92230bacd93b2bb86e4ceab741f.tar.gz jgit-64dde09b8524a92230bacd93b2bb86e4ceab741f.zip |
Merge branch 'stable-3.4'
* stable-3.4:
Prepare 3.4.2-SNAPSHOT builds
JGit v3.4.1.201406201815-r
Allow retrying connecting SshSession in case of an exception
Change-Id: I7efb009b9e012637a16c57e2e93e074023b8e46c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java index 5836db1e60..8ec39bf56d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, Google Inc. + * Copyright (C) 2008, 2014 Google Inc. * and other copyright owners as documented in the project's IP log. * * This program and the accompanying materials are made available @@ -96,6 +96,7 @@ public class OpenSshConfigTest extends RepositoryTestCase { assertEquals("repo.or.cz", h.getHostName()); assertEquals("jex_junit", h.getUser()); assertEquals(22, h.getPort()); + assertEquals(1, h.getConnectionAttempts()); assertNull(h.getIdentityFile()); } @@ -249,4 +250,35 @@ public class OpenSshConfigTest extends RepositoryTestCase { assertNotNull(h); assertTrue(h.isBatchMode()); } + + @Test + public void testAlias_ConnectionAttemptsDefault() throws Exception { + final Host h = osc.lookup("orcz"); + assertNotNull(h); + assertEquals(1, h.getConnectionAttempts()); + } + + @Test + public void testAlias_ConnectionAttempts() throws Exception { + config("Host orcz\n" + "\tConnectionAttempts 5\n"); + final Host h = osc.lookup("orcz"); + assertNotNull(h); + assertEquals(5, h.getConnectionAttempts()); + } + + @Test + public void testAlias_invalidConnectionAttempts() throws Exception { + config("Host orcz\n" + "\tConnectionAttempts -1\n"); + final Host h = osc.lookup("orcz"); + assertNotNull(h); + assertEquals(1, h.getConnectionAttempts()); + } + + @Test + public void testAlias_badConnectionAttempts() throws Exception { + config("Host orcz\n" + "\tConnectionAttempts xxx\n"); + final Host h = osc.lookup("orcz"); + assertNotNull(h); + assertEquals(1, h.getConnectionAttempts()); + } } |