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