diff options
| author | Brian S. O'Neill <bronee@gmail.com> | 2008-11-19 00:27:14 +0000 |
|---|---|---|
| committer | Brian S. O'Neill <bronee@gmail.com> | 2008-11-19 00:27:14 +0000 |
| commit | 28d06dff93eb11da8e79af8253ff7fa0fde53b55 (patch) | |
| tree | c2c0b130539393f45b08d65e857b5c94f0754f99 /src/test/java/com/amazon/carbonado | |
| parent | 8e760c0d16791dd072200f575ee5bf29535b64d1 (diff) | |
Fix resync when query is known to return one entry.
Diffstat (limited to 'src/test/java/com/amazon/carbonado')
| -rw-r--r-- | src/test/java/com/amazon/carbonado/repo/replicated/TestRepair.java | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/test/java/com/amazon/carbonado/repo/replicated/TestRepair.java b/src/test/java/com/amazon/carbonado/repo/replicated/TestRepair.java index 4f71e76..7905e8b 100644 --- a/src/test/java/com/amazon/carbonado/repo/replicated/TestRepair.java +++ b/src/test/java/com/amazon/carbonado/repo/replicated/TestRepair.java @@ -367,14 +367,20 @@ public class TestRepair extends TestCase { }
public void testCorruptEntry() throws Exception {
- testCorruptEntry(false);
+ testCorruptEntry(false, false);
}
public void testCorruptEntryPreventDelete() throws Exception {
- testCorruptEntry(true);
+ testCorruptEntry(false, true);
}
- private void testCorruptEntry(boolean preventDelete) throws Exception {
+ public void testIndividualCorruptEntry() throws Exception {
+ testCorruptEntry(true, false);
+ }
+
+ private void testCorruptEntry(boolean individualRepair, boolean preventDelete)
+ throws Exception
+ {
// Close and open repository again, this time on disk. We need to close
// and re-open the repository as part of the test.
String[] locations = reOpenPersistent(null);
@@ -494,7 +500,7 @@ public class TestRepair extends TestCase { // Resync to repair.
class Prevent extends Trigger {
- boolean didRun;
+ volatile boolean didRun;
@Override
public Object beforeDelete(Object s) throws PersistException {
@@ -514,7 +520,14 @@ public class TestRepair extends TestCase { }
ResyncCapability cap = mReplicated.getCapability(ResyncCapability.class);
- cap.resync(type0, 1.0, null);
+
+ if (individualRepair) {
+ for (int i=0; i<count; i++) {
+ cap.resync(type0, 1.0, "id=?", i);
+ }
+ } else {
+ cap.resync(type0, 1.0, null);
+ }
if (preventDelete) {
// Again, this is a partially vestigial test. The trigger should
|
