PageRenderTime 16ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/sigmah/src/test/java/org/sigmah/server/schedule/ReportMailerIntegrationTest.java

http://sigma-h.googlecode.com/
Java | 69 lines | 10 code | 9 blank | 50 comment | 0 complexity | 3e06c579c7f4b01ff1a7e631cf986be5 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.schedule;
 7
 8import org.junit.Test;
 9import org.xml.sax.SAXException;
10
11import javax.xml.bind.JAXBException;
12import java.io.IOException;
13
14/**
15 * @author Alex Bertram
16 */
17public class ReportMailerIntegrationTest {
18
19
20    @Test
21    public void test() throws IOException, SAXException, JAXBException {
22//
23//        EntityManagerFactory emf = Persistence.createEntityManagerFactory("activityInfo");
24//        EntityManager em = emf.createEntityManager();
25//
26//        PivotDAO pivotDAO = new PivotDAOHibernateJdbc(em);
27//        SchemaDAO schemaDAO = new SchemaDAOJPA(em);
28//        SiteTableDAO siteTableDAO = new SiteTableDAOHibernate(em);
29//        BaseMapDAO baseMapDAO = new BaseMapDAOImpl();
30//
31//        PivotTableGenerator ptgen = new PivotTableGenerator(pivotDAO);
32//        PivotChartGenerator pcgen = new PivotChartGenerator(pivotDAO, schemaDAO);
33//        MapGenerator mgen = new MapGenerator(pivotDAO, siteTableDAO, baseMapDAO);
34//        TableGenerator tgen = new TableGenerator(pivotDAO, siteTableDAO, schemaDAO, mgen);
35//
36//        ReportGenerator rgen = new ReportGenerator(pivotDAO, ptgen, pcgen, tgen, mgen);
37//
38//        RtfReportRenderer rtfren = new RtfReportRenderer(new ItextPivotTableRenderer(),
39//                new ItextChartRenderer(new ChartRendererJC()), new ItextMapRenderer("war/mapicons"),
40//                new ItextTableRenderer(new ItextMapRenderer("war/mapicons")));
41//
42//        ReportMailerJob job = new ReportMailerJob(em, rgen, rtfren, new MailerImpl() );
43//
44//
45//        User user = new User("akbertram@gmail.com", "Alex", "fr");
46//
47//        Calendar cal = Calendar.getInstance();
48//
49//        List<ReportDefinition> templates = em.createQuery("select t from ReportDefinition t").getResultList();
50//
51//        for(ReportDefinition template : templates) {
52//
53//            Set<ReportSubscription> subs = new HashSet<ReportSubscription>();
54//
55//            Report report = ReportParserJaxb.parseXml(template.getXml());
56//
57//            ReportSubscription sub = new ReportSubscription();
58//            sub.setUser(user);
59//            sub.setTemplate(template);
60//            subs.add(sub);
61//
62//
63//            job.execute(new Date(), report, subs);
64//        }
65
66
67    }
68
69}