private VersionTag createVersionTag(boolean validVersionTag) { InternalDistributedMember remotemember = mock(InternalDistributedMember.class); VersionTag tag = VersionTag.create(remotemember); if (validVersionTag) { tag.setRegionVersion(1); tag.setEntryVersion(1); } return tag; }
@Test public void testConcurrencyTrueTagValid() { // case 4: concurrencyCheckEanbled = true, version tag is valid: distribute DistributedRegion region = prepare(true); EntryEventImpl event = createDummyEvent(region); VersionTag tag = createVersionTag(true); event.setVersionTag(tag); assertTrue(tag.hasValidVersion()); doTest(region, event, 1); }
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); tag.setRegionVersion(this.regionVersionHighBytes, this.regionVersionLowBytes); tag.setVersionTimeStamp(getVersionTimeStamp()); tag.setDistributedSystemId(this.distributedSystemId); return tag; }
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); this.entryVersionLowBytes = (short) (eVersion & 0xffff); this.entryVersionHighByte = (byte) ((eVersion & 0xff0000) >> 16); this.regionVersionHighBytes = tag.getRegionVersionHighBytes(); this.regionVersionLowBytes = tag.getRegionVersionLowBytes(); if (!(tag.isGatewayTag()) && this.distributedSystemId == tag.getDistributedSystemId()) { if (getVersionTimeStamp() <= tag.getVersionTimeStamp()) { setVersionTimeStamp(tag.getVersionTimeStamp()); } else { tag.setVersionTimeStamp(getVersionTimeStamp()); } } else { setVersionTimeStamp(tag.getVersionTimeStamp()); } this.distributedSystemId = (byte) (tag.getDistributedSystemId() & 0xff); }