From issues-return-3174-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Tue Dec 4 19:50:22 2018 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 [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id DEE3318067A for ; Tue, 4 Dec 2018 19:50:21 +0100 (CET) Received: (qmail 92163 invoked by uid 500); 4 Dec 2018 18:50:21 -0000 Mailing-List: contact issues-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list issues@phoenix.apache.org Received: (qmail 92154 invoked by uid 99); 4 Dec 2018 18:50:21 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Dec 2018 18:50:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7250EE1395; Tue, 4 Dec 2018 18:50:20 +0000 (UTC) From: twdsilva To: issues@phoenix.apache.org Reply-To: issues@phoenix.apache.org References: In-Reply-To: Subject: [GitHub] phoenix pull request #408: PHOENIX-4763: Changing a base table property valu... Content-Type: text/plain Message-Id: <20181204185020.7250EE1395@git1-us-west.apache.org> Date: Tue, 4 Dec 2018 18:50:20 +0000 (UTC) Github user twdsilva commented on a diff in the pull request: https://github.com/apache/phoenix/pull/408#discussion_r238790586 --- Diff: phoenix-core/src/test/java/org/apache/phoenix/util/MetaDataUtilTest.java --- @@ -65,21 +100,67 @@ public void testCompatibility() { @Test public void testMutatingAPut() throws Exception { - String version = VersionInfo.getVersion(); - KeyValueBuilder builder = KeyValueBuilder.get(version); - byte[] row = Bytes.toBytes("row"); - byte[] family = PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES; - byte[] qualifier = Bytes.toBytes("qual"); - byte[] value = Bytes.toBytes("generic-value"); - KeyValue kv = builder.buildPut(wrap(row), wrap(family), wrap(qualifier), wrap(value)); - Put put = new Put(row); - KeyValueBuilder.addQuietly(put, builder, kv); + Put put = generateOriginalPut(); byte[] newValue = Bytes.toBytes("new-value"); - Cell cell = put.get(family, qualifier).get(0); - assertEquals(Bytes.toString(value), Bytes.toString(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())); - MetaDataUtil.mutatePutValue(put, family, qualifier, newValue); - cell = put.get(family, qualifier).get(0); - assertEquals(Bytes.toString(newValue), Bytes.toString(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())); + Cell cell = put.get(TABLE_FAMILY_BYTES, QUALIFIER).get(0); + assertEquals(Bytes.toString(ORIGINAL_VALUE), + Bytes.toString(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())); + MetaDataUtil.mutatePutValue(put, TABLE_FAMILY_BYTES, QUALIFIER, newValue); + cell = put.get(TABLE_FAMILY_BYTES, QUALIFIER).get(0); + assertEquals(Bytes.toString(newValue), + Bytes.toString(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())); + } + --- End diff -- Nice unit tests. ---