From 784d388c497efcb4a9b004cf9c97efed14719dd7 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Fri, 8 Oct 2010 01:03:17 +0300 Subject: Externalize strings in TransportHttp Some strings were not externalized. Also use them in HTTP tests to ensure that they will also succeed when message bundles are translated. Change-Id: Id02717176557e7d57e676e1339cd89f2be88d330 Signed-off-by: Matthias Sohn --- .../tst/org/eclipse/jgit/http/test/HttpClientTests.java | 9 +++++---- .../org/eclipse/jgit/http/test/SmartClientSmartServerTest.java | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'org.eclipse.jgit.http.test/tst') diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java index 9c4b3ee09d..06a4eb6a73 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java @@ -52,6 +52,7 @@ import javax.servlet.http.HttpServletRequest; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; +import org.eclipse.jgit.JGitText; import org.eclipse.jgit.errors.NoRemoteRepositoryException; import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.errors.TransportException; @@ -280,8 +281,8 @@ public class HttpClientTests extends HttpTestCase { t.openFetch(); fail("connection opened even info/refs needs auth basic"); } catch (TransportException err) { - String status = "authentication not supported"; - String exp = dumbAuthBasicURI + ": " + status; + String exp = dumbAuthBasicURI + ": " + + JGitText.get().authenticationNotSupported; assertEquals(exp, err.getMessage()); } } finally { @@ -297,8 +298,8 @@ public class HttpClientTests extends HttpTestCase { t.openFetch(); fail("connection opened even though service disabled"); } catch (TransportException err) { - String status = "authentication not supported"; - String exp = smartAuthBasicURI + ": " + status; + String exp = smartAuthBasicURI + ": " + + JGitText.get().authenticationNotSupported; assertEquals(exp, err.getMessage()); } } finally { diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java index 87e2555a6c..6f06f1f9a7 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java @@ -66,6 +66,7 @@ import org.eclipse.jetty.servlet.FilterHolder; import org.eclipse.jetty.servlet.FilterMapping; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; +import org.eclipse.jgit.JGitText; import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.errors.TransportException; import org.eclipse.jgit.http.server.GitServlet; @@ -398,8 +399,8 @@ public class SmartClientSmartServerTest extends HttpTestCase { t.push(NullProgressMonitor.INSTANCE, Collections.singleton(u)); fail("anonymous push incorrectly accepted without error"); } catch (TransportException e) { - final String status = "authentication not supported"; - final String exp = remoteURI.toString() + ": " + status; + final String exp = remoteURI + ": " + + JGitText.get().authenticationNotSupported; assertEquals(exp, e.getMessage()); } } finally { -- cgit v1.2.3