mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
Fix integration tests by delegating to existing servlets
This commit is contained in:
@@ -42,6 +42,7 @@ import sonia.scm.repository.HgRepositoryHandler;
|
||||
import sonia.scm.repository.Repository;
|
||||
import sonia.scm.repository.api.Command;
|
||||
import sonia.scm.repository.api.ScmProtocol;
|
||||
import sonia.scm.web.HgCGIServlet;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -275,8 +276,7 @@ public class HgRepositoryServiceProvider extends RepositoryServiceProvider
|
||||
|
||||
@Override
|
||||
public Set<ScmProtocol> getSupportedProtocols() {
|
||||
// TODO #9248
|
||||
return Collections.emptySet();
|
||||
return Collections.singleton(new HgCGIServlet(null, null, null, null, null, null));
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
@@ -51,6 +51,7 @@ import sonia.scm.repository.HgRepositoryHandler;
|
||||
import sonia.scm.repository.Repository;
|
||||
import sonia.scm.repository.RepositoryProvider;
|
||||
import sonia.scm.repository.RepositoryRequestListenerUtil;
|
||||
import sonia.scm.repository.spi.HttpScmProtocol;
|
||||
import sonia.scm.security.CipherUtil;
|
||||
import sonia.scm.util.AssertUtil;
|
||||
import sonia.scm.util.HttpUtil;
|
||||
@@ -63,8 +64,10 @@ import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.util.Base64;
|
||||
import java.util.Enumeration;
|
||||
|
||||
@@ -75,7 +78,7 @@ import java.util.Enumeration;
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
@Singleton
|
||||
public class HgCGIServlet extends HttpServlet
|
||||
public class HgCGIServlet extends HttpServlet implements HttpScmProtocol
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
@@ -359,6 +362,16 @@ public class HgCGIServlet extends HttpServlet
|
||||
return python;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serve(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
service(request, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUrl(Repository repository, UriInfo uriInfo) {
|
||||
return uriInfo.getBaseUri().resolve(URI.create("../../hg/" + repository.getNamespace() + "/" + repository.getName())).toASCIIString();
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
|
||||
Reference in New Issue
Block a user