Search in sources :

Example 1 with LocalRegion

use of org.apache.geode.internal.cache.LocalRegion in project geode by apache.

the class NewWANConcurrencyCheckForDestroyDUnitTest method getVersionTimestampAfterPutAllOp.

/*
   * For VM1 in ds 1. Used in testPutAllEventSequenceOnSerialGatewaySender.
   */
public static long getVersionTimestampAfterPutAllOp() {
    Region region = cache.getRegion("repRegion");
    while (!(region.containsKey("testKey"))) {
        Wait.pause(10);
    }
    assertEquals(1, region.size());
    Region.Entry entry = ((LocalRegion) region).getEntry("testKey", /* null, */
    true);
    RegionEntry re = null;
    if (entry instanceof EntrySnapshot) {
        re = ((EntrySnapshot) entry).getRegionEntry();
    } else if (entry instanceof NonTXEntry) {
        re = ((NonTXEntry) entry).getRegionEntry();
    }
    if (re != null) {
        LogWriterUtils.getLogWriter().fine("RegionEntry for testKey: " + re.getKey() + " " + re.getValueInVM((LocalRegion) region));
        VersionTag tag = re.getVersionStamp().asVersionTag();
        return tag.getVersionTimeStamp();
    } else {
        return -1;
    }
}
Also used : NonTXEntry(org.apache.geode.internal.cache.LocalRegion.NonTXEntry) VersionTag(org.apache.geode.internal.cache.versions.VersionTag) LocalRegion(org.apache.geode.internal.cache.LocalRegion) Region(org.apache.geode.cache.Region) RegionEntry(org.apache.geode.internal.cache.RegionEntry) LocalRegion(org.apache.geode.internal.cache.LocalRegion) EntrySnapshot(org.apache.geode.internal.cache.EntrySnapshot)

Example 2 with LocalRegion

use of org.apache.geode.internal.cache.LocalRegion in project geode by apache.

the class NewWANConcurrencyCheckForDestroyDUnitTest method testConflictChecksBasedOnDsidAndTimeStamp.

/**
   * Tests if conflict checks are happening based on DSID and timestamp even if version tag is
   * generated in local distributed system.
   */
