Exemplo n.º 1
0
  private boolean isClonedSchema(Schema origSchema, Schema newSchema) {
    // Check schema of tables
    boolean schemaEqual = (origSchema.size() == newSchema.size());
    if (schemaEqual == false) {
      fail("Number of columns in schema not equal");
      return false;
    }

    for (int col = 0; col < origSchema.size(); col++) {
      Column colA = origSchema.getColumn(col);
      Column colB = newSchema.getColumn(col);
      if (colA.getSimpleName().equals(colB.getSimpleName()) == false) {
        fail("Column names at index " + col + " do not match");
        return false;
      }
      if (colA.getDataType().equals(colB.getDataType()) == false) {
        fail("Column datatypes at index " + col + " do not match");
        return false;
      }
    }
    return true;
  }