PageRenderTime 21ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/testability-explorer/src/main/java/com/google/test/metric/report/DiffReport.java

http://testability-explorer.googlecode.com/
Java | 69 lines | 48 code | 15 blank | 6 comment | 0 complexity | c5a827bdc5c73a293f87fd2072b4a627 MD5 | raw file
Possible License(s): Apache-2.0
  1. package com.google.test.metric.report;
  2. import java.io.IOException;
  3. import java.io.Writer;
  4. import java.util.Date;
  5. import java.util.List;
  6. import freemarker.template.Configuration;
  7. import freemarker.template.Template;
  8. import freemarker.template.TemplateException;
  9. /**
  10. * Represents a report on the difference between two reports, suitable for
  11. * rendering. Also knows how to render itself using Freemarker.
  12. *
  13. * @author alexeagle@google.com (Alex Eagle)
  14. */
  15. public class DiffReport {
  16. private Configuration cfg;
  17. private final Diff diff;
  18. private String oldSourceUrl;
  19. private String newSourceUrl;
  20. private String changelistUrl;
  21. public DiffReport(Diff diff, Configuration cfg) {
  22. this.diff = diff;
  23. diff.sort();
  24. this.cfg = cfg;
  25. }
  26. public void writeHtml(Writer out) throws IOException, TemplateException {
  27. Template template = cfg.getTemplate("diff.html");
  28. template.process(this, out);
  29. }
  30. public List<Diff.ClassDiff> getClassDiffs() {
  31. return diff.getClassDiffs();
  32. }
  33. public Date getCurrentTime() {
  34. return new Date();
  35. }
  36. public String getOldSourceUrl() {
  37. return oldSourceUrl;
  38. }
  39. public String getNewSourceUrl() {
  40. return newSourceUrl;
  41. }
  42. public void setOldSourceUrl(String oldSourceUrl) {
  43. this.oldSourceUrl = oldSourceUrl;
  44. }
  45. public void setNewSourceUrl(String newSourceUrl) {
  46. this.newSourceUrl = newSourceUrl;
  47. }
  48. public String getChangelistUrl() {
  49. return changelistUrl;
  50. }
  51. public void setChangelistUrl(String changelistUrl) {
  52. this.changelistUrl = changelistUrl;
  53. }
  54. }