Esempio n. 1
0
  public static ECReportGroupList createECReportGroupList() {

    // create report group list
    ECReportGroupList groupList = new ECReportGroupList();

    // add members
    List<ECReportGroupListMember> members = new ArrayList<ECReportGroupListMember>();
    for (int i = 0; i < EPC.length; i++) {
      members.add(createECReportGroupListMember(EPC[i], RAW_DEC[i], RAW_HEX[i], TAGS[i]));
    }
    groupList.getMember().addAll(members);

    return groupList;
  }
Esempio n. 2
0
  public static ECReportGroupList createECReportGroupList() {

    // create report group list
    ECReportGroupList groupList = new ECReportGroupList();

    // add members
    ECReportGroupListMember[] members = new ECReportGroupListMember[EPC.length];
    for (int i = 0; i < EPC.length; i++) {
      members[i] = createECReportGroupListMember(EPC[i], RAW_DEC[i], RAW_HEX[i], TAGS[i]);
    }
    groupList.setMember(members);

    return groupList;
  }
Esempio n. 3
0
  public static void assertEquals(ECReportGroupList expected, ECReportGroupList actual) {

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

    List<ECReportGroupListMember> expectedMembers = expected.getMember();
    List<ECReportGroupListMember> actualMembers = actual.getMember();

    assertEquals(expectedMembers.size(), actualMembers.size());

    for (ECReportGroupListMember expectedMember : expectedMembers) {
      boolean contains = false;
      for (ECReportGroupListMember actualMember : actualMembers) {
        try {
          assertEquals(expectedMember, actualMember);
        } catch (Error e) {
          continue;
        }
        contains = true;
      }
      if (!contains) {
        throw new AssertionFailedError();
      }
    }
  }