use of org.apache.geode.test.dunit.StoppableWaitCriterion in project geode by apache.
the class DSObjectLocalOnly method verifyDataSerializers.
public static void verifyDataSerializers(final int numOfDataSerializers, final boolean allowNonLocal) {
WaitCriterion wc = new StoppableWaitCriterion() {
String excuse;
private DataSerializer[] getSerializers() {
allowNonLocalTL.set(allowNonLocal);
try {
return InternalDataSerializer.getSerializers();
} finally {
allowNonLocalTL.remove();
}
}
public boolean done() {
return getSerializers().length == numOfDataSerializers;
}
public String description() {
return "expected " + numOfDataSerializers + " but got this " + InternalDataSerializer.getSerializers().length + " serializers=" + java.util.Arrays.toString(getSerializers());
}
public boolean stopWaiting() {
return getSerializers().length > numOfDataSerializers;
}
};
Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
}
Aggregations