public abstract class HttpTestCase extends LocalDiskRepositoryTestCase
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
master
Constant
master="Constants.R_HEADS + Constants.MASTER" |
protected AppServer |
server
In-memory application server; subclass must start.
|
ASSUME_UNCHANGED, author, committer, CONTENT, CONTENT_ID, LENGTH, mockSystemReader, MOD_TIME, SMUDGE
Constructor and Description |
---|
HttpTestCase() |
Modifier and Type | Method and Description |
---|---|
protected AppServer |
createServer()
Create the
AppServer .This default implementation creates a server
without SSLsupport listening for HTTP connections on a dynamically chosen
port, which can be gotten once the server has been started via its
AppServer.getPort() method. |
protected TestRepository<Repository> |
createTestRepository()
Create TestRepository
|
protected static URIish |
extendPath(URIish uri,
java.lang.String pathComponents)
Extend a path
|
protected static void |
fsck(Repository db,
RevObject... tips)
Run fsck
|
protected java.util.List<AccessEvent> |
getRequests()
Get requests.
|
protected java.util.List<AccessEvent> |
getRequests(java.lang.String path)
Get requests.
|
protected java.util.List<AccessEvent> |
getRequests(URIish base,
java.lang.String path)
Get requests.
|
static java.lang.String |
join(URIish base,
java.lang.String path)
Join a base URIish and a path
|
static java.lang.String |
loose(URIish base,
AnyObjectId id)
Create loose object path
|
protected static java.util.Set<RefSpec> |
mirror(java.lang.String... refs)
Mirror refs
|
protected static java.util.Collection<RemoteRefUpdate> |
push(TestRepository from,
RevCommit q)
Push a commit
|
protected static java.lang.String |
rewriteUrl(java.lang.String url,
java.lang.String newProtocol,
int newPort)
Rewrite a url
|
void |
setUp()
Setup test
|
void |
tearDown()
Tear down the test
|
protected URIish |
toURIish(org.eclipse.jetty.servlet.ServletContextHandler app,
java.lang.String name)
Convert a path relative to the app's context path to a URIish
|
protected URIish |
toURIish(java.lang.String path)
Convert path to URIish
|
addRepoToClose, createBareRepository, createRepository, createRepository, createTempDirectory, createTempFile, createUniqueTestGitDir, createWorkRepository, getCeilings, getTemporaryDirectory, indexState, read, recursiveDelete, runHook, tick, write, write
protected static final java.lang.String master
master="Constants.R_HEADS + Constants.MASTER"
protected AppServer server
public void setUp() throws java.lang.Exception
setUp
in class LocalDiskRepositoryTestCase
java.lang.Exception
public void tearDown() throws java.lang.Exception
tearDown
in class LocalDiskRepositoryTestCase
java.lang.Exception
protected AppServer createServer()
AppServer
.This default implementation creates a server
without SSLsupport listening for HTTP connections on a dynamically chosen
port, which can be gotten once the server has been started via its
AppServer.getPort()
method.
Subclasses may override if they need a more specialized server.AppServer
.protected TestRepository<Repository> createTestRepository() throws java.io.IOException
java.io.IOException
protected URIish toURIish(java.lang.String path) throws java.net.URISyntaxException
path
- java.net.URISyntaxException
protected URIish toURIish(org.eclipse.jetty.servlet.ServletContextHandler app, java.lang.String name) throws java.net.URISyntaxException
app
- name
- java.net.URISyntaxException
protected java.util.List<AccessEvent> getRequests()
protected java.util.List<AccessEvent> getRequests(URIish base, java.lang.String path)
base
- path
- protected java.util.List<AccessEvent> getRequests(java.lang.String path)
path
- protected static void fsck(Repository db, RevObject... tips) throws java.lang.Exception
db
- tips
- java.lang.Exception
protected static java.util.Set<RefSpec> mirror(java.lang.String... refs)
refs
- protected static java.util.Collection<RemoteRefUpdate> push(TestRepository from, RevCommit q) throws java.io.IOException
from
- q
- java.io.IOException
public static java.lang.String loose(URIish base, AnyObjectId id)
base
- id
- public static java.lang.String join(URIish base, java.lang.String path)
base
- path
- a relative pathprotected static java.lang.String rewriteUrl(java.lang.String url, java.lang.String newProtocol, int newPort)
url
- newProtocol
- newPort
-