@Test
public void testConflictChecksBasedOnDsidAndTimeStamp() {
    // create two distributed systems with each having a cache containing
    // a Replicated Region with one entry and concurrency checks enabled.
    // Site 1
    Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
    createCacheInVMs(lnPort, vm1);
    Integer lnRecPort = (Integer) vm1.invoke(() -> WANTestBase.createReceiver());
    // Site 2
    Integer nyPort = (Integer) vm2.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
    createCacheInVMs(nyPort, vm3);
    Integer nyRecPort = (Integer) vm3.invoke(() -> WANTestBase.createReceiver());
    LogWriterUtils.getLogWriter().info("Created locators and receivers in 2 distributed systems");
    // Site 1
    vm1.invoke(() -> WANTestBase.createSender("ln1", 2, false, 10, 1, false, false, null, true));
    vm1.invoke(() -> WANTestBase.createReplicatedRegion("repRegion", "ln1", isOffHeap()));
    vm1.invoke(() -> WANTestBase.startSender("ln1"));
    vm1.invoke(() -> WANTestBase.waitForSenderRunningState("ln1"));
    // Site 2
    vm3.invoke(() -> WANTestBase.createReplicatedRegion("repRegion", "ny1", isOffHeap()));
    vm4.invoke(() -> WANTestBase.createCache(nyPort));
    vm4.invoke(() -> WANTestBase.createSender("ny1", 1, false, 10, 1, false, false, null, true));
    vm4.invoke(() -> WANTestBase.createReplicatedRegion("repRegion", "ny1", isOffHeap()));
    vm4.invoke(() -> WANTestBase.startSender("ny1"));
    vm4.invoke(() -> WANTestBase.waitForSenderRunningState("ny1"));
    Wait.pause(2000);
    // Perform a put in vm1
    vm1.invoke(new CacheSerializableRunnable("Putting an entry in ds1") {

        @Override
        public void run2() throws CacheException {
            assertNotNull(cache);
            Region region = cache.getRegion("/repRegion");
            region.put("testKey", "testValue1");
            assertEquals(1, region.size());
        }
    });
    // wait for vm4 to have later timestamp before sending operation to vm1
    Wait.pause(300);
    AsyncInvocation asynch = vm4.invokeAsync(new CacheSerializableRunnable("Putting an entry in ds2 in vm4") {

        @Override
        public void run2() throws CacheException {
            assertNotNull(cache);
            Region region = cache.getRegion("/repRegion");
            region.put("testKey", "testValue2");
            assertEquals(1, region.size());
            assertEquals("testValue2", region.get("testKey"));
        }
    });
    try {
        asynch.join(2000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    // Wait for all local ds events be received by vm3.
    Wait.pause(1000);
    vm3.invoke(new CacheSerializableRunnable("Check dsid") {

        @Override
        public void run2() throws CacheException {
            Region region = cache.getRegion("repRegion");
            Region.Entry entry = ((LocalRegion) region).getEntry("testKey", /* null, */
            true);
            // commented while merging revision 43582
            RegionEntry re = null;
            if (entry instanceof EntrySnapshot) {
                re = ((EntrySnapshot) entry).getRegionEntry();
            } else if (entry instanceof NonTXEntry) {
                re = ((NonTXEntry) entry).getRegionEntry();
            }
            VersionTag tag = re.getVersionStamp().asVersionTag();
            assertEquals(2, tag.getDistributedSystemId());
        }
    });
    // Check vm3 has latest timestamp from vm4.
    long putAllTimeStampVm1 = (Long) vm4.invoke(() -> NewWANConcurrencyCheckForDestroyDUnitTest.getVersionTimestampAfterPutAllOp());
    long putAllTimeStampVm3 = (Long) vm3.invoke(() -> NewWANConcurrencyCheckForDestroyDUnitTest.getVersionTimestampAfterPutAllOp());
    assertEquals(putAllTimeStampVm1, putAllTimeStampVm3);
}
Also used : NonTXEntry(org.apache.geode.internal.cache.LocalRegion.NonTXEntry) CacheException(org.apache.geode.cache.CacheException) AsyncInvocation(org.apache.geode.test.dunit.AsyncInvocation) RegionEntry(org.apache.geode.internal.cache.RegionEntry) NonTXEntry(org.apache.geode.internal.cache.LocalRegion.NonTXEntry) CacheSerializableRunnable(org.apache.geode.cache30.CacheSerializableRunnable) VersionTag(org.apache.geode.internal.cache.versions.VersionTag) LocalRegion(org.apache.geode.internal.cache.LocalRegion) Region(org.apache.geode.cache.Region) RegionEntry(org.apache.geode.internal.cache.RegionEntry) EntrySnapshot(org.apache.geode.internal.cache.EntrySnapshot) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 3 with LocalRegion

use of org.apache.geode.internal.cache.LocalRegion in project geode by apache.

the class WANConfigurationJUnitTest method test_GatewaySenderIdAndAsyncEventId.

@Test
public void test_GatewaySenderIdAndAsyncEventId() {
    cache = new CacheFactory().set(MCAST_PORT, "0").create();
    AttributesFactory factory = new AttributesFactory();
    factory.addGatewaySenderId("ln");
    factory.addGatewaySenderId("ny");
    factory.addAsyncEventQueueId("Async_LN");
    RegionAttributes attrs = factory.create();
    Set<String> senderIds = new HashSet<String>();
    senderIds.add("ln");
    senderIds.add("ny");
    Set<String> attrsSenderIds = attrs.getGatewaySenderIds();
    assertEquals(senderIds, attrsSenderIds);
    Region r = cache.createRegion("Customer", attrs);
    assertEquals(senderIds, ((LocalRegion) r).getGatewaySenderIds());
}
Also used : LocalRegion(org.apache.geode.internal.cache.LocalRegion) HashSet(java.util.HashSet) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Example 4 with LocalRegion

use of org.apache.geode.internal.cache.LocalRegion in project geode by apache.

the class NewWANConcurrencyCheckForDestroyDUnitTest method verifyTimestampAfterOp.

/*
   * For VM 5 in ds 3.
   */
public static void verifyTimestampAfterOp(long timestamp, int memberid) {
    Region region = cache.getRegion("repRegion");
    assertEquals(0, region.size());
    Region.Entry entry = ((LocalRegion) region).getEntry("testKey", /* null, */
    true);
    RegionEntry re = ((EntrySnapshot) entry).getRegionEntry();
    assertTrue(re.getValueInVM((LocalRegion) region) instanceof Tombstone);
    VersionTag tag = re.getVersionStamp().asVersionTag();
    assertEquals(timestamp, tag.getVersionTimeStamp());
    assertEquals(memberid, tag.getDistributedSystemId());
}
Also used : Tombstone(org.apache.geode.internal.cache.Token.Tombstone) VersionTag(org.apache.geode.internal.cache.versions.VersionTag) LocalRegion(org.apache.geode.internal.cache.LocalRegion) Region(org.apache.geode.cache.Region) RegionEntry(org.apache.geode.internal.cache.RegionEntry) LocalRegion(org.apache.geode.internal.cache.LocalRegion) EntrySnapshot(org.apache.geode.internal.cache.EntrySnapshot)

Example 5 with LocalRegion

use of org.apache.geode.internal.cache.LocalRegion in project geode by apache.

the class ClientAuthorizationTestCase method doOp.

protected static void doOp(OperationCode op, final int[] indices, final int flagsI, final int expectedResult) throws InterruptedException {
    boolean operationOmitted = false;
    final int flags = flagsI;
    Region region = getRegion();
    if ((flags & OpFlags.USE_SUBREGION) > 0) {
        assertNotNull(region);
        Region subregion = null;
        if ((flags & OpFlags.NO_CREATE_SUBREGION) > 0) {
            if ((flags & OpFlags.CHECK_NOREGION) > 0) {
                // Wait for some time for DRF update to come
                waitForCondition(() -> getSubregion() == null);
                subregion = getSubregion();
                assertNull(subregion);
                return;
            } else {
                // Wait for some time for DRF update to come
                waitForCondition(() -> getSubregion() != null);
                subregion = getSubregion();
                assertNotNull(subregion);
            }
        } else {
            subregion = createSubregion(region);
        }
        assertNotNull(subregion);
        region = subregion;
    } else if ((flags & OpFlags.CHECK_NOREGION) > 0) {
        // Wait for some time for region destroy update to come
        waitForCondition(() -> getRegion() == null);
        region = getRegion();
        assertNull(region);
        return;
    } else {
        assertNotNull(region);
    }
    final String[] keys = KEYS;
    final String[] vals;
    if ((flags & OpFlags.USE_NEWVAL) > 0) {
        vals = NVALUES;
    } else {
        vals = VALUES;
    }
    InterestResultPolicy policy = InterestResultPolicy.KEYS_VALUES;
    if ((flags & OpFlags.REGISTER_POLICY_NONE) > 0) {
        policy = InterestResultPolicy.NONE;
    }
    final int numOps = indices.length;
    System.out.println("Got doOp for op: " + op.toString() + ", numOps: " + numOps + ", indices: " + indicesToString(indices) + ", expect: " + expectedResult);
    boolean exceptionOccurred = false;
    boolean breakLoop = false;
    if (op.isGet() || op.isContainsKey() || op.isKeySet() || op.isQuery() || op.isExecuteCQ()) {
        Thread.sleep(PAUSE);
    }
    for (int indexIndex = 0; indexIndex < numOps; ++indexIndex) {
        if (breakLoop) {
            break;
        }
        int index = indices[indexIndex];
        try {
            final Object key = keys[index];
            final Object expectedVal = vals[index];
            if (op.isGet()) {
                Object value = null;
                // this is the case for testing GET_ALL
                if ((flags & OpFlags.USE_ALL_KEYS) > 0) {
                    breakLoop = true;
                    List keyList = new ArrayList(numOps);
                    Object searchKey;
                    for (int keyNumIndex = 0; keyNumIndex < numOps; ++keyNumIndex) {
                        int keyNum = indices[keyNumIndex];
                        searchKey = keys[keyNum];
                        keyList.add(searchKey);
                        // local invalidate some KEYS to force fetch of those KEYS from server
                        if ((flags & OpFlags.CHECK_NOKEY) > 0) {
                            AbstractRegionEntry entry = (AbstractRegionEntry) ((LocalRegion) region).getRegionEntry(searchKey);
                            System.out.println("" + keyNum + ": key is " + searchKey + " and entry is " + entry);
                            assertFalse(region.containsKey(searchKey));
                        } else {
                            if (keyNumIndex % 2 == 1) {
                                assertTrue(region.containsKey(searchKey));
                                region.localInvalidate(searchKey);
                            }
                        }
                    }
                    Map entries = region.getAll(keyList);
                    for (int keyNumIndex = 0; keyNumIndex < numOps; ++keyNumIndex) {
                        int keyNum = indices[keyNumIndex];
                        searchKey = keys[keyNum];
                        if ((flags & OpFlags.CHECK_FAIL) > 0) {
                            assertFalse(entries.containsKey(searchKey));
                        } else {
                            assertTrue(entries.containsKey(searchKey));
                            value = entries.get(searchKey);
                            assertEquals(vals[keyNum], value);
                        }
                    }
                    break;
                }
                if ((flags & OpFlags.LOCAL_OP) > 0) {
                    Callable<Boolean> condition = new Callable<Boolean>() {

                        private Region region;

                        @Override
                        public Boolean call() throws Exception {
                            Object value = getLocalValue(region, key);
                            return (flags & OpFlags.CHECK_FAIL) > 0 ? !expectedVal.equals(value) : expectedVal.equals(value);
                        }

                        public Callable<Boolean> init(Region region) {
                            this.region = region;
                            return this;
                        }
                    }.init(region);
                    waitForCondition(condition);
                    value = getLocalValue(region, key);
                } else if ((flags & OpFlags.USE_GET_ENTRY_IN_TX) > 0) {
                    getCache().getCacheTransactionManager().begin();
                    Entry e = region.getEntry(key);
                    // Also, check getAll()
                    ArrayList a = new ArrayList();
                    a.addAll(a);
                    region.getAll(a);
                    getCache().getCacheTransactionManager().commit();
                    value = e.getValue();
                } else {
                    if ((flags & OpFlags.CHECK_NOKEY) > 0) {
                        assertFalse(region.containsKey(key));
                    } else {
                        assertTrue(region.containsKey(key) || ((LocalRegion) region).getRegionEntry(key).isTombstone());
                        region.localInvalidate(key);
                    }
                    value = region.get(key);
                }
                if ((flags & OpFlags.CHECK_FAIL) > 0) {
                    assertFalse(expectedVal.equals(value));
                } else {
                    assertNotNull(value);
                    assertEquals(expectedVal, value);
                }
            } else if (op.isPut()) {
                region.put(key, expectedVal);
            } else if (op.isPutAll()) {
                HashMap map = new HashMap();
                for (int i = 0; i < indices.length; i++) {
                    map.put(keys[indices[i]], vals[indices[i]]);
                }
                region.putAll(map);
                breakLoop = true;
            } else if (op.isDestroy()) {
                // }
                if ((flags & OpFlags.LOCAL_OP) > 0) {
                    region.localDestroy(key);
                } else {
                    region.destroy(key);
                }
            } else if (op.isInvalidate()) {
                if (region.containsKey(key)) {
                    if ((flags & OpFlags.LOCAL_OP) > 0) {
                        region.localInvalidate(key);
                    } else {
                        region.invalidate(key);
                    }
                }
            } else if (op.isContainsKey()) {
                boolean result;
                if ((flags & OpFlags.LOCAL_OP) > 0) {
                    result = region.containsKey(key);
                } else {
                    result = region.containsKeyOnServer(key);
                }
                if ((flags & OpFlags.CHECK_FAIL) > 0) {
                    assertFalse(result);
                } else {
                    assertTrue(result);
                }
            } else if (op.isRegisterInterest()) {
                if ((flags & OpFlags.USE_LIST) > 0) {
                    breakLoop = true;
                    // Register interest list in this case
                    List keyList = new ArrayList(numOps);
                    for (int keyNumIndex = 0; keyNumIndex < numOps; ++keyNumIndex) {
                        int keyNum = indices[keyNumIndex];
                        keyList.add(keys[keyNum]);
                    }
                    region.registerInterest(keyList, policy);
                } else if ((flags & OpFlags.USE_REGEX) > 0) {
                    breakLoop = true;
                    region.registerInterestRegex("key[1-" + numOps + ']', policy);
                } else if ((flags & OpFlags.USE_ALL_KEYS) > 0) {
                    breakLoop = true;
                    region.registerInterest("ALL_KEYS", policy);
                } else {
                    region.registerInterest(key, policy);
                }
            } else if (op.isUnregisterInterest()) {
                if ((flags & OpFlags.USE_LIST) > 0) {
                    breakLoop = true;
                    // Register interest list in this case
                    List keyList = new ArrayList(numOps);
                    for (int keyNumIndex = 0; keyNumIndex < numOps; ++keyNumIndex) {
                        int keyNum = indices[keyNumIndex];
                        keyList.add(keys[keyNum]);
                    }
                    region.unregisterInterest(keyList);
                } else if ((flags & OpFlags.USE_REGEX) > 0) {
                    breakLoop = true;
                    region.unregisterInterestRegex("key[1-" + numOps + ']');
                } else if ((flags & OpFlags.USE_ALL_KEYS) > 0) {
                    breakLoop = true;
                    region.unregisterInterest("ALL_KEYS");
                } else {
                    region.unregisterInterest(key);
                }
            } else if (op.isKeySet()) {
                breakLoop = true;
                Set keySet;
                if ((flags & OpFlags.LOCAL_OP) > 0) {
                    keySet = region.keySet();
                } else {
                    keySet = region.keySetOnServer();
                }
                assertNotNull(keySet);
                if ((flags & OpFlags.CHECK_FAIL) == 0) {
                    assertEquals(numOps, keySet.size());
                }
                for (int keyNumIndex = 0; keyNumIndex < numOps; ++keyNumIndex) {
                    int keyNum = indices[keyNumIndex];
                    if ((flags & OpFlags.CHECK_FAIL) > 0) {
                        assertFalse(keySet.contains(keys[keyNum]));
                    } else {
                        assertTrue(keySet.contains(keys[keyNum]));
                    }
                }
            } else if (op.isQuery()) {
                breakLoop = true;
                SelectResults queryResults = region.query("SELECT DISTINCT * FROM " + region.getFullPath());
                assertNotNull(queryResults);
                Set queryResultSet = queryResults.asSet();
                if ((flags & OpFlags.CHECK_FAIL) == 0) {
                    assertEquals(numOps, queryResultSet.size());
                }
                for (int keyNumIndex = 0; keyNumIndex < numOps; ++keyNumIndex) {
                    int keyNum = indices[keyNumIndex];
                    if ((flags & OpFlags.CHECK_FAIL) > 0) {
                        assertFalse(queryResultSet.contains(vals[keyNum]));
                    } else {
                        assertTrue(queryResultSet.contains(vals[keyNum]));
                    }
                }
            } else if (op.isExecuteCQ()) {
                breakLoop = true;
                QueryService queryService = getCache().getQueryService();
                CqQuery cqQuery;
                if ((cqQuery = queryService.getCq("cq1")) == null) {
                    CqAttributesFactory cqFact = new CqAttributesFactory();
                    cqFact.addCqListener(new AuthzCqListener());
                    CqAttributes cqAttrs = cqFact.create();
                    cqQuery = queryService.newCq("cq1", "SELECT * FROM " + region.getFullPath(), cqAttrs);
                }
                if ((flags & OpFlags.LOCAL_OP) > 0) {
                    // Interpret this as testing results using CqListener
                    final AuthzCqListener listener = (AuthzCqListener) cqQuery.getCqAttributes().getCqListener();
                    WaitCriterion ev = new WaitCriterion() {

                        @Override
                        public boolean done() {
                            if ((flags & OpFlags.CHECK_FAIL) > 0) {
                                return 0 == listener.getNumUpdates();
                            } else {
                                return numOps == listener.getNumUpdates();
                            }
                        }

                        @Override
                        public String description() {
                            return null;
                        }
                    };
                    waitForCriterion(ev, 3 * 1000, 200, true);
                    if ((flags & OpFlags.CHECK_FAIL) > 0) {
                        assertEquals(0, listener.getNumUpdates());
                    } else {
                        assertEquals(numOps, listener.getNumUpdates());
                        listener.checkPuts(vals, indices);
                    }
                    assertEquals(0, listener.getNumCreates());
                    assertEquals(0, listener.getNumDestroys());
                    assertEquals(0, listener.getNumOtherOps());
                    assertEquals(0, listener.getNumErrors());
                } else {
                    SelectResults cqResults = cqQuery.executeWithInitialResults();
                    assertNotNull(cqResults);
                    Set cqResultValues = new HashSet();
                    for (Object o : cqResults.asList()) {
                        Struct s = (Struct) o;
                        cqResultValues.add(s.get("value"));
                    }
                    Set cqResultSet = cqResults.asSet();
                    if ((flags & OpFlags.CHECK_FAIL) == 0) {
                        assertEquals(numOps, cqResultSet.size());
                    }
                    for (int keyNumIndex = 0; keyNumIndex < numOps; ++keyNumIndex) {
                        int keyNum = indices[keyNumIndex];
                        if ((flags & OpFlags.CHECK_FAIL) > 0) {
                            assertFalse(cqResultValues.contains(vals[keyNum]));
                        } else {
                            assertTrue(cqResultValues.contains(vals[keyNum]));
                        }
                    }
                }
            } else if (op.isStopCQ()) {
                breakLoop = true;
                CqQuery cqQuery = getCache().getQueryService().getCq("cq1");
                ((AuthzCqListener) cqQuery.getCqAttributes().getCqListener()).reset();
                cqQuery.stop();
            } else if (op.isCloseCQ()) {
                breakLoop = true;
                CqQuery cqQuery = getCache().getQueryService().getCq("cq1");
                ((AuthzCqListener) cqQuery.getCqAttributes().getCqListener()).reset();
                cqQuery.close();
            } else if (op.isRegionClear()) {
                breakLoop = true;
                if ((flags & OpFlags.LOCAL_OP) > 0) {
                    region.localClear();
                } else {
                    region.clear();
                }
            } else if (op.isRegionCreate()) {
                breakLoop = true;
                // Region subregion = createSubregion(region);
                // subregion.createRegionOnServer();
                // Create region on server using the DynamicRegionFactory
                // Assume it has been already initialized
                DynamicRegionFactory drf = DynamicRegionFactory.get();
                Region subregion = drf.createDynamicRegion(regionName, SUBREGION_NAME);
                assertEquals('/' + regionName + '/' + SUBREGION_NAME, subregion.getFullPath());
            } else if (op.isRegionDestroy()) {
                breakLoop = true;
                if ((flags & OpFlags.LOCAL_OP) > 0) {
                    region.localDestroyRegion();
                } else {
                    if ((flags & OpFlags.USE_SUBREGION) > 0) {
                        try {
                            DynamicRegionFactory.get().destroyDynamicRegion(region.getFullPath());
                        } catch (RegionDestroyedException ex) {
                            // harmless to ignore this
                            System.out.println("doOp: sub-region " + region.getFullPath() + " already destroyed");
                            operationOmitted = true;
                        }
                    } else {
                        region.destroyRegion();
                    }
                }
            } else {
                fail("doOp: Unhandled operation " + op);
            }
            if (expectedResult != NO_EXCEPTION) {
                if (!operationOmitted && !op.isUnregisterInterest()) {
                    fail("Expected an exception while performing operation op =" + op + "flags = " + OpFlags.description(flags));
                }
            }
        } catch (Exception ex) {
            exceptionOccurred = true;
            if ((ex instanceof ServerConnectivityException || ex instanceof QueryInvocationTargetException || ex instanceof CqException) && (expectedResult == NOTAUTHZ_EXCEPTION) && (ex.getCause() instanceof NotAuthorizedException)) {
                System.out.println("doOp: Got expected NotAuthorizedException when doing operation [" + op + "] with flags " + OpFlags.description(flags) + ": " + ex.getCause());
                continue;
            } else if (expectedResult == OTHER_EXCEPTION) {
                System.out.println("doOp: Got expected exception when doing operation: " + ex.toString());
                continue;
            } else {
                fail("doOp: Got unexpected exception when doing operation. Policy = " + policy + " flags = " + OpFlags.description(flags), ex);
            }
        }
    }
    if (!exceptionOccurred && !operationOmitted && expectedResult != NO_EXCEPTION) {
        fail("Expected an exception while performing operation: " + op + " flags = " + OpFlags.description(flags));
    }
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) RegionDestroyedException(org.apache.geode.cache.RegionDestroyedException) ArrayList(java.util.ArrayList) LocalRegion(org.apache.geode.internal.cache.LocalRegion) Callable(java.util.concurrent.Callable) Struct(org.apache.geode.cache.query.Struct) ServerConnectivityException(org.apache.geode.cache.client.ServerConnectivityException) InterestResultPolicy(org.apache.geode.cache.InterestResultPolicy) Entry(org.apache.geode.cache.Region.Entry) AbstractRegionEntry(org.apache.geode.internal.cache.AbstractRegionEntry) SelectResults(org.apache.geode.cache.query.SelectResults) ArrayList(java.util.ArrayList) List(java.util.List) CqQuery(org.apache.geode.cache.query.CqQuery) HashSet(java.util.HashSet) DynamicRegionFactory(org.apache.geode.cache.DynamicRegionFactory) CqException(org.apache.geode.cache.query.CqException) QueryInvocationTargetException(org.apache.geode.cache.query.QueryInvocationTargetException) CqException(org.apache.geode.cache.query.CqException) RegionDestroyedException(org.apache.geode.cache.RegionDestroyedException) ServerConnectivityException(org.apache.geode.cache.client.ServerConnectivityException) QueryInvocationTargetException(org.apache.geode.cache.query.QueryInvocationTargetException) AbstractRegionEntry(org.apache.geode.internal.cache.AbstractRegionEntry) WaitCriterion(org.apache.geode.test.dunit.WaitCriterion) QueryService(org.apache.geode.cache.query.QueryService) CqAttributes(org.apache.geode.cache.query.CqAttributes) LocalRegion(org.apache.geode.internal.cache.LocalRegion) Region(org.apache.geode.cache.Region) CqAttributesFactory(org.apache.geode.cache.query.CqAttributesFactory) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

LocalRegion (org.apache.geode.internal.cache.LocalRegion)243 Test (org.junit.Test)103 Region (org.apache.geode.cache.Region)70 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)54 IOException (java.io.IOException)50 AttributesFactory (org.apache.geode.cache.AttributesFactory)42 VM (org.apache.geode.test.dunit.VM)39 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)38 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)37 CacheSerializableRunnable (org.apache.geode.cache30.CacheSerializableRunnable)34 SerializableRunnable (org.apache.geode.test.dunit.SerializableRunnable)34 Cache (org.apache.geode.cache.Cache)31 RegionDestroyedException (org.apache.geode.cache.RegionDestroyedException)31 Host (org.apache.geode.test.dunit.Host)31 Iterator (java.util.Iterator)29 QueryService (org.apache.geode.cache.query.QueryService)29 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)27 CancelException (org.apache.geode.CancelException)26 CacheException (org.apache.geode.cache.CacheException)26 WaitCriterion (org.apache.geode.test.dunit.WaitCriterion)25