From notifications-return-49207-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Fri Apr 19 00:51:56 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 111C718061A for ; Fri, 19 Apr 2019 02:51:55 +0200 (CEST) Received: (qmail 93299 invoked by uid 500); 19 Apr 2019 00:51:55 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 93288 invoked by uid 99); 19 Apr 2019 00:51:55 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Apr 2019 00:51:55 +0000 From: GitBox To: notifications@accumulo.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Baccumulo=5D_DonResnik_commented_on_a_change_in_?= =?utf-8?q?pull_request_=231105=3A_Issue-1104=5FDocumentAndTestKeyConstruc?= =?utf-8?q?torsForCopyBehavior_updated_java=E2=80=A6?= Message-ID: <155563511532.10043.5021799946685112930.gitbox@gitbox.apache.org> Date: Fri, 19 Apr 2019 00:51:55 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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