PageRenderTime 35ms CodeModel.GetById 25ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/sigmah/src/test/java/org/sigmah/server/SchemaMigrationTest.java

http://sigma-h.googlecode.com/
Java | 46 lines | 32 code | 10 blank | 4 comment | 0 complexity | fbb98483adb4ac9abd5db92900d650e0 MD5 | raw file
 1/*
 2 * All Sigmah code is released under the GNU General Public License v3
 3 * See COPYRIGHT.txt and LICENSE.txt.
 4 */
 5
 6package org.sigmah.server;
 7
 8import org.junit.Ignore;
 9import org.junit.Test;
10
11import javax.persistence.EntityManager;
12import javax.persistence.EntityManagerFactory;
13import javax.persistence.Persistence;
14
15public class SchemaMigrationTest {
16
17    @Test
18    @Ignore("this could be a standalone test for a given sql database")
19    public void test() {
20
21        EntityManagerFactory emf = Persistence.createEntityManagerFactory("activityInfo");
22        EntityManager em = emf.createEntityManager();
23
24        em.createQuery("select a from Activity a").setMaxResults(10).getResultList();
25        em.createQuery("select a from AdminEntity  a").setMaxResults(10).getResultList();
26        em.createQuery("select a from Attribute a").setMaxResults(10).getResultList();
27        em.createQuery("select a from AttributeGroup a").setMaxResults(10).getResultList();
28        em.createQuery("select a from AttributeValue a").setMaxResults(10).getResultList();
29        em.createQuery("select a from Authentication a").setMaxResults(10).getResultList();
30        em.createQuery("select c from Country c").setMaxResults(10).getResultList();
31        em.createQuery("select i from Indicator i").setMaxResults(10).getResultList();
32        em.createQuery("select i from IndicatorValue i").setMaxResults(10).getResultList();
33        em.createQuery("select l from Location l").setMaxResults(10).getResultList();
34        em.createQuery("select l from LocationType l").setMaxResults(10).getResultList();
35        em.createQuery("select p from OrgUnit p").setMaxResults(10).getResultList();
36        em.createQuery("select u from UserDatabase u").setMaxResults(10).getResultList();
37        em.createQuery("select r from ReportDefinition r").setMaxResults(10).getResultList();
38        em.createQuery("select a from Authentication a").setMaxResults(10).getResultList();
39        em.createQuery("select s from Site s").setMaxResults(10).getResultList();
40        em.createQuery("select u from User u").setMaxResults(10).getResultList();
41        em.createQuery("select u from UserPermission u").setMaxResults(10).getResultList();
42
43
44    }
45
46}