@@ -0,0 +1,790 @@
+package hibernate.conventions.test;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.util.List;%0A%0Aimport javax.persistence.EntityManager;%0Aimport javax.persistence.EntityManagerFactory;%0A%0Apublic class TestUtils %7B%0A%0A%09private TestUtils() %7B%0A%09%7D%0A%0A%09public static void assertSql(List%3CString%3E script, String... sqls) %7B%0A%09%09assertEquals(sqls.length, script.size());%0A%09%09for (int i = 0; i %3C sqls.length; i++) %7B%0A%09%09%09assertEquals(sqls%5Bi%5D, script.get(i));%0A%09%09%7D%0A%09%7D%0A%0A%09public static void execute( String query, EntityManagerFactory entityManagerFactory) %7B%0A%09%09EntityManager entityManager = entityManagerFactory.createEntityManager();%0A%09%09entityManager.getTransaction().begin();%0A%09%09entityManager.createNativeQuery(query).executeUpdate();%0A%09%09entityManager.getTransaction().commit();%0A%09%09entityManager.close();%0A%09%7D%0A%0A%7D%0A

test utils