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 Fri, 19 Apr 2019 00:51:55 GMT
DonResnik commented on a change in pull request #1105: Issue-1104_DocumentAndTestKeyConstructorsForCopyBehavior
updated java…
URL: https://github.com/apache/accumulo/pull/1105#discussion_r276877165
 
 

 ##########
 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:
   created empty array to pass to test method when not all values are used

----------------------------------------------------------------
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