Search in sources :

Example 11 with WaitCriterion

use of org.apache.geode.test.dunit.WaitCriterion in project geode by apache.

the class CqQueryTestListener method waitForDestroyed.

public boolean waitForDestroyed(final Object key) {
    WaitCriterion ev = new WaitCriterion() {

        public boolean done() {
            return CqQueryTestListener.this.destroys.contains(key);
        }

        public String description() {
            return "never got destroy event for key " + key + " in CQ " + CqQueryTestListener.this.cqName;
        }
    };
    Wait.waitForCriterion(ev, MAX_TIME, 200, true);
    return true;
}
Also used : WaitCriterion(org.apache.geode.test.dunit.WaitCriterion)

Example 12 with WaitCriterion

use of org.apache.geode.test.dunit.WaitCriterion in project geode by apache.

the class CqQueryTestListener method waitForRegionInvalidate.

public boolean waitForRegionInvalidate() {
    WaitCriterion ev = new WaitCriterion() {

        public boolean done() {
            return CqQueryTestListener.this.eventRegionInvalidate;
        }

        public String description() {
            return "never got region invalidate event for CQ " + CqQueryTestListener.this.cqName;
        }
    };
    Wait.waitForCriterion(ev, MAX_TIME, 200, true);
    return true;
}
Also used : WaitCriterion(org.apache.geode.test.dunit.WaitCriterion)

Example 13 with WaitCriterion

use of org.apache.geode.test.dunit.WaitCriterion in project geode by apache.

the class CqQueryTestListener method waitForCqsDisconnectedEvents.

public boolean waitForCqsDisconnectedEvents(final int total) {
    WaitCriterion ev = new WaitCriterion() {

        public boolean done() {
            return (CqQueryTestListener.this.cqsDisconnectedCount == total);
        }

        public String description() {
            return "Did not receive expected number of calls to cqsDisconnected() " + CqQueryTestListener.this.cqName + " expected: " + total + " received: " + CqQueryTestListener.this.cqsDisconnectedCount;
        }
    };
    Wait.waitForCriterion(ev, MAX_TIME, 200, true);
    return true;
}
Also used : WaitCriterion(org.apache.geode.test.dunit.WaitCriterion)

Example 14 with WaitCriterion

use of org.apache.geode.test.dunit.WaitCriterion in project geode by apache.

the class CqQueryTestListener method waitForRegionClear.

public boolean waitForRegionClear() {
    WaitCriterion ev = new WaitCriterion() {

        public boolean done() {
            return CqQueryTestListener.this.eventRegionClear;
        }

        public String description() {
            return "never got region clear event for CQ " + CqQueryTestListener.this.cqName;
        }
    };
    Wait.waitForCriterion(ev, MAX_TIME, 200, true);
    return true;
}
Also used : WaitCriterion(org.apache.geode.test.dunit.WaitCriterion)

Example 15 with WaitCriterion

use of org.apache.geode.test.dunit.WaitCriterion in project geode by apache.

the class CqQueryTestListener method waitForClose.

public boolean waitForClose() {
    WaitCriterion ev = new WaitCriterion() {

        public boolean done() {
            return CqQueryTestListener.this.eventClose;
        }

        public String description() {
            return "never got close event for CQ " + CqQueryTestListener.this.cqName;
        }
    };
    Wait.waitForCriterion(ev, MAX_TIME, 200, true);
    return true;
}
Also used : WaitCriterion(org.apache.geode.test.dunit.WaitCriterion)

Aggregations

WaitCriterion (org.apache.geode.test.dunit.WaitCriterion)368 Test (org.junit.Test)132 Region (org.apache.geode.cache.Region)105 VM (org.apache.geode.test.dunit.VM)96 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)93 Host (org.apache.geode.test.dunit.Host)73 LocalRegion (org.apache.geode.internal.cache.LocalRegion)58 CacheException (org.apache.geode.cache.CacheException)57 SerializableRunnable (org.apache.geode.test.dunit.SerializableRunnable)53 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)50 AttributesFactory (org.apache.geode.cache.AttributesFactory)41 IgnoredException (org.apache.geode.test.dunit.IgnoredException)40 IOException (java.io.IOException)36 SerializableCallable (org.apache.geode.test.dunit.SerializableCallable)36 Cache (org.apache.geode.cache.Cache)34 CacheSerializableRunnable (org.apache.geode.cache30.CacheSerializableRunnable)34 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)33 Properties (java.util.Properties)31 AsyncInvocation (org.apache.geode.test.dunit.AsyncInvocation)28 Iterator (java.util.Iterator)27