Permalink
Browse files

Check OpenJpa query validation.

  • Loading branch information...
1 parent 9734010 commit 42718c57fe961253af12f1775fcb701385ec8ad8 @olivergierke olivergierke committed Jul 18, 2012
@@ -56,6 +56,24 @@ public void findsAllByGivenIds() {
}
+ @Test
+ public void checkQueryValidationWithOpenJpa() {
+
+ try {
+ em.createQuery("something absurd");
+ fail("Creating query did not validate it");
+ } catch (Exception e) {
+ // expected
+ }
+
+ try {
+ em.createNamedQuery("not available");
+ fail("Creating invalid named query did not validate it");
+ } catch (Exception e) {
+ // expected
+ }
+ }
+
/**
* Test case for https://issues.apache.org/jira/browse/OPENJPA-2018
*/

0 comments on commit 42718c5

Please sign in to comment.