ModifyConflictTest.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
* Portions Copyright 2011-2015 ForgeRock AS
*/
/**
* Test the conflict resolution for modify operations As a consequence,
* this will also test the Historical.java Class This is still a work in
* progress. currently implemented tests - check that an replace with a
* smaller csn is ignored should test : - conflict with multi-valued
* attributes - conflict with single-valued attributes - conflict with
* options - conflict with binary attributes - Replace, add, delete
* attribute, delete attribute value - conflict on the objectclass
* attribute.
* Added tests for multiple mods on same attribute in the same modify operation.
*/
@SuppressWarnings("javadoc")
public class ModifyConflictTest extends ReplicationTestCase
{
/**
* Test that conflict between a modify-replace and modify-add for
* multi-valued attributes are handled correctly.
*/
@Test
public void replaceAndAdd() throws Exception
{
// load historical from the entry
":000000000000000a000000000000:repl:init value");
// simulate a modify-replace done at time t10
/*
* Now simulate an add at an earlier date that the previous replace
* conflict resolution should remove it.
*/
/*
* Now simulate an add at an earlier date that the previous replace
* conflict resolution should remove it. (a second time to make
* sure...)
*/
/*
* Now simulate an add at a later date that the previous replace.
* conflict resolution should keep it
*/
":000000000000000a000000000000:repl:init value",
":000000000000000b000000000000:add:new value");
}
/**
* Test that conflict between a modify-replace and modify-add for
* single-valued attributes are handled correctly.
*/
@Test
public void replaceAndAddSingle() throws Exception
{
// load historical from the entry
":000000000000000a000000000000:repl:init value");
// simulate a modify-replace done at time t10
/*
* Now simulate an add at an earlier date that the previous replace
* conflict resolution should remove it.
*/
/*
* Now simulate an add at an earlier date that the previous replace
* conflict resolution should remove it. (a second time to make
* sure...)
*/
/*
* Now simulate an add at a later date that the previous replace.
* conflict resolution should remove it
*/
}
/**
* Test that replace with null value is correctly seen as a delete
* by doing first a replace with null, then add at at previous time
* then check that the add was ignored
*/
@Test
public void replaceWithNull() throws Exception
{
// load historical from the entry
":0000000000000003000000000000:attrDel");
// simulate a replace with null done at time t3
/*
* Now simulate an add at an earlier date that the previous replace. The
* conflict resolution should detect that this add must be ignored.
*/
/*
* Now simulate an add at an earlier date that the previous delete. The
* conflict resolution should detect that this add must be ignored. (a
* second time to make sure that historical information is kept...)
*/
/*
* Now simulate an add at a later date that the previous delete.
* conflict resolution should keep it
*/
":0000000000000004000000000000:add:new value",
":0000000000000003000000000000:attrDel");
}
/**
* Test that conflict between modify-add and modify-replace for
* multi-valued attributes are handled correctly.
*/
@Test
public void addAndReplace() throws Exception
{
// load historical from the entry
// simulate a modify-add done at time t10
":000000000000000a000000000000:add:init value");
/*
* Now simulate a replace at an earlier date that the previous replace
* conflict resolution should keep it.
*/
":000000000000000a000000000000:add:init value",
":0000000000000001000000000000:repl:older value");
/*
* Now simulate a replace at an earlier date that the previous replace
* conflict resolution should remove it. (a second time to make
* sure...)
*/
":000000000000000a000000000000:add:init value",
":0000000000000002000000000000:repl:older value");
/*
* Now simulate a replace at a later date that the previous replace.
* conflict resolution should keep it
*/
":000000000000000b000000000000:repl:new value");
}
/**
* Test that conflict between modify-add and modify-replace for
* single-valued attributes are handled correctly.
*/
@Test
public void addAndReplaceSingle() throws Exception
{
// load historical from the entry
// simulate a modify-add done at time 2
":0000000000000002000000000000:add:init value");
/*
* Now simulate a replace at an earlier date that the previous replace
* conflict resolution should keep it.
*/
":0000000000000001000000000000:repl:older value");
/*
* Now simulate a replace at a later date.
* Conflict resolution should keep it.
*/
":0000000000000003000000000000:repl:newer value");
}
/**
* Test that conflict between a modify-delete-attribute and modify-add
* for multi-valued attributes are handled correctly.
*/
@Test
public void deleteAndAdd() throws Exception
{
// load historical from the entry
":000000000000000a000000000000:attrDel");
// simulate a delete of the whole description attribute done at time t10
/*
* Now simulate an add at an earlier date that the previous delete. The
* conflict resolution should detect that this add must be ignored.
*/
/*
* Now simulate an add at an earlier date that the previous delete. The
* conflict resolution should detect that this add must be ignored. (a
* second time to make sure that historical information is kept...)
*/
/*
* Now simulate an add at a later date that the previous delete.
* conflict resolution should keep it
*/
":000000000000000b000000000000:add:new value",
":000000000000000a000000000000:attrDel");
}
/**
* Test that conflict between a delete-attribute value and
* add attribute-values from 2 different servers are handled correctly.
* This test was created to reproduce issue 3392.
*/
@Test
public void delValueAndAddValue() throws Exception
{
// create an entry to use with conflicts tests.
// Create description with values value1 and value2 and add
// this attribute to the entry.
// load historical from the entry
// simulate a delete of the description attribute value "value1" done at time t1
":0000000000000001000000000000:del:value1");
// Now simulate an add of "value3" at time t2
":0000000000000001000000000000:del:value1",
":0000000000000002000000000000:add:value3");
// Now simulate a delete of value "value1" at time t3
":0000000000000002000000000000:add:value3",
":0000000000000003000000000000:del:value1");
// Now simulate an add of "value4" at time t4
":0000000000000002000000000000:add:value3",
":0000000000000003000000000000:del:value1",
":0000000000000004000000000000:add:value4");
}
/**
* Test that conflict between several delete-attribute value and
* are handled correctly.
* This test was created to reproduce and fix issue 3397.
*/
@Test
public void delValueAndDelValue() throws Exception
{
// create an entry to use with conflicts tests.
// Create an attribute with values value1, value2, value3 and value4 and
// add this attribute to the entry.
// load historical from the entry
/*
* simulate a delete of the description attribute values
* "value1" and "value2" done at time t1
*/
":0000000000000001000000000000:del:value1",
":0000000000000001000000000000:del:value2");
/*
* simulate a delete of the description attribute values
* "value2" and "value3" done at time t1
*/
":0000000000000001000000000000:del:value1",
":0000000000000002000000000000:del:value2",
":0000000000000002000000000000:del:value3");
}
/**
* Test that conflict between a delete attribute and a delete
* value on a single valued attribute works correctly.
* This test was created to reproduce and fix issue 3399.
*/
@Test
public void delAttributeAndDelValueSingle() throws Exception
{
// create an entry to use with conflicts tests.
// Create a single valued attribute with value : "value1"
// add this attribute to the entry.
// load historical from the entry
// simulate a delete of attribute employeenumber.
":0000000000000001000000000000:attrDel");
// now simulate a delete of value "value1"
":0000000000000002000000000000:attrDel");
}
/**
* Test that conflict between a delete attribute and a delete
* value on a single valued attribute works correctly.
* This test was created to reproduce and fix issue 3399.
*/
@Test
public void delValueAndDelAttributeSingle() throws Exception
{
// create an entry to use with conflicts tests.
// Create a single valued attribute with value : "value1"
// add this attribute to the entry.
// load historical from the entry
// now simulate a delete of value "value1"
":0000000000000001000000000000:attrDel");
// simulate a delete of attribute employeenumber.
":0000000000000002000000000000:attrDel");
}
/**
* Test that conflict between a delete-attribute value and
* add attribute-values from 2 different servers
* and replayed in the non-natural order are handled correctly.
* This test was created to reproduce issue 3392.
*/
@Test
public void delValueAndAddValueDisordered() throws Exception
{
// create an entry to use with conflicts tests.
// Create description with values value1 and value2 and add
// this attribute to the entry.
// load historical from the entry
/*
* simulate a delete of the description attribute value "value1"
* done at time t3
*/
":0000000000000003000000000000:del:value1");
// Now simulate an add of "value3" at time t4
":0000000000000003000000000000:del:value1",
":0000000000000004000000000000:add:value3");
// Now simulate a delete of value "value1" at time t1
":0000000000000003000000000000:del:value1",
":0000000000000004000000000000:add:value3");
// Now simulate an add of "value4" at time t2
":0000000000000003000000000000:del:value1",
":0000000000000004000000000000:add:value3",
":0000000000000002000000000000:add:value4");
}
/**
* Test that conflict between a modify-delete-attribute and modify-add
* for multi-valued attributes are handled correctly.
*/
@Test
public void deleteAndAddSingle() throws Exception
{
// Create a single valued attribute with value : "value1"
// add this attribute to the entry.
":0000000000000003000000000000:attrDel");
// load historical from the entry
// simulate a delete of the whole description attribute done at time t2
/*
* Now simulate an add at an earlier date that the previous delete. The
* conflict resolution should detect that this add must be ignored.
*/
/*
* Now simulate an add at an earlier date that the previous delete. The
* conflict resolution should detect that this add must be ignored. (a
* second time to make sure that historical information is kept...)
*/
/*
* Now simulate an add at a later date that the previous delete.
* conflict resolution should keep it
*/
":0000000000000003000000000000:attrDel",
":0000000000000004000000000000:add:new value");
}
/**
* Test that conflict between a modify-delete-attribute and modify-add
* for multi-valued attributes are handled correctly.
*/
@Test
public void deleteAndReplace() throws Exception
{
// load historical from the entry
// simulate a delete of the whole description attribute done at time t4
/*
* Now simulate a replace at an earlier date that the previous delete. The
* conflict resolution should detect that this replace must be ignored.
*/
}
/**
* Test that conflict between a modify-replace and a a modify-delete
* with some attribute values is resolved correctly.
* This test has been created to reproduce Issue 3397.
*/
@Test
public void replaceAndDelete() throws Exception
{
// create an entry to use with conflicts tests.
// Create description with values value1 and value2 and add
// this attribute to the entry.
// load historical from the entry
// simulate a REPLACE of the attribute with values : value1, value2, value3
// at time t1.
":0000000000000001000000000000:repl:value1",
":0000000000000001000000000000:add:value2",
":0000000000000001000000000000:add:value3");
// simulate a DELETE of the attribute values : value3 and value4
// at time t2.
":0000000000000001000000000000:repl:value1",
":0000000000000001000000000000:add:value2",
":0000000000000002000000000000:del:value3",
":0000000000000002000000000000:del:value4");
}
/**
* Test that conflict between a modify-replace and a a modify-delete
* with some attribute values is resolved correctly when they are replayed
* disorderly.
* This test has been created to reproduce Issue 3397.
*/
@Test
public void replaceAndDeleteDisorder() throws Exception
{
// create an entry to use with conflicts tests.
// We will reuse these attributes a couple of times.
// Create description with values value1 and value2 and add
// this attribute to the entry.
// load historical from the entry
// simulate a DELETE of the attribute values : value3 and value4 at time t2.
// check that the MOD is not altered by the replay mechanism.
// check that the entry now contains value1 and value2 and no other values.
":0000000000000002000000000000:del:value3",
":0000000000000002000000000000:del:value4");
// simulate a REPLACE of the attribute with values : value1, value2, value3
// at time t1.
// check that value3 has been removed from the MOD-REPLACE because
// a later operation contains a MOD-DELETE of this value.
// check that the entry now contains value1 and value2 and no other values.
":0000000000000001000000000000:repl:value1",
":0000000000000001000000000000:add:value2",
":0000000000000002000000000000:del:value3",
":0000000000000002000000000000:del:value4");
}
/**
* Test that conflict between a modify-delete-attribute and modify-add
* for multi-valued attributes are handled correctly.
*/
@Test
public void deleteAndReplaceSingle() throws Exception
{
// Create a single valued attribute with value : "value1"
// add this attribute to the entry.
// load historical from the entry
":0000000000000004000000000000:attrDel");
// simulate a delete of the whole description attribute done at time t4
/*
* Now simulate a replace at an earlier date that the previous delete. The
* conflict resolution should detect that this replace must be ignored.
*/
}
/**
* Test that conflict between a modify-add and modify-add for
* multi-valued attributes are handled correctly.
*/
@Test
{
// load historical from the entry
// simulate a add of the description attribute done at time t10
":000000000000000a000000000000:add:init value");
/*
* Now simulate an add at an earlier date that the previous add. The
* conflict resolution should detect that this add must be kept.
*/
":000000000000000a000000000000:add:init value",
":0000000000000001000000000000:add:older value");
/*
* Now simulate an add with a value already existing.
* The conflict resolution should remove this add.
*/
":0000000000000001000000000000:add:older value",
":000000000000000d000000000000:add:init value");
/*
* Now simulate an add at a later date that the previous add. conflict
* resolution should keep it
*/
":0000000000000001000000000000:add:older value",
":000000000000000d000000000000:add:init value",
":000000000000000e000000000000:add:new value");
}
/**
* Test that a DEL and ADD of the same attribute same value done
* in a single operation correctly results in the value being kept.
*
* This is not a conflict in the strict definition but does exert
* the conflict resolution code.
*/
@Test
public void delAndAddSameOp() throws Exception
{
// load historical from the entry
// simulate a add of the description attribute done at time t10
":000000000000000a000000000000:add:Init Value");
// Now simulate a del and a add in the same operation
"DEL and ADD of the same attribute same value was not correct");
"DEL and ADD of the same attribute same value was not correct");
"DEL and ADD of the same attribute same value was not correct");
":000000000000000b000000000000:add:Init Value");
}
/**
* Test that a DEL of one value and REPLACE with no value, of the same
* attribute done in a single operation correctly results in the value
* being kept.
*
* This is not a conflict in the strict definition but does exert
* the conflict resolution code.
*/
@Test
public void delAndReplaceSameOp() throws Exception
{
// load historical from the entry
":000000000000000c000000000000:attrDel");
// simulate a add of the description attribute done at time t10
":000000000000000a000000000000:add:init value");
// simulate a add of the description attribute done at time t10
":000000000000000a000000000000:add:init value",
":000000000000000b000000000000:add:second value");
/*
* Now simulate a delete of one value and a replace with no value
* in the same operation
*/
"DEL one value, del by Replace of the same attribute was not correct");
"DEL one value, del by Replace of the same attribute was not correct");
"DEL one value, del by Replace of the same attribute was not correct");
// Replay the same modifs again
"DEL one value, del by Replace of the same attribute was not correct");
}
/**
* Test that a ADD and DEL of the same attribute same value done
* in a single operation correctly results in the value being kept.
*
* This is not a conflict in the strict definition but does exert
* the conflict resolution code.
*/
@Test
public void addAndDelSameOp() throws Exception
{
// load historical from the entry
// Now simulate a del and a add in the same operation
":000000000000000b000000000000:del:Init Value");
"DEL and ADD of the same attribute same value was not correct");
"DEL and ADD of the same attribute same value was not correct");
"DEL and ADD of the same attribute same value was not correct");
}
/**
* Test that conflict between two modify-add with for
* multi-valued attributes are handled correctly when some of the values
* are the same :
* - first ADD done with value1
* - second ADD done with value1 and value2
* This test has been created to make sure that issue 3394 is fixed.
*/
@Test
public void addAndAddSameValues() throws Exception
{
// load historical from the entry
// simulate a add of the description attribute done at time 1
":0000000000000001000000000000:add:value1");
/*
* simulate an add of the description attribute values
* "value1" and "value2" done at time 2
*/
":0000000000000002000000000000:add:value1",
":0000000000000002000000000000:add:value2");
// do the same as before but in reverse order
entry = initializeEntry();
// load historical from the entry
/*
* simulate an add of the description attribute values
* "value1" and "value2" done at time 1
*/
":0000000000000001000000000000:add:value1",
":0000000000000001000000000000:add:value2");
// simulate a add of the description attribute done at time 1
":0000000000000001000000000000:add:value2",
":0000000000000002000000000000:add:value1");
}
/**
* Test that conflict between a modify-add and modify-add for
* single-valued attributes are handled correctly.
*/
@Test
public void addAndAddSingle() throws Exception
{
// load historical from the entry
":0000000000000001000000000000:add:older value");
// simulate a add of the displayName attribute done at time t10
":000000000000000a000000000000:add:init value");
/*
* Now simulate an add at an earlier date that the previous add. The
* conflict resolution should detect that this add must be kept.
* and that the previous value must be discarded, and therefore
* turn the add into a replace.
*/
/*
* After replay the mods should contain only one mod,
* the mod should now be a replace with the older value.
*/
/*
* Now simulate a new value at a later date.
* The conflict modify code should detect that there is already a value
* and skip this change.
*/
}
/**
* Test that conflict between add, delete and add on aingle valued attribute
* are handled correctly.
*/
@Test
public void addDelAddSingle() throws Exception
{
// load historical from the entry
":0000000000000003000000000000:attrDel");
// simulate a add of the displayName attribute done at time t1
":0000000000000001000000000000:add:init value");
/*
* simulate a del of the displayName attribute done at time t3
* this should be processed normally
*/
/*
* Now simulate another add, that would come from another master
* and done at time t2 (between t1 and t2)
* This add should not be processed.
*/
}
/**
* Test that conflict between add, add and delete on single valued attributes
* are handled correctly.
*
* This test simulate the case where a simple add is done on a first server
* and at a later date but before replication happens, a add followed by
* a delete of the second value is done on another server.
* The test checks that the first value wins and stays in the entry.
*/
@Test
public void addAddDelSingle() throws Exception
{
// load historical from the entry
":0000000000000001000000000000:add:first value");
// simulate a add of the displayName attribute done at time t1
/*
* simulate a add of the displayName attribute done at time t2
* with a second value. This should not work because there is already
* a value
*/
/*
* Now simulate a delete of the second value.
* The delete should not be accepted because it is done on a value
* that did not get into the entry.
*/
}
/**
* Check that the mods given as first parameter match the next parameters.
*
* @param mods The mods that must be tested.
* @param size the size that the mods must have.
* @param modType the type of Modification that the first mod of the
* mods should have.
* @param value the value that the first mod of the mods should have.
*/
private void testMods(
{
}
/**
* Create an initialize an entry that can be used for modify conflict
* resolution tests.
*/
{
/*
* Objectclass and DN do not have any impact on the modify conflict
* resolution for the description attribute. Always use the same values
* for all these tests.
*/
// start with a new entry with an empty attribute
// Construct a new random UUID. and add it into the entry
// Create the att values list
.toString());
// Add the uuid in the entry
return entry;
}
/**
* helper function.
*/
{
// Get the historical uuid associated to the entry
// (the one that needs to be tested)
// Get the Entry uuid in String format
// Test FakeOperation
{
if (generatedMsg instanceof LDAPUpdateMsg)
{
}
}
}
{
if (keepChangeResult)
{
/*
* The last change should have been detected as newer and
* should be kept by the conflict resolution code.
*/
}
else
{
/*
* The last older change should have been detected as conflicting and
* should be removed by the conflict resolution code.
*/
}
}
private void replayModifies(
{
}
{
{
}
else
{
}
/*
* Check that the encoding decoding of historical information
* works by encoding decoding and checking that the result is the same
* as the initial value.
*/
return mods;
}
{
{
}
else
{
{
}
}
}
{
{
}
return builder.toAttribute();
}
String... expectedValues)
{
{
}
}
{
// Get the historical uuid associated to the entry
// (the one that needs to be tested)
// Get the op uuid in String format
}
/**
* Test that a single replicated modify operation, that contains a
* modify-add of a value followed by modify-delete of that value
* is handled properly.
*/
@Test
public void addDeleteSameOpSingle() throws Exception
{
// load historical from the entry
/*
* Add at time t1 that the previous delete. The
* conflict resolution should detect that this add must be ignored.
*/
// simulate a delete of same value in the same operation done at time t1
// The entry should have no value
}
/**
* Test that a single replicated modify operation, that contains a
* modify-add of a value followed by modify-delete of the attribute
* is handled properly.
*/
@Test
public void addDeleteAttrSameOpSingle() throws Exception
{
// load historical from the entry
/*
* Add at time t1 that the previous delete. The
* conflict resolution should detect that this add must be ignored.
*/
":0000000000000001000000000000:add:aValue");
// simulate a delete of the attribute in the same operation done at time t1
":0000000000000001000000000000:attrDel");
// The entry should have no value
}
/**
* Test that the replay of a single replicated modify operation,
* that contains a modify-add of a value followed by modify-delete
* of the same value is handled properly.
*/
@Test
public void replayAddDeleteSameOpSingle() throws Exception
{
// load historical from the entry
":0000000000000002000000000000:attrDel");
/*
* Add at time t1 that the previous delete. The
* conflict resolution should detect that this add must be ignored.
*/
":0000000000000002000000000000:add:aValue");
// simulate a delete of the attribute in the same operation done at time t1
// Redo the same operations. This time, we expect them not to be applied.
":0000000000000002000000000000:add:aValue",
":0000000000000002000000000000:attrDel");
// simulate a delete of the attribute in the same operation done at time t1
// The entry should have no value
}
/**
* Test we can del an existing value and add a new one, and then replay
* a del of the same existing value and add of a different new one.
*/
@Test
public void replayDelAddDifferent() throws Exception
{
// Create description with values value1 and value2 and add
// this attribute to the entry.
// load historical from the entry
// simulate a delete of same value in the same operation done at time t1
":0000000000000001000000000000:del:value1");
// simulate an add of new value in the same operation done at time t1
":0000000000000001000000000000:add:value3",
":0000000000000001000000000000:del:value1");
// simulate a delete of same value in the same operation done at time t2
":0000000000000001000000000000:add:value3",
":0000000000000002000000000000:del:value1");
// simulate an add of new value in the same operation done at time t2
":0000000000000001000000000000:add:value3",
":0000000000000002000000000000:del:value1",
":0000000000000002000000000000:add:value4");
// The entry should have no value
}
/**
* Test we can del an existing value and add a new one, and then replay
* a del of another existing value and add of the same one.
*/
@Test
public void replayDelAddSame() throws Exception
{
// Create description with values value1 and value2 and add
// this attribute to the entry.
// load historical from the entry
// simulate a delete of a value in the same operation done at time t1
":0000000000000001000000000000:del:value1");
// simulate an add of new value in the same operation done at time t1
":0000000000000001000000000000:add:value4",
":0000000000000001000000000000:del:value1");
// simulate a delete of another value in the same operation done at time t2
":0000000000000001000000000000:del:value1",
":0000000000000001000000000000:add:value4",
":0000000000000002000000000000:del:value2");
// simulate an add of already added value in the same operation done at time
// t2
":0000000000000001000000000000:del:value1",
":0000000000000002000000000000:del:value2",
":0000000000000002000000000000:add:value4");
// The entry should have no value
}
/**
* Test that the replay of a single replicated modify operation,
* that contains a modify-add of a value followed by modify-delete
* of the attribute is handled properly.
*/
@Test
public void replayAddDeleteAttrSameOpSingle() throws Exception
{
// load historical from the entry
":0000000000000001000000000000:attrDel");
/*
* Add at time t1 that the previous delete. The
* conflict resolution should detect that this add must be ignored.
*/
":0000000000000001000000000000:add:aValue");
// simulate a delete of the attribute in the same operation done at time t1
// Redo the same operations. This time, we expect them not to be applied.
":0000000000000001000000000000:add:aValue",
":0000000000000001000000000000:attrDel");
// simulate a delete of the attribute in the same operation done at time t1
// The entry should have no value
}
/**
* Test that a single replicated modify operation, that contains a
* modify-replace of a value followed by modify-delete of that value
* is handled properly.
*/
@Test
public void replaceDeleteSameOpSingle() throws Exception
{
// load historical from the entry
/*
* Add at time t1 that the previous delete. The
* conflict resolution should detect that this add must be ignored.
*/
":0000000000000001000000000000:repl:aValue");
// simulate a delete of same value in the same operation done at time t1
":0000000000000001000000000000:attrDel");
// The entry should have no value
}
/**
* Test that a single replicated modify operation, that contains a
* modify-replace of a value followed by modify-delete of the attribute
* is handled properly.
*/
@Test
public void replaceDeleteAttrSameOpSingle() throws Exception
{
// load historical from the entry
/*
* Add at time t1 that the previous delete. The
* conflict resolution should detect that this add must be ignored.
*/
":0000000000000001000000000000:repl:aValue");
// simulate a delete of the attribute in the same operation done at time t1
":0000000000000001000000000000:attrDel");
// The entry should have no value
}
/**
* Test that the replay of a single replicated modify operation,
* that contains a modify-replace of a value followed by modify-delete
* of the same value is handled properly.
*/
@Test
public void replayReplaceDeleteSameOpSingle() throws Exception
{
// load historical from the entry
":0000000000000002000000000000:repl:aValue");
":0000000000000002000000000000:attrDel");
/*
* Add at time t1 that the previous delete. The
* conflict resolution should detect that this add must be ignored.
*/
// simulate a delete of the attribute in the same operation done at time t1
// Redo the same operations. This time, we expect them not to be applied.
// simulate a delete of the attribute in the same operation done at time t1
// The entry should have no value
}
/**
* Test that the replay of a single replicated modify operation,
* that contains a modify-replace of a value followed by modify-delete
* of the attribute is handled properly.
*/
@Test
public void replayReplaceDeleteAttrSameOpSingle() throws Exception
{
// load historical from the entry
":0000000000000001000000000000:repl:aValue");
":0000000000000001000000000000:attrDel");
/*
* Add at time t1 that the previous delete. The
* conflict resolution should detect that this add must be ignored.
*/
// simulate a delete of the attribute in the same operation done at time t1
// Redo the same operations. This time, we expect them not to be applied.
// simulate a delete of the attribute in the same operation done at time t1
// The entry should have no value
}
/**
* Test that a single replicated modify operation, that contains a
* modify-replace of a value followed by modify-delete of that value,
* followed by a modify-add of a new value is handled properly.
*/
@Test
public void replaceDeleteAddSameOpSingle() throws Exception
{
// load historical from the entry
/*
* Add at time t1 that the previous delete. The
* conflict resolution should detect that this add must be ignored.
*/
":0000000000000001000000000000:repl:aValue");
// simulate a delete of same value in the same operation done at time t1
":0000000000000001000000000000:attrDel");
// simulate an add of new value in the same operation done at time t1
":0000000000000001000000000000:add:NewValue",
":0000000000000001000000000000:attrDel");
}
/**
* Test that a single replicated modify operation, that contains a
* modify-replace of a value followed by modify-delete of the attribute,
* followed by a modify-add of a new value is handled properly.
*/
@Test
public void replaceDeleteAttrAddSameOpSingle() throws Exception
{
// load historical from the entry
/*
* Add at time t1 that the previous delete. The
* conflict resolution should detect that this add must be ignored.
*/
":0000000000000001000000000000:repl:aValue");
// simulate a delete of same value in the same operation done at time t1
":0000000000000001000000000000:attrDel");
// simulate an add of new value in the same operation done at time t1
":0000000000000001000000000000:add:NewValue",
":0000000000000001000000000000:attrDel");
}
}