You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jd...@apache.org on 2015/03/18 03:41:09 UTC

svn commit: r1667435 - /hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizedRowBatchCtx.java

Author: jdere
Date: Wed Mar 18 02:41:09 2015
New Revision: 1667435

URL: http://svn.apache.org/r1667435
Log:
HIVE-9955: TestVectorizedRowBatchCtx compares byte[] using equals() method (Alexander Pivovarov via Jason Dere)

Modified:
    hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizedRowBatchCtx.java

Modified: hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizedRowBatchCtx.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizedRowBatchCtx.java?rev=1667435&r1=1667434&r2=1667435&view=diff
==============================================================================
--- hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizedRowBatchCtx.java (original)
+++ hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizedRowBatchCtx.java Wed Mar 18 02:41:09 2015
@@ -21,12 +21,11 @@ package org.apache.hadoop.hive.ql.exec.v
 import java.io.File;
 import java.io.IOException;
 import java.sql.Timestamp;
+import java.util.Arrays;
 import java.util.Calendar;
 import java.util.List;
 import java.util.Properties;
 
-import junit.framework.Assert;
-
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -58,6 +57,7 @@ import org.apache.hadoop.io.ObjectWritab
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.compress.DefaultCodec;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -100,7 +100,7 @@ public class TestVectorizedRowBatchCtx {
       serDe = new ColumnarSerDe();
       SerDeUtils.initializeSerDe(serDe, conf, tbl, null);
     } catch (SerDeException e) {
-      new RuntimeException(e);
+      throw new RuntimeException(e);
     }
   }
 
@@ -292,7 +292,7 @@ public class TestVectorizedRowBatchCtx {
               BytesWritable batchBinary = (BytesWritable) bcv.getWritableObject(i);
               byte[] a = colBinary.getBytes();
               byte[] b = batchBinary.getBytes();
-              Assert.assertEquals(true, a.equals(b));
+              Assert.assertEquals(true, Arrays.equals(a, b));
           }
             break;
           case STRING: {
@@ -312,7 +312,7 @@ public class TestVectorizedRowBatchCtx {
           }
             break;
           default:
-            Assert.assertEquals("Unknown type", false);
+            Assert.assertTrue("Unknown type", false);
           }
         } else {
           Assert.assertEquals(true, batch.cols[j].isNull[i]);