tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestList.java [76:116]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void test() {
    if (isTestToBePerformed) {
      // register the default factory
      CompanyFactoryRegistry.registerFactory();
      // get new obj graph to compare persistent graph with
      CompanyModelReader reader = new CompanyModelReader(inputFilename);
      List<Object> rootList = getRootList(reader);

      getPM();
      pm.currentTransaction().begin();
      // compare persisted and new
      int size = rootList.size();
      StringBuilder msg = new StringBuilder();
      for (int i = 0; i < size; i++) {
        DeepEquality expected = (DeepEquality) rootList.get(i);
        Object oid = rootOids.get(i);
        Object persisted = pm.getObjectById(oid);
        EqualityHelper equalityHelper = new EqualityHelper();
        if (!expected.deepCompareFields(persisted, equalityHelper)) {
          if (msg.length() > 0) {
            msg.append("\n");
          }
          msg.append(
              "Expected this  instance:\n    "
                  + expected
                  + "\n"
                  + "Got persistent instance:"
                  + "\n    "
                  + persisted
                  + "\n"
                  + "Detailed list of differences follows...\n");
          msg.append(equalityHelper.getUnequalBuffer());
        }
      }
      pm.currentTransaction().commit();
      // fail test if at least one of the instances is not the expected one
      if (msg.length() > 0) {
        fail("CompletenessTestList failed; see list of failures below:", msg.toString());
      }
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestMap.java [76:116]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void test() {
    if (isTestToBePerformed) {
      // register the default factory
      CompanyFactoryRegistry.registerFactory();
      // get new obj graph to compare persistent graph with
      CompanyModelReader reader = new CompanyModelReader(inputFilename);
      List<Object> rootList = getRootList(reader);

      getPM();
      pm.currentTransaction().begin();
      // compare persisted and new
      int size = rootList.size();
      StringBuilder msg = new StringBuilder();
      for (int i = 0; i < size; i++) {
        DeepEquality expected = (DeepEquality) rootList.get(i);
        Object oid = rootOids.get(i);
        Object persisted = pm.getObjectById(oid);
        EqualityHelper equalityHelper = new EqualityHelper();
        if (!expected.deepCompareFields(persisted, equalityHelper)) {
          if (msg.length() > 0) {
            msg.append("\n");
          }
          msg.append(
              "Expected this  instance:\n    "
                  + expected
                  + "\n"
                  + "Got persistent instance:"
                  + "\n    "
                  + persisted
                  + "\n"
                  + "Detailed list of differences follows...\n");
          msg.append(equalityHelper.getUnequalBuffer());
        }
      }
      pm.currentTransaction().commit();
      // fail test if at least one of the instances is not the expected one
      if (msg.length() > 0) {
        fail("CompletenessTestMap failed; see list of failures below:", msg.toString());
      }
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



