use of org.apache.geode.cache30.CacheSerializableRunnable in project geode by apache.
the class HashIndexDUnitTest method doQuery.
public void doQuery() throws Exception {
final String[] qarr = { "173", "174", "176", "180" };
vm0.invokeAsync(new CacheSerializableRunnable("Executing query") {
public void run2() throws CacheException {
try {
for (int i = 0; i < 50; i++) {
utils.executeQueries(qarr);
}
} catch (Exception e) {
throw new CacheException(e) {
};
}
}
});
}
use of org.apache.geode.cache30.CacheSerializableRunnable in project geode by apache.
the class CompiledInDUnitTest method whenUsingAccessorASingleEnumBindParameterIsUsedWithInQueryAndMapIndexIsPresentInPartitionRegionReturnCorrectResults.
@Test
public void whenUsingAccessorASingleEnumBindParameterIsUsedWithInQueryAndMapIndexIsPresentInPartitionRegionReturnCorrectResults() throws CacheException {
final int numberOfEntries = 10;
final int numExpectedResults = numberOfEntries / 2;
final String queryString = "select * from " + regName + " where getMapField['1'] in SET ($1)";
vm0.invoke(new CacheSerializableRunnable("Create Bridge Server") {
public void run2() throws CacheException {
configAndStartBridgeServer();
createPartitionRegion(false);
createIndex("myIndex", "ts.getMapField[*]", regName + " ts");
createEntries(numberOfEntries, regionName);
}
});
Object[] bindArguments = new Object[] { DayEnum.MONDAY };
vm1.invoke(executeQueryWithAccessor(numExpectedResults, queryString, bindArguments));
}
use of org.apache.geode.cache30.CacheSerializableRunnable in project geode by apache.
the class CompiledInDUnitTest method whenEnumBindArgumentIsMatchedInSetWithMultipleIteratingFieldShouldReturnResults.
@Test
public void whenEnumBindArgumentIsMatchedInSetWithMultipleIteratingFieldShouldReturnResults() throws CacheException {
final int numberOfEntries = 10;
final int numExpectedResults = numberOfEntries / 2;
final String queryString = "select * from " + regName + " where $1 in SET (getMapField['1'], getMapField['0'])";
vm0.invoke(new CacheSerializableRunnable("Create Bridge Server") {
public void run2() throws CacheException {
configAndStartBridgeServer();
createReplicateRegion();
createIndex("myIndex", "ts.getMapField[*]", regName + " ts");
createEntries(numberOfEntries, regionName);
}
});
Object[] bindArguments = new Object[] { DayEnum.TUESDAY };
vm1.invoke(executeQueryWithIndexOnReplicateRegion(numExpectedResults, queryString, bindArguments, "myIndex", "ts.getMapField[*]", regName + " ts"));
}
use of org.apache.geode.cache30.CacheSerializableRunnable in project geode by apache.
the class CompiledInDUnitTest method whenMultipleEnumBindParametersAreUsedWithInQueryAndMapIndexIsPresentInPartitionRegionReturnCorrectResults.
@Test
public void whenMultipleEnumBindParametersAreUsedWithInQueryAndMapIndexIsPresentInPartitionRegionReturnCorrectResults() throws CacheException {
final int numberOfEntries = 10;
final int numExpectedResults = numberOfEntries / 2;
final String queryString = "select * from " + regName + " where getMapField['1'] in SET ($1,$2)";
vm0.invoke(new CacheSerializableRunnable("Create Bridge Server") {
public void run2() throws CacheException {
configAndStartBridgeServer();
createPartitionRegion(false);
createIndex("myIndex", "ts.getMapField[*]", regName + " ts");
createEntries(numberOfEntries, regionName);
}
});
Object[] bindArguments = new Object[] { DayEnum.MONDAY, DayEnum.TUESDAY };
vm1.invoke(executeQueryOnPartitionRegion(numExpectedResults, queryString, bindArguments));
}
use of org.apache.geode.cache30.CacheSerializableRunnable in project geode by apache.
the class CompiledInDUnitTest method whenInSetCollectionContainsNonUniqueValuesMatchingSetShouldNotBeDuplicated.
// GEODE-1765
@Category(FlakyTest.class)
@Test
public void whenInSetCollectionContainsNonUniqueValuesMatchingSetShouldNotBeDuplicated() throws CacheException {
final int numberOfEntries = 10;
final int numExpectedResults = numberOfEntries / 2;
final String queryString = "select * from " + regName + " where getMapField['1'] in SET($1, $1, $1)";
vm0.invoke(new CacheSerializableRunnable("Create Bridge Server") {
public void run2() throws CacheException {
configAndStartBridgeServer();
createReplicateRegion();
createIndex("myIndex", "ts.getMapField[*]", regName + " ts");
createEntries(numberOfEntries, regionName);
}
});
Object[] bindArguments = new Object[] { DayEnum.MONDAY, DayEnum.TUESDAY, DayEnum.WEDNESDAY };
vm1.invoke(executeQueryWithIndexOnReplicateRegion(numExpectedResults, queryString, bindArguments, "myIndex", "ts.getMapField[*]", regName + " ts"));
}
Aggregations