public class GetPrincipalTest extends GetAuthorizableByIdTest
Constructor and Description |
---|
GetPrincipalTest(int numberOfUsers,
boolean flatStructure) |
Modifier and Type | Method and Description |
---|---|
protected void |
addBackgroundJob(Runnable job)
Adds a background thread that repeatedly executes the given job
until all the iterations of this test have been executed.
|
protected void |
afterTest() |
protected void |
beforeTest() |
long |
execute()
Executes a single iteration of this test.
|
protected void |
failOnRepositoryVersions(String... versions) |
protected javax.jcr.Credentials |
getCredentials() |
protected javax.jcr.Repository |
getRepository() |
protected static int |
getScale(int def) |
protected javax.jcr.Session |
login(javax.jcr.Credentials credentials)
Returns a new session for the given user
that will be automatically closed once
all the iterations of this test have been executed.
|
protected javax.jcr.Session |
loginAnonymous()
Returns a new reader session that will be automatically closed once
all the iterations of this test have been executed.
|
protected javax.jcr.Session |
loginWriter()
Returns a new writer session that will be automatically closed once
all the iterations of this test have been executed.
|
protected void |
logout(javax.jcr.Session session)
Logs out and removes the session from the internal pool.
|
void |
run(Iterable<RepositoryFixture> fixtures)
Runs this benchmark against all the given repository fixtures.
|
void |
run(Iterable<RepositoryFixture> fixtures,
List<Integer> concurrencyLevels) |
protected void |
runTest() |
void |
setPrintStream(PrintStream out) |
void |
setUp(javax.jcr.Repository repository,
javax.jcr.Credentials credentials)
Prepares this performance benchmark.
|
void |
tearDown()
Cleans up after this performance benchmark.
|
afterSuite, beforeSuite, getUserId
public GetPrincipalTest(int numberOfUsers, boolean flatStructure)
protected void runTest() throws Exception
runTest
in class GetAuthorizableByIdTest
Exception
public void setPrintStream(PrintStream out)
setPrintStream
in interface CSVResultGenerator
protected static int getScale(int def)
public void setUp(javax.jcr.Repository repository, javax.jcr.Credentials credentials) throws Exception
repository
- the repository to usecredentials
- credentials of a user with write accessException
- if the benchmark can not be preparedpublic void run(Iterable<RepositoryFixture> fixtures)
Benchmark
public void run(Iterable<RepositoryFixture> fixtures, List<Integer> concurrencyLevels)
public long execute() throws Exception
Exception
- if an error occurspublic void tearDown() throws Exception
Exception
- if the benchmark can not be cleaned upprotected void failOnRepositoryVersions(String... versions) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected javax.jcr.Repository getRepository()
protected javax.jcr.Credentials getCredentials()
protected javax.jcr.Session loginAnonymous()
protected javax.jcr.Session login(javax.jcr.Credentials credentials)
credentials
- the user credentialsprotected void logout(javax.jcr.Session session)
session
- the session to logoutprotected javax.jcr.Session loginWriter()
protected void addBackgroundJob(Runnable job)
job
- background jobCopyright © 2012-2015 The Apache Software Foundation. All Rights Reserved.