accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [accumulo] DonResnik commented on a change in pull request #1105: Issue-1104_DocumentAndTestKeyConstructorsForCopyBehavior updated java…
Date Mon, 22 Apr 2019 23:33:26 GMT
DonResnik commented on a change in pull request #1105: Issue-1104_DocumentAndTestKeyConstructorsForCopyBehavior
updated java…
URL: https://github.com/apache/accumulo/pull/1105#discussion_r277473088
 
 

 ##########
 File path: core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
 ##########
 @@ -79,6 +80,96 @@ public void testCopyData() {
     assertEquals(k1, k2);
 
   }
+  
+  @Test
+  public void testCopyDataWithByteArrayConstructors() {
+    byte[] row = "r".getBytes();
+    byte[] cf = "cf".getBytes();
+    byte[] cq = "cq".getBytes();
+    byte[] cv = "cv".getBytes();
+
+    Key kRow = new Key(row);
+    Key kRowcolFam = new Key(row, cf);
+    Key kRowcolFamColQual = new Key(row, cf, cq);
+    Key kRowcolFamColQualColVis = new Key(row, cf, cq, cv);
+    Key kRowcolFamColQualColVisTimeStamp = new Key(row, cf, cq, cv, 5L);
+    
+    // test row constructor
+    assertNotSameByteArray(kRow, row, cf, cq, cv, 5L);
+    
+    // test row, column family constructor
+    assertNotSameByteArray(kRowcolFam, row, cf, cq, cv, 5L);
+    
+    // test row, column family, column qualifier constructor
+    assertNotSameByteArray(kRowcolFamColQual, row, cf, cq, cv, 5L);
+    
+    // test row, column family, column qualifier, column visibility constructor
+    assertNotSameByteArray(kRowcolFamColQualColVis, row, cf, cq, cv, 5L);
+    
+    // test row, column family, column qualifier, column visibility, timestamp constructor
+    assertNotSameByteArray(kRowcolFamColQualColVisTimeStamp, row, cf, cq, cv, 5L);
+  }
+  
+  @Test
+  public void testCopyDataWithTextConstructors() {
+    Text rowText = new Text("r");
+    Text cfText = new Text("cf");
+    Text cqText = new Text("cq");
+    Text cvText = new Text("cv");
+    
+    byte[] row = "r".getBytes();
+    byte[] cf = "cf".getBytes();
+    byte[] cq = "cq".getBytes();
+    byte[] cv = "cv".getBytes();
+
+    //make Keys from Text parameters
+    Key kRow = new Key(rowText);
+    Key kRowcolFam = new Key(rowText, cfText);
+    Key kRowcolFamColQual = new Key(rowText, cfText, cqText);
+    Key kRowcolFamColQualColVis = new Key(rowText, cfText, cqText, cvText);
+    Key kRowcolFamColQualColVisTimeStamp = new Key(rowText, cfText, cqText, cvText, 5L);
+
+    // test row constructor
+    assertNotSameByteArray(kRow, row, cf, cq, cv, 5L);
 
 Review comment:
   I changed to goal of the Text test to ensure it creates the correct byte array in the constructor.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message