aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2021-10-19 09:32:20 +0200
committerThomas Wolf <thomas.wolf@paranor.ch>2021-10-19 09:32:20 +0200
commitf698fbf919c67edac4b3999cc932c1f22da1dffd (patch)
treee10ebcf3dfa2cd58aa99245b311b84431c581b83 /org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse
parentf8b0c00e6a8f5628babff6dd37254a21589b6e44 (diff)
downloadjgit-f698fbf919c67edac4b3999cc932c1f22da1dffd.tar.gz
jgit-f698fbf919c67edac4b3999cc932c1f22da1dffd.zip
JSch: fix service publication for ServiceLoader
The file name in META-INF/services must be the fully qualified interface name; the content the fully qualified implementation class name. This was broken in commit 9683bc71. Add a test for the default factory being found by the ServiceLoader. Change-Id: I1f180d7f60e5c1e74a39bbd9a5f0099bd8343e21 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse')
-rw-r--r--org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/ServiceLoaderTest.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/ServiceLoaderTest.java b/org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/ServiceLoaderTest.java
new file mode 100644
index 0000000000..2bae221e29
--- /dev/null
+++ b/org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/ServiceLoaderTest.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2021, Thomas Wolf <thomas.wolf@paranor.ch> and others
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0 which is available at
+ * https://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+package org.eclipse.jgit.transport.ssh.jsch;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.eclipse.jgit.transport.SshSessionFactory;
+import org.junit.Test;
+
+public class ServiceLoaderTest {
+
+ @Test
+ public void testDefaultFactoryFound() {
+ SshSessionFactory defaultFactory = SshSessionFactory.getInstance();
+ assertNotNull(defaultFactory);
+ }
+}