Package org.eclipse.jgit.junit.http
Class SimpleHttpServer
- java.lang.Object
-
- org.eclipse.jgit.junit.http.SimpleHttpServer
-
public class SimpleHttpServer extends java.lang.ObjectSimple http server for testing http access to Git repositories. Authentication with hardcoded credentials user:agitter password:letmein.
-
-
Constructor Summary
Constructors Constructor Description SimpleHttpServer(Repository repository)Constructor forSimpleHttpServer.SimpleHttpServer(Repository repository, boolean withSsl)Constructor forSimpleHttpServer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description URIishgetSecureUri()Get thesecureUri.URIishgetUri()Get theuri.private static java.lang.StringnameOf(Repository db)private org.eclipse.jetty.servlet.ServletContextHandlersmart(java.lang.String path)voidstart()Start the servervoidstop()Stop the server.private URIishtoURIish(java.lang.String path)private URIishtoURIish(org.eclipse.jetty.servlet.ServletContextHandler app, java.lang.String name)
-
-
-
Field Detail
-
server
AppServer server
-
db
private final Repository db
-
uri
private URIish uri
-
secureUri
private URIish secureUri
-
-
Constructor Detail
-
SimpleHttpServer
public SimpleHttpServer(Repository repository)
Constructor forSimpleHttpServer.- Parameters:
repository-
-
SimpleHttpServer
public SimpleHttpServer(Repository repository, boolean withSsl)
Constructor forSimpleHttpServer.- Parameters:
repository-withSsl-
-
-
Method Detail
-
start
public void start() throws java.lang.ExceptionStart the server- Throws:
java.lang.Exception
-
stop
public void stop() throws java.lang.ExceptionStop the server.- Throws:
java.lang.Exception
-
getUri
public URIish getUri()
Get theuri.- Returns:
- the uri
-
getSecureUri
public URIish getSecureUri()
Get thesecureUri.- Returns:
- the secure uri
-
smart
private org.eclipse.jetty.servlet.ServletContextHandler smart(java.lang.String path)
-
nameOf
private static java.lang.String nameOf(Repository db)
-
toURIish
private URIish toURIish(java.lang.String path) throws java.net.URISyntaxException
- Throws:
java.net.URISyntaxException
-
toURIish
private URIish toURIish(org.eclipse.jetty.servlet.ServletContextHandler app, java.lang.String name) throws java.net.URISyntaxException
- Throws:
java.net.URISyntaxException
-
-