DATACOUCH-573 - use same name for count in query

This commit is contained in:
mikereiche
2020-06-23 12:24:03 -07:00
parent 54d1a45b35
commit cd595995ed
2 changed files with 29 additions and 1 deletions

View File

@@ -85,6 +85,33 @@ public class CouchbaseRepositoryQueryIntegrationTests extends ClusterAwareIntegr
System.err.println(airports);
}
@Test
void count() {
String[] iatas = { "JFK", "IAD", "SFO", "SJC", "SEA", "LAX", "PHX" };
Future[] future = new Future[iatas.length];
ExecutorService executorService = Executors.newFixedThreadPool(iatas.length);
try {
Callable<Boolean>[] suppliers = new Callable[iatas.length];
for (int i = 0; i < iatas.length; i++) {
Airport airport = new Airport("airports::" + iatas[i], iatas[i] /*iata*/, iatas[i].toLowerCase() /* lcao */);
airportRepository.save(airport);
}
try {
Thread.sleep(1000);
} catch (InterruptedException ie) {}
long airportCount = 0;
airportCount = airportRepository.count();
assertEquals(7, airportCount);
} finally {
for (int i = 0; i < iatas.length; i++) {
Airport airport = new Airport("airports::" + iatas[i], iatas[i] /*iata*/, iatas[i] /* lcao */);
airportRepository.delete(airport);
}
}
}
@Test
void threadSafeParametersTest() {
String[] iatas = { "JFK", "IAD", "SFO", "SJC", "SEA", "LAX", "PHX" };