Class HttpTestCase
java.lang.Object
org.eclipse.jgit.junit.LocalDiskRepositoryTestCase
org.eclipse.jgit.junit.http.HttpTestCase
Base class for HTTP related transport testing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringConstantmaster="Constants.R_HEADS + Constants.MASTER"protected AppServerIn-memory application server; subclass must start.Fields inherited from class LocalDiskRepositoryTestCase
ASSUME_UNCHANGED, author, committer, CONTENT, CONTENT_ID, LENGTH, mockSystemReader, MOD_TIME, SMUDGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AppServerCreate theAppServer.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 itsAppServer.getPort()method.protected TestRepository<Repository> Create TestRepositoryprotected static URIishextendPath(URIish uri, String pathComponents) Extend a pathprotected static voidfsck(Repository db, RevObject... tips) Run fsckprotected List<AccessEvent> Get requests.protected List<AccessEvent> getRequests(String path) Get requests.protected List<AccessEvent> getRequests(URIish base, String path) Get requests.static StringJoin a base URIish and a pathstatic Stringloose(URIish base, AnyObjectId id) Create loose object pathMirror refsprotected static Collection<RemoteRefUpdate> push(TestRepository from, RevCommit q) Push a commitprotected static StringrewriteUrl(String url, String newProtocol, int newPort) Rewrite a urlvoidsetUp()Setup testvoidtearDown()Tear down the testprotected URIishConvert path to URIishprotected URIishConvert a path relative to the app's context path to a URIishMethods inherited from class LocalDiskRepositoryTestCase
addRepoToClose, createBareRepository, createRepository, createRepository, createTempDirectory, createTempFile, createUniqueTestGitDir, createWorkRepository, getCeilings, getTemporaryDirectory, indexState, read, recursiveDelete, runHook, tick, write, write
-
Field Details
-
master
Constantmaster="Constants.R_HEADS + Constants.MASTER"- See Also:
-
server
In-memory application server; subclass must start.
-
-
Constructor Details
-
HttpTestCase
public HttpTestCase()
-
-
Method Details
-
setUp
Setup test- Overrides:
setUpin classLocalDiskRepositoryTestCase- Throws:
Exception
-
tearDown
Tear down the test- Overrides:
tearDownin classLocalDiskRepositoryTestCase- Throws:
Exception
-
createServer
Create theAppServer.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 itsAppServer.getPort()method. Subclasses may override if they need a more specialized server.- Returns:
- the
AppServer. - Since:
- 4.9
-
createTestRepository
Create TestRepository- Returns:
- the TestRepository
- Throws:
IOException
-
toURIish
Convert path to URIish- Parameters:
path-- Returns:
- the URIish
- Throws:
URISyntaxException
-
toURIish
protected URIish toURIish(org.eclipse.jetty.servlet.ServletContextHandler app, String name) throws URISyntaxException Convert a path relative to the app's context path to a URIish- Parameters:
app-name-- Returns:
- the warnings (if any) from the last execution
- Throws:
URISyntaxException
-
getRequests
-
getRequests
Get requests.- Parameters:
base-path-- Returns:
- list of events
-
getRequests
Get requests.- Parameters:
path-- Returns:
- list of events
-
fsck
Run fsck- Parameters:
db-tips-- Throws:
Exception
-
mirror
-
push
protected static Collection<RemoteRefUpdate> push(TestRepository from, RevCommit q) throws IOException Push a commit- Parameters:
from-q-- Returns:
- collection of RefUpdates
- Throws:
IOException
-
loose
Create loose object path- Parameters:
base-id-- Returns:
- path of the loose object
-
join
-
rewriteUrl
-
extendPath
Extend a path- Parameters:
uri-pathComponents-- Returns:
- the extended URIish
- Throws:
URISyntaxException
-