use of siena.base.test.model.Discovery4Search in project siena by mandubian.
the class BaseAsyncTest method testSearchSingleKeysOnly.
public void testSearchSingleKeysOnly() {
Discovery4Search[] discs = new Discovery4Search[100];
for (int i = 0; i < 100; i++) {
discs[i] = new Discovery4Search("Disc_" + i, LongAutoID_CURIE);
}
pm.insert((Object[]) discs).get();
QueryAsync<Discovery4Search> query = pm.createQuery(Discovery4Search.class).search("Disc_5", "name");
SienaFuture<List<Discovery4Search>> future = query.fetchKeys();
List<Discovery4Search> res = future.get();
assertEquals(1, res.size());
assertEquals(discs[5].id, res.get(0).id);
assertTrue(res.get(0).isOnlyIdFilled());
}
use of siena.base.test.model.Discovery4Search in project siena by mandubian.
the class BaseAsyncTest method testSearchSingle.
public void testSearchSingle() {
Discovery4Search[] discs = new Discovery4Search[100];
for (int i = 0; i < 100; i++) {
discs[i] = new Discovery4Search("Disc_" + i, LongAutoID_CURIE);
}
pm.insert((Object[]) discs).get();
QueryAsync<Discovery4Search> query = pm.createQuery(Discovery4Search.class).search("Disc_5", "name");
SienaFuture<List<Discovery4Search>> future = query.fetch();
List<Discovery4Search> res = future.get();
assertEquals(1, res.size());
assertEquals(discs[5], res.get(0));
}
use of siena.base.test.model.Discovery4Search in project siena by mandubian.
the class BaseAsyncTest method testSearchSingleTwice.
public void testSearchSingleTwice() {
Discovery4Search[] discs = new Discovery4Search[100];
for (int i = 0; i < 100; i++) {
discs[i] = new Discovery4Search("Disc_" + i, LongAutoID_CURIE);
}
pm.insert((Object[]) discs).get();
QueryAsync<Discovery4Search> query = pm.createQuery(Discovery4Search.class).search("Disc_5", "name");
SienaFuture<List<Discovery4Search>> future = query.fetch();
List<Discovery4Search> res = future.get();
assertEquals(1, res.size());
assertEquals(discs[5], res.get(0));
query = pm.createQuery(Discovery4Search.class).search("Disc_48", "name");
future = query.fetch();
res = future.get();
assertEquals(1, res.size());
assertEquals(discs[48], res.get(0));
}
use of siena.base.test.model.Discovery4Search in project siena by mandubian.
the class BaseTest method testSearchSingleKeysOnly.
public void testSearchSingleKeysOnly() {
Discovery4Search[] discs = new Discovery4Search[100];
for (int i = 0; i < 100; i++) {
discs[i] = new Discovery4Search("Disc_" + i, LongAutoID_CURIE);
}
pm.insert((Object[]) discs);
Query<Discovery4Search> query = pm.createQuery(Discovery4Search.class).search("Disc_5", "name");
List<Discovery4Search> res = query.fetchKeys();
assertEquals(1, res.size());
assertEquals(discs[5].id, res.get(0).id);
assertTrue(res.get(0).isOnlyIdFilled());
}
use of siena.base.test.model.Discovery4Search in project siena by mandubian.
the class GaeAsyncTest method testSearchSingleFieldEqualsSeveralResults.
public void testSearchSingleFieldEqualsSeveralResults() {
Discovery4Search[] discs = new Discovery4Search[5];
discs[0] = new Discovery4Search("alpha", LongAutoID_CURIE);
discs[1] = new Discovery4Search("beta", LongAutoID_CURIE);
discs[2] = new Discovery4Search("gamma", LongAutoID_CURIE);
discs[3] = new Discovery4Search("delta", LongAutoID_CURIE);
discs[4] = new Discovery4Search("eta", LongAutoID_CURIE);
pm.insert((Object[]) discs).get();
QueryAsync<Discovery4Search> query = pm.createQuery(Discovery4Search.class).search("beta eta", "name");
SienaFuture<List<Discovery4Search>> future = query.fetch();
List<Discovery4Search> res = future.get();
assertEquals(2, res.size());
assertEquals(discs[1], res.get(0));
assertEquals(discs[4], res.get(1));
}
Aggregations