This is an automated email from the ASF dual-hosted git repository.

blerer pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit b47048797f2d377c0e766a1861c3eef6f197881a
Merge: 9a3ca00 2807c7a
Author: Benjamin Lerer <[email protected]>
AuthorDate: Mon Nov 30 11:42:26 2020 +0100

    Merge branch cassandra-3.11 into trunk

 .../commitlog/AbstractCommitLogSegmentManager.java |  3 ++-
 .../cassandra/hints/HintsWriteThenReadTest.java    | 24 ++++++++++++++--------
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --cc test/long/org/apache/cassandra/hints/HintsWriteThenReadTest.java
index 7970d59,fd880cb..24a9a78
--- a/test/long/org/apache/cassandra/hints/HintsWriteThenReadTest.java
+++ b/test/long/org/apache/cassandra/hints/HintsWriteThenReadTest.java
@@@ -28,25 -28,25 +28,25 @@@ import java.util.concurrent.TimeUnit
  import java.util.zip.CRC32;
  
  import com.google.common.collect.Iterables;
++
  import org.junit.Test;
  
  import org.apache.cassandra.SchemaLoader;
- import org.apache.cassandra.schema.TableMetadata;
- import org.apache.cassandra.schema.Schema;
 -import org.apache.cassandra.config.CFMetaData;
 -import org.apache.cassandra.config.Schema;
  import org.apache.cassandra.db.Mutation;
  import org.apache.cassandra.db.RowUpdateBuilder;
  import org.apache.cassandra.db.rows.Cell;
  import org.apache.cassandra.db.rows.Row;
  import org.apache.cassandra.io.util.FileUtils;
  import org.apache.cassandra.schema.KeyspaceParams;
++import org.apache.cassandra.schema.Schema;
++import org.apache.cassandra.schema.TableMetadata;
  import org.apache.cassandra.utils.FBUtilities;
  
--import static junit.framework.Assert.assertEquals;
--import static junit.framework.Assert.assertNotNull;
--import static junit.framework.Assert.assertTrue;
--
  import static org.apache.cassandra.Util.dk;
  import static org.apache.cassandra.utils.ByteBufferUtil.bytes;
++import static org.junit.Assert.assertEquals;
++import static org.junit.Assert.assertNotNull;
++import static org.junit.Assert.assertTrue;
  
  public class HintsWriteThenReadTest
  {
@@@ -129,10 -129,10 +129,10 @@@
  
                      Row row = 
mutation.getPartitionUpdates().iterator().next().iterator().next();
                      assertEquals(1, Iterables.size(row.cells()));
--                    assertEquals(bytes(index), row.clustering().get(0));
 -                    Cell cell = row.cells().iterator().next();
++                    assertEquals(bytes(index), 
toByteBuffer(row.clustering().get(0)));
 +                    Cell<?> cell = row.cells().iterator().next();
                      assertNotNull(cell);
--                    assertEquals(bytes(index), cell.value());
++                    assertEquals(bytes(index), toByteBuffer(cell.value()));
                      assertEquals(timestamp * 1000, cell.timestamp());
  
                      index++;
@@@ -188,4 -188,4 +188,12 @@@
  
          return (int) crc.getValue();
      }
++
++    private ByteBuffer toByteBuffer(Object obj)
++    {
++        if (obj instanceof ByteBuffer)
++           return (ByteBuffer) obj;
++
++        return ByteBuffer.wrap((byte[]) obj);
++    }
  }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to