public class TestConflictResolution extends TestCase2
Write-write conflicts either result in successful reconcilation via state-based conflict resolution or an abort of the transaction that is validating. The tests in this suite verify that write-write conflicts can be detected and provide versions of those tests where the conflict can and can not be validated and verify the end state in each case.
State-based validation requires transparency at the object level, including the ability to deserialize versions into objects, to compare objects for consistency, to merge data into the most recent version where possible and according to data type specific rules, and to destructively merge objects when the conflict arises on identity rather than state.
An example of an identity based conflict is when two objects are created that represent URIs in an RDF graph. Since the lexicon for an RDF graph generally requires uniqueness those objects must be merged into a single object since they have the same identity. For an RDFS store validation on the lexicon or statements ALWAYS succeeds since they are always consistent.
Modifier and Type | Class and Description |
---|---|
static class |
TestConflictResolution.SingleValueConflictResolver
Helper class used to resolve a predicted conflict to a known value.
|
TestCase2.MyProperties, TestCase2.RandomType
_randomType, log
Constructor and Description |
---|
TestConflictResolution() |
TestConflictResolution(String name) |
Modifier and Type | Method and Description |
---|---|
Properties |
getProperties()
Reads in the configuration properties for the test from a
variety of resources and returns a properties hierarchy.
|
void |
test_writeWriteConflict_conflictIsResolved()
Test correct detection and resolution of a write-write conflict.
|
void |
test_writeWriteConflict_correctDetection()
Test correct detection of a write-write conflict.
|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsWithinUlps, assertSameArray, assertSameArray, assertSameBigDecimal, assertSameBigDecimal, assertSameBigInteger, assertSameBigInteger, assertSameIterator, assertSameIterator, assertSameIteratorAnyOrder, assertSameIteratorAnyOrder, assertSameValue, assertSameValue, assertZeroUlps, assertZeroUlps, fail, getInnerCause, getNormalInt, getProjectBuildPath, getRandomObject, getRandomObject, getRandomOrder, getRandomString, getTestInputStream, getTestResource, getTestResource, getUlps, getUlps, isDEBUG, isDEBUG, isINFO, isINFO, isInnerCause, logProperties
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
public TestConflictResolution()
public TestConflictResolution(String name)
name
- public Properties getProperties()
TestCase2
Properties
object, then the lower levels of the
hierarchy are recursively searched.The hierarchy is constructed from the following properties files in the following order. The first property file in this list corresponds to the top of the property hierarchy. The last property file in this list corresponds to the bottom of the property hierarchy. The property resources are:
getProperties
in class TestCase2
Properties
object that supplies bindings for
property names according to the described hierarchy among
property resources. The returned Properties
is NOT
cached.
TODO This does not handle the recursive truncation of the
class name to search for "test.properties" yet.public void test_writeWriteConflict_correctDetection()
ValidationError
is reported.public void test_writeWriteConflict_conflictIsResolved()
IConflictResolver
and the journal is
committed. Two transactions (tx1, tx2) are then started. Both
transactions write a value under the same key. tx1 prepares and commits.
tx2 attempts to prepare, and the test verifies that the conflict resolver
is invoked, that it may resolve the conflict causing validation to
succeed and that the value determined by conflict resolution is made
persistent when tx2 commits.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.