Package org.fcrepo.integration.http.api
Class TransactionsIT
- java.lang.Object
-
- org.fcrepo.integration.http.api.AbstractResourceIT
-
- org.fcrepo.integration.http.api.TransactionsIT
-
@TestExecutionListeners(listeners=TestIsolationExecutionListener.class, mergeMode=MERGE_WITH_DEFAULTS) public class TransactionsIT extends AbstractResourceIT
TransactionsIT class.
- Author:
- awoods
-
-
Field Summary
Fields Modifier and Type Field Description static longREAP_INTERVALstatic PatternTX_ID_PATTERN-
Fields inherited from class org.fcrepo.integration.http.api.AbstractResourceIT
authPropsConfig, BASIC_CONTAINER_LINK_HEADER, client, containerWrapper, DCTITLE, DIRECT_CONTAINER_LINK_HEADER, logger, NON_RDF_SOURCE_LINK_HEADER, propsConfig, serverAddress
-
-
Constructor Summary
Constructors Constructor Description TransactionsIT()
-
Method Summary
-
Methods inherited from class org.fcrepo.integration.http.api.AbstractResourceIT
addTxTo, assertConstrainedByPresent, assertDeleted, assertNoLinkHeader, assertNotDeleted, assertNotFound, checkForLinkHeader, confirmResponseBodyNTriplesAreEqual, createClient, createClient, createDatastream, createDatastream, createObject, createObject, createObjectAndClose, createObjectAndClose, createTransaction, decodeDigestHeader, deleteObjMethod, execute, executeAndClose, executeWithBasicAuth, getBean, getBean, getContentLocation, getContentType, getContentType, getDataset, getDataset, getDSDescMethod, getDSMethod, getEtag, getEtag, getEtag, getExternalContentLinkHeader, getHeader, getLinkHeaders, getLinkHeaders, getLocation, getLocation, getModel, getModel, getModel, getModel, getObjMethod, getOriginalResourceUri, getRandomUniqueId, getStatus, getStatus, getTTLThatUpdatesServerManagedTriples, headerValues, headObjMethod, patchObjMethod, postObjMethod, postObjMethod, preferLink, putDSMethod, putDSMethod, putObjMethod, putObjMethod, restartContainer, setDescriptionProperty, setLogger, setProperty, setProperty, streamModel
-
-
-
-
Field Detail
-
REAP_INTERVAL
public static final long REAP_INTERVAL
- See Also:
- Constant Field Values
-
TX_ID_PATTERN
public static final Pattern TX_ID_PATTERN
-
-
Constructor Detail
-
TransactionsIT
public TransactionsIT()
-
-
Method Detail
-
setup
public void setup()
-
after
public void after()
-
testRootHasTxEndpoint
public void testRootHasTxEndpoint() throws Exception
- Throws:
Exception
-
testCreateTransaction
public void testCreateTransaction() throws IOException
- Throws:
IOException
-
testRequestsInTransactionThatDoestExist
public void testRequestsInTransactionThatDoestExist()
-
testCreateAndTimeoutTransaction
public void testCreateAndTimeoutTransaction() throws IOException, InterruptedException
- Throws:
IOExceptionInterruptedException
-
testCreateDoStuffAndRollbackTransaction
public void testCreateDoStuffAndRollbackTransaction() throws IOException
- Throws:
IOException
-
rejectPutWhenIfMatchDoesNotMatch
public void rejectPutWhenIfMatchDoesNotMatch() throws IOException
- Throws:
IOException
-
allowPutWhenIfMatchMatches
public void allowPutWhenIfMatchMatches() throws IOException
- Throws:
IOException
-
testRollbackShouldNotLeaveDbInPartiallyUpdatedState
public void testRollbackShouldNotLeaveDbInPartiallyUpdatedState() throws IOException
- Throws:
IOException
-
conflictingContainmentOverwritesObjectModifiedInTransactionRdf
public void conflictingContainmentOverwritesObjectModifiedInTransactionRdf() throws IOException
- Throws:
IOException
-
conflictingContainmentOverwritesObjectModifiedInTransactionBinary
public void conflictingContainmentOverwritesObjectModifiedInTransactionBinary() throws IOException
- Throws:
IOException
-
rollbackFailsWhenAutoVersioningNotUsedAndFailureInOcflCommit
public void rollbackFailsWhenAutoVersioningNotUsedAndFailureInOcflCommit() throws IOException
- Throws:
IOException
-
rollbackSucceedsWhenAutoVersioningUsedAndFailureInOcflCommit
public void rollbackSucceedsWhenAutoVersioningUsedAndFailureInOcflCommit() throws IOException
- Throws:
IOException
-
testTransactionKeepAlive
public void testTransactionKeepAlive() throws IOException
- Throws:
IOException
-
testCreateDoStuffAndCommitTransaction
public void testCreateDoStuffAndCommitTransaction() throws IOException
- Throws:
IOException
-
transactionShouldNotBeAbleToBeCommittedWhenARequestFails
public void transactionShouldNotBeAbleToBeCommittedWhenARequestFails() throws IOException
- Throws:
IOException
-
testIngestNewWithSparqlPatchWithinTransaction
public void testIngestNewWithSparqlPatchWithinTransaction() throws IOException
Tests whether a Sparql update is visible within a transaction and if the update is made persistent along with the commit.- Throws:
IOException- exception thrown during this function
-
testGetNonExistingObject
public void testGetNonExistingObject() throws IOException
- Throws:
IOException
-
testCachingHeadersDuringTransaction
public void testCachingHeadersDuringTransaction() throws IOException
- Throws:
IOException
-
testHeadAndDeleteInTransaction
public void testHeadAndDeleteInTransaction() throws Exception
Test for issue https://jira.duraspace.org/browse/FCREPO-2975- Throws:
Exception- exception thrown during this function
-
testTransactionAndConcurrentConflictingUpdate
public void testTransactionAndConcurrentConflictingUpdate() throws IOException
Tests that transactions are treated as atomic with regards to nodes. A common use case for applications written against fedora is that an operation checks some property of a fedora object and acts on it accordingly. In order for this to work in a multi-client or multi-threaded environment that comparison+action combination needs to be atomic. Imagine a scenario where we have one process that deletes all objects in the repository that don't have a "preserve" property set to the literal "true", and we have any number of other clients that add such a property. We want to ensure that there is no way for a client to successfully add this property between when the "deleter" process has determined that no such property exists and when it deletes the object. In other words, if there are only clients adding properties and the "deleter" deleting objects it should not be possible for an object to be deleted if a client has added a title and received a successful http response code.- Throws:
IOException- exception thrown during this function
-
testRequestResourceInvalidTx
public void testRequestResourceInvalidTx() throws Exception
- Throws:
Exception
-
testRequestWithBareTxUuid
public void testRequestWithBareTxUuid() throws Exception
- Throws:
Exception
-
testRequestWitMadeUpTxUuid
public void testRequestWitMadeUpTxUuid() throws Exception
- Throws:
Exception
-
testCreateAndDeleteInSingleTransaction
public void testCreateAndDeleteInSingleTransaction() throws Exception
Test creating and deleting an object in a single transaction.- Throws:
Exception- http client might throw an exception.
-
testCreateAndDeleteInSingleTransactionSubPathFull
public void testCreateAndDeleteInSingleTransactionSubPathFull() throws Exception
Test creating an AG and child container in a transaction and deleting the child container.- Throws:
Exception- http client might throw an exception.
-
testCreateAndDeleteInSingleTransactionSubPathPartial
public void testCreateAndDeleteInSingleTransactionSubPathPartial() throws Exception
Test creating an AG. Then create a child container and delete it in the same transaction.- Throws:
Exception- http client might throw an exception.
-
lockAgResourceInTxWhenAgPartIsUpdated
public void lockAgResourceInTxWhenAgPartIsUpdated() throws Exception
- Throws:
Exception
-
lockBothBinaryAndDescWhenEitherIsUpdatedInTx
public void lockBothBinaryAndDescWhenEitherIsUpdatedInTx() throws Exception
- Throws:
Exception
-
concurrentSparqlUpdatesShouldNotBeAllowed
public void concurrentSparqlUpdatesShouldNotBeAllowed() throws Exception
- Throws:
Exception
-
testDeleteAndRecreateInTransaction
public void testDeleteAndRecreateInTransaction() throws Exception
- Throws:
Exception
-
-