Package org.eclipse.jgit.junit.http
Class SimpleHttpServer
- java.lang.Object
-
- org.eclipse.jgit.junit.http.SimpleHttpServer
-
public class SimpleHttpServer extends java.lang.Object
Simple 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 URIish
getSecureUri()
Get thesecureUri
.URIish
getUri()
Get theuri
.private static java.lang.String
nameOf(Repository db)
private org.eclipse.jetty.servlet.ServletContextHandler
smart(java.lang.String path)
void
start()
Start the servervoid
stop()
Stop the server.private URIish
toURIish(java.lang.String path)
private URIish
toURIish(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.Exception
Start the server- Throws:
java.lang.Exception
-
stop
public void stop() throws java.lang.Exception
Stop 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
-
-