Top Description Fields Constructors Methods
org.eclipse.jgit.junit.http

public abstract Class HttpTestCase

extends LocalDiskRepositoryTestCase
Class Inheritance
Static Imports
org.junit.Assert.fail

Base class for HTTP related transport testing.

Field Summary

Modifier and TypeField and Description
protected static final String
master

Constant master="Constants.R_HEADS + Constants.MASTER"

protected AppServer
server

In-memory application server; subclass must start.

Inherited from org.eclipse.jgit.junit.LocalDiskRepositoryTestCase:
ASSUME_UNCHANGEDauthorcommitterCONTENTCONTENT_IDcurrentTestLENGTHmockSystemReaderMOD_TIMESMUDGEtestRoot

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod 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 org.eclipse.jgit.junit.http.AppServer#getPort() method.

protected TestRepository<Repository>

Returns:

the TestRepository
createTestRepository
()

Create TestRepository

protected static URIish

Returns:

the extended URIish
extendPath
(URIish
the URI
uri
,
String
path components
pathComponents
)

Extend a path

protected static void
fsck(Repository
the repository
db
,
RevObject...
tips to start checking from
tips
)

Run fsck

protected List<AccessEvent>

Returns:

list of events
getRequests
()

Get requests.

protected List<AccessEvent>

Returns:

list of events
getRequests
(URIish
base URI
base
,
String
the request path relative to base
path
)

Get requests.

protected List<AccessEvent>

Returns:

list of events
getRequests
(String
request path
path
)

Get requests.

public static String

Returns:

the joined path
join
(URIish
base URI
base
,
String
a relative path
path
)

Join a base URIish and a path

public static String

Returns:

path of the loose object
loose
(URIish
base URI
base
,
AnyObjectId
objectId
id
)

Create loose object path

protected static Set<RefSpec>

Returns:

set of RefSpecs
mirror
(String...
the refs
refs
)

Mirror refs

protected static Collection<RemoteRefUpdate>

Returns:

collection of RefUpdates
push
(TestRepository<R extends Repository>
repository from which to push
from
,
RevCommit
commit to push
q
)

Push a commit

protected static String

Returns:

the rewritten url
rewriteUrl
(String
the URL
url
,
String
new protocol
newProtocol
,
int
new port
newPort
)

Rewrite a url

public void
public void
protected URIish

Returns:

the URIish
toURIish
(String
the path
path
)

Convert path to URIish

protected URIish

Returns:

the warnings (if any) from the last execution
toURIish
(ServletContextHandler
app name
app
,
String
context path name
name
)

Convert a path relative to the app's context path to a URIish

Inherited from org.eclipse.jgit.junit.LocalDiskRepositoryTestCase:
addRepoToClosecreateBareRepositorycreateRepositorycreateRepositorycreateTempDirectorycreateTempFilecreateUniqueTestGitDircreateWorkRepositorygetCeilingsgetTemporaryDirectoryindexStatereadrecursiveDeleterunHooktickwritewrite

Field Detail

masterback to summary
protected static final String master

Constant master="Constants.R_HEADS + Constants.MASTER"

serverback to summary
protected AppServer server

In-memory application server; subclass must start.

Constructor Detail

HttpTestCaseback to summary
public HttpTestCase()

Method Detail

createServerback to summary
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 org.eclipse.jgit.junit.http.AppServer#getPort() method. Subclasses may override if they need a more specialized server.

Returns:AppServer

the org.eclipse.jgit.junit.http.AppServer.

Since
4.9
createTestRepositoryback to summary
protected TestRepository<Repository> createTestRepository() throws IOException

Create TestRepository

Returns:TestRepository<Repository>

the TestRepository

Exceptions
IOException:
if an IO error occurred
extendPathback to summary
protected static URIish extendPath(URIish uri, String pathComponents) throws URISyntaxException

Extend a path

Parameters
uri:URIish

the URI

pathComponents:String

path components

Returns:URIish

the extended URIish

Exceptions
URISyntaxException:
if URI is invalid
fsckback to summary
protected static void fsck(Repository db, RevObject... tips) throws Exception

Run fsck

Parameters
db:Repository

the repository

tips:RevObject[]

tips to start checking from

Exceptions
Exception:
if an error occurred
getRequestsback to summary
protected List<AccessEvent> getRequests()

Get requests.

Returns:List<AccessEvent>

list of events

getRequestsback to summary
protected List<AccessEvent> getRequests(URIish base, String path)

Get requests.

Parameters
base:URIish

base URI

path:String

the request path relative to base

Returns:List<AccessEvent>

list of events

getRequestsback to summary
protected List<AccessEvent> getRequests(String path)

Get requests.

Parameters
path:String

request path

Returns:List<AccessEvent>

list of events

joinback to summary
public static String join(URIish base, String path)

Join a base URIish and a path

Parameters
base:URIish

base URI

path:String

a relative path

Returns:String

the joined path

looseback to summary
public static String loose(URIish base, AnyObjectId id)

Create loose object path

Parameters
base:URIish

base URI

id:AnyObjectId

objectId

Returns:String

path of the loose object

mirrorback to summary
protected static Set<RefSpec> mirror(String... refs)

Mirror refs

Parameters
refs:String[]

the refs

Returns:Set<RefSpec>

set of RefSpecs

pushback to summary
protected static Collection<RemoteRefUpdate> push(TestRepository<R extends Repository> from, RevCommit q) throws IOException

Push a commit

Parameters
from:TestRepository<R extends Repository>

repository from which to push

q:RevCommit

commit to push

Returns:Collection<RemoteRefUpdate>

collection of RefUpdates

Exceptions
IOException:
if an IO error occurred
rewriteUrlback to summary
protected static String rewriteUrl(String url, String newProtocol, int newPort)

Rewrite a url

Parameters
url:String

the URL

newProtocol:String

new protocol

newPort:int

new port

Returns:String

the rewritten url

setUpback to summary
public void setUp() throws Exception

Overrides org.eclipse.jgit.junit.LocalDiskRepositoryTestCase.setUp.

Doc from org.eclipse.jgit.junit.LocalDiskRepositoryTestCase.setUp.

Setup test

Annotations
@Override
Exceptions
Exception:
if an error occurred
tearDownback to summary
public void tearDown() throws Exception

Overrides org.eclipse.jgit.junit.LocalDiskRepositoryTestCase.tearDown.

Doc from org.eclipse.jgit.junit.LocalDiskRepositoryTestCase.tearDown.

Tear down the test

Annotations
@Override
Exceptions
Exception:
if an error occurred
toURIishback to summary
protected URIish toURIish(String path) throws URISyntaxException

Convert path to URIish

Parameters
path:String

the path

Returns:URIish

the URIish

Exceptions
URISyntaxException:
if URI is invalid
toURIishback to summary
protected URIish toURIish(ServletContextHandler app, String name) throws URISyntaxException

Convert a path relative to the app's context path to a URIish

Parameters
app:ServletContextHandler

app name

name:String

context path name

Returns:URIish

the warnings (if any) from the last execution

Exceptions
URISyntaxException:
if URI is invalid
Since
7.0