Skip to content

Commit

Permalink
#374 - Update tests for cross db (order by and too fast)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbygrave committed Aug 6, 2015
1 parent 14f984e commit 8cde0da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/test/java/com/avaje/tests/batchload/TestLazyJoin.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ public void testLazyOnNonLoaded() {

ResetBasicData.reset();

Query<Order> query = Ebean.find(Order.class).select("status")
.fetch("customer", "+lazy(10) name, status").fetch("customer.contacts");
Query<Order> query = Ebean.find(Order.class)
.select("status")
.fetch("customer", "+lazy(10) name, status")
.fetch("customer.contacts")
.order().asc("id");

List<Order> list = query.findList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,18 @@ public void test_countInBackground() throws ExecutionException, InterruptedExcep


@Test
public void test_countInBackground_withLoadRowCount() {
public void test_countInBackground_withLoadRowCount() throws InterruptedException {

ResetBasicData.reset();

// fetch less that total orders (page size 3)
PagedList<Order> pagedList = Ebean.find(Order.class).findPagedList(0, 3);

LoggedSqlCollector.start();
// sleep a little to give the logger registration time
// as sometimes the first query executes too fast to
// be captured in this multithreaded test
Thread.sleep(10);

pagedList.loadRowCount();
List<Order> orders = pagedList.getList();
Expand Down

0 comments on commit 8cde0da

Please sign in to comment.