Review Board 1.7.22


SQOOP-1189 Sqoop2: Ensure that clone methods will correctly copy over all values from all parents

Review Request #13942 - Created Sept. 3, 2013 and updated

Jarek Cecho
SQOOP-1189
Reviewers
Sqoop
sqoop-sqoop2
I've added couple of new constructors and make the clone methods of MJob and MConnection a bit simpler. I've also fixed the upgrade code to use the new methods to clone objects reliably.
I've refined current test cases to be a bit easier to read and added more features to be tested.
common/src/main/java/org/apache/sqoop/model/MAccountableEntity.java
Revision 8af7c15d34b6d54e7c74849f92ea25dd0122f347 New Change
[20] 49 lines
[+20]
50
  /**
50
  /**
51
   * Whether enabled
51
   * Whether enabled
52
   */
52
   */
53
  private boolean enabled;
53
  private boolean enabled;
54

    
   
54

   

    
   
55
  /**

    
   
56
   * Default constructor.

    
   
57
   *

    
   
58
   * Set creation and last update date to now and users as null. By default

    
   
59
   * the accountable entity is enabled.

    
   
60
   */
55
  public MAccountableEntity() {
61
  public MAccountableEntity() {
56
    this.creationUser = null;
62
    this.creationUser = null;
57
    this.creationDate = new Date();
63
    this.creationDate = new Date();
58
    this.lastUpdateUser = this.creationUser;
64
    this.lastUpdateUser = this.creationUser;
59
    this.lastUpdateDate = this.creationDate;
65
    this.lastUpdateDate = this.creationDate;
60
    this.enabled = DEFAULT_ENABLED;
66
    this.enabled = DEFAULT_ENABLED;
61
  }
67
  }
62

    
   
68

   

    
   
69
  /**

    
   
70
   * Create new accountable entity as copy of other accountable entity.

    
   
71
   *

    
   
72
   * @param other Accountable entity to copy

    
   
73
   */

    
   
74
  public MAccountableEntity(MAccountableEntity other) {

    
   
75
    super(other);

    
   
76
    this.creationDate = other.creationDate;

    
   
77
    this.creationUser = other.creationUser;

    
   
78
    this.lastUpdateDate = other.lastUpdateDate;

    
   
79
    this.lastUpdateUser = other.lastUpdateUser;

    
   
80
    this.enabled = other.enabled;

    
   
81
  }

    
   
82

   
63
  public void setCreationUser(String name) {
83
  public void setCreationUser(String name) {
64
    this.creationUser = name;
84
    this.creationUser = name;
65
  }
85
  }
66

    
   
86

   
67
  public String getCreationUser() {
87
  public String getCreationUser() {
[+20] [20] 35 lines
common/src/main/java/org/apache/sqoop/model/MConnection.java
Revision 0e4f1a2f499e507594532c3e62de0fb943f8e551 New Change
 
common/src/main/java/org/apache/sqoop/model/MJob.java
Revision c58d1f0d58cfbe1ae000f4cf8319e685271d12bb New Change
 
common/src/main/java/org/apache/sqoop/model/MPersistableEntity.java
Revision 01ecbfb63b50f88e9f37994df8b9ae868d7a97f4 New Change
 
common/src/test/java/org/apache/sqoop/model/TestMConnection.java
Revision 301ef1de04b4b541e4e9d24a32309b9eb4c6d40f New Change
 
common/src/test/java/org/apache/sqoop/model/TestMJob.java
Revision 6cbf7a6baa15447725ffd5be8b7dedb0fbaefb5b New Change
 
core/src/main/java/org/apache/sqoop/repository/Repository.java
Revision 8bf0d406ce4b7a40630905693b475e72a545006a New Change
 
  1. common/src/main/java/org/apache/sqoop/model/MAccountableEntity.java: Loading...
  2. common/src/main/java/org/apache/sqoop/model/MConnection.java: Loading...
  3. common/src/main/java/org/apache/sqoop/model/MJob.java: Loading...
  4. common/src/main/java/org/apache/sqoop/model/MPersistableEntity.java: Loading...
  5. common/src/test/java/org/apache/sqoop/model/TestMConnection.java: Loading...
  6. common/src/test/java/org/apache/sqoop/model/TestMJob.java: Loading...
  7. core/src/main/java/org/apache/sqoop/repository/Repository.java: Loading...