@Override public Occurred compare(Version v) { if(!(v instanceof VectorClock)) throw new IllegalArgumentException("Cannot compare Versions of different types."); return VectorClockUtils.compare(this, (VectorClock) v); }
VectorClockUtils.compare(fetchedClock1, fetchedClock2)); assertEquals("online versions themselves should conflict", Occurred.CONCURRENTLY, VectorClockUtils.compare(onlineClock1, onlineClock2)); assertEquals("fetched and online versions should conflict", Occurred.CONCURRENTLY, VectorClockUtils.compare(fetchedClock1, onlineClock1)); assertEquals("fetched and online versions should conflict", Occurred.CONCURRENTLY, VectorClockUtils.compare(fetchedClock1, onlineClock1)); assertEquals("fetched and online versions should conflict", Occurred.CONCURRENTLY, VectorClockUtils.compare(fetchedClock1, onlineClock2)); assertEquals("fetched and online versions should conflict", Occurred.CONCURRENTLY, VectorClockUtils.compare(fetchedClock2, onlineClock1)); assertEquals("fetched and online versions should conflict", Occurred.CONCURRENTLY, VectorClockUtils.compare(fetchedClock2, onlineClock2)); Occurred.CONCURRENTLY == VectorClockUtils.compare((VectorClock) vals.get(0) .getVersion(), nextOnlineClock1)); assertFalse("Next online write would not result in conflict", Occurred.CONCURRENTLY == VectorClockUtils.compare((VectorClock) vals.get(0) .getVersion(), nextOnlineClock2));
assertEquals("fetched and online versions should conflict", Occurred.CONCURRENTLY, VectorClockUtils.compare(fetchedClock, onlineClock)); 1); assertFalse("Next online write would not result in conflict", Occurred.CONCURRENTLY == VectorClockUtils.compare((VectorClock) vals.get(0) .getVersion(), nextOnlineClock));