Skip to content

Commit

Permalink
Added test that should be green but is red
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Jul 22, 2014
1 parent f343556 commit fcdd593
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,15 @@ public void testGetResultList() {

em.createQuery("SELECT VALUE(contacts) AS l FROM Document d LEFT JOIN d.owner owner LEFT JOIN d.contacts contacts WHERE contacts.name LIKE '%arl%' AND KEY(contacts) = 1", Tuple.class).getResultList();
}

@Test
public void testSelectIndexedWithParameter() {
String expectedQuery = "SELECT COUNT(*) FROM Document d LEFT JOIN d.owner owner LEFT JOIN d.contacts contacts WHERE owner.name = :param_0 AND KEY(contacts) = :contactNr";
PaginatedCriteriaBuilder<Tuple> cb = Criteria.from(em, Document.class, "d")
.where("owner.name").eq("Karl1")
.select("contacts[:contactNr].name")
.page(0, 1);

assertEquals(expectedQuery, cb.getPageCountQueryString());
}
}

0 comments on commit fcdd593

Please sign in to comment.