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>
This commit is contained in:
Thomas Wolf 2021-10-19 09:32:20 +02:00
parent f8b0c00e6a
commit f698fbf919
2 changed files with 24 additions and 0 deletions

View File

@ -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);
}
}