Package org.eclipse.jgit.junit.http
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 String
Constantmaster="Constants.R_HEADS + Constants.MASTER"
protected AppServer
In-memory application server; subclass must start.Fields inherited from class org.eclipse.jgit.junit.LocalDiskRepositoryTestCase
ASSUME_UNCHANGED, author, committer, CONTENT, CONTENT_ID, LENGTH, mockSystemReader, MOD_TIME, SMUDGE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AppServer
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.protected TestRepository
<Repository> Create TestRepositoryprotected static URIish
extendPath
(URIish uri, String pathComponents) Extend a pathprotected static void
fsck
(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 String
Join a base URIish and a pathstatic String
loose
(URIish base, AnyObjectId id) Create loose object pathMirror refsprotected static Collection
<RemoteRefUpdate> push
(TestRepository from, RevCommit q) Push a commitprotected static String
rewriteUrl
(String url, String newProtocol, int newPort) Rewrite a urlvoid
setUp()
Setup testvoid
tearDown()
Tear down the testprotected URIish
Convert path to URIishprotected URIish
Convert a path relative to the app's context path to a URIishMethods inherited from class org.eclipse.jgit.junit.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:
setUp
in classLocalDiskRepositoryTestCase
- Throws:
Exception
-
tearDown
Tear down the test- Overrides:
tearDown
in 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
Get requests.- Returns:
- list of events
-
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
Mirror refs- Parameters:
refs
-- Returns:
- set of RefSpecs
-
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
Join a base URIish and a path- Parameters:
base
-path
- a relative path- Returns:
- the joined path
-
rewriteUrl
Rewrite a url- Parameters:
url
-newProtocol
-newPort
-- Returns:
- the rewritten url
-
extendPath
Extend a path- Parameters:
uri
-pathComponents
-- Returns:
- the extended URIish
- Throws:
URISyntaxException
-