Interface RepositoryFixture
-
- All Known Implementing Classes:
JackrabbitRepositoryFixture
,OakRepositoryFixture
public interface RepositoryFixture
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isAvailable(int n)
Checks whether this fixture is currently available.Repository[]
setUpCluster(int n)
Creates a new repository cluster with the given number of nodes.void
syncRepositoryCluster(Repository... nodes)
Ensures that all content changes seen by one of the given cluster nodes are seen also by all the other given nodes.void
tearDownCluster()
Releases resources associated with the given repository cluster.
-
-
-
Method Detail
-
isAvailable
boolean isAvailable(int n)
Checks whether this fixture is currently available. For example a database-based fixture would only be available when the underlying database service is running.- Parameters:
n
- size of the requested cluster- Returns:
true
iff the fixture is available
-
setUpCluster
Repository[] setUpCluster(int n) throws Exception
Creates a new repository cluster with the given number of nodes. The initial state of the cluster consists of just the default repository content included by the implementation. The caller of this method should have exclusive access to the created cluster. The caller is also responsible for callingtearDownCluster()
when the test cluster is no longer needed.- Parameters:
n
- size of the requested cluster- Returns:
- nodes of the created cluster
- Throws:
Exception
- if the cluster could not be set up
-
syncRepositoryCluster
void syncRepositoryCluster(Repository... nodes)
Ensures that all content changes seen by one of the given cluster nodes are seen also by all the other given nodes. Used to help testing features like eventual consistency where the normal APIs don't make strong enough guarantees to enable writing a test case without a potentially unbounded wait for changes to propagate across the cluster.- Parameters:
nodes
- cluster nodes to be synchronized
-
tearDownCluster
void tearDownCluster()
Releases resources associated with the given repository cluster. The caller ofsetUpCluster(int)
shall call this method once the cluster is no longer needed.
-
-