Search in sources :

Example 16 with FileInputStreamPlus

use of org.apache.cassandra.io.util.FileInputStreamPlus in project cassandra by apache.

the class SerializationsTest method testValidationCompleteRead.

@Test
public void testValidationCompleteRead() throws IOException {
    if (EXECUTE_WRITES)
        testValidationCompleteWrite();
    try (FileInputStreamPlus in = getInput("service.ValidationComplete.bin")) {
        // empty validation
        ValidationResponse message = ValidationResponse.serializer.deserialize(in, getVersion());
        assert DESC.equals(message.desc);
        assert message.success();
        assert message.trees != null;
        // validation with a tree
        message = ValidationResponse.serializer.deserialize(in, getVersion());
        assert DESC.equals(message.desc);
        assert message.success();
        assert message.trees != null;
        // failed validation
        message = ValidationResponse.serializer.deserialize(in, getVersion());
        assert DESC.equals(message.desc);
        assert !message.success();
        assert message.trees == null;
    }
}
Also used : FileInputStreamPlus(org.apache.cassandra.io.util.FileInputStreamPlus) Test(org.junit.Test)

Aggregations

FileInputStreamPlus (org.apache.cassandra.io.util.FileInputStreamPlus)16 Test (org.junit.Test)7 File (org.apache.cassandra.io.util.File)5 FileOutputStreamPlus (org.apache.cassandra.io.util.FileOutputStreamPlus)3 InetAddressAndPort (org.apache.cassandra.locator.InetAddressAndPort)2 DataInputStream (java.io.DataInputStream)1 Properties (java.util.Properties)1 CRC32 (java.util.zip.CRC32)1 CheckedInputStream (java.util.zip.CheckedInputStream)1 DecoratedKey (org.apache.cassandra.db.DecoratedKey)1 CassandraOutgoingFile (org.apache.cassandra.db.streaming.CassandraOutgoingFile)1 Murmur3Partitioner (org.apache.cassandra.dht.Murmur3Partitioner)1 DataOutputStreamPlus (org.apache.cassandra.io.util.DataOutputStreamPlus)1 SyncNodePair (org.apache.cassandra.repair.SyncNodePair)1 TableId (org.apache.cassandra.schema.TableId)1 BloomFilter (org.apache.cassandra.utils.BloomFilter)1 BeforeClass (org.junit.BeforeClass)1 Benchmark (org.openjdk.jmh.annotations.Benchmark)1