コード例 #1
0
  public static ECReport createECReport() {

    // create report
    ECReport report = new ECReport();

    // set name and group
    report.setReportName(REPORT_NAME);
    report.getGroup().add(createECReportGroup());

    return report;
  }
コード例 #2
0
  public static void assertEquals(ECReport expected, ECReport actual) {

    if (expected == null || actual == null) {
      if (expected == null && actual == null) {
        return;
      } else {
        throw new AssertionFailedError();
      }
    }
    assertEquals(expected.getReportName(), actual.getReportName());
    assertEquals(expected.getAny(), actual.getAny());
    assertEquals(expected.getExtension(), actual.getExtension());

    List<ECReportGroup> expectedGroups = expected.getGroup();
    List<ECReportGroup> actualGroups = actual.getGroup();

    assertEquals(expectedGroups.size(), actualGroups.size());

    for (ECReportGroup expectedGroup : expectedGroups) {
      boolean contains = false;
      for (ECReportGroup actualGroup : actualGroups) {
        try {
          assertEquals(expectedGroup, actualGroup);
        } catch (Error e) {
          continue;
        }
        contains = true;
      }
      if (!contains) {
        throw new AssertionFailedError();
      }
    }
  }