Search in sources :

Example 11 with LZ4Compressor

use of net.jpountz.lz4.LZ4Compressor in project hadoop by apache.

the class TestLz4CompressorDecompressor method testCompressorCompressNullPointerException.

//test on NullPointerException in {@code compressor.compress()}  
@Test
public void testCompressorCompressNullPointerException() {
    try {
        Lz4Compressor compressor = new Lz4Compressor();
        byte[] bytes = generate(1024 * 6);
        compressor.setInput(bytes, 0, bytes.length);
        compressor.compress(null, 0, 0);
        fail("testCompressorCompressNullPointerException error !!!");
    } catch (NullPointerException ex) {
    // expected
    } catch (Exception e) {
        fail("testCompressorCompressNullPointerException ex error !!!");
    }
}
Also used : Lz4Compressor(org.apache.hadoop.io.compress.lz4.Lz4Compressor) IOException(java.io.IOException) Test(org.junit.Test)

Example 12 with LZ4Compressor

use of net.jpountz.lz4.LZ4Compressor in project hadoop by apache.

the class TestLz4CompressorDecompressor method testCompressorSetInputNullPointerException.

//test on NullPointerException in {@code compressor.setInput()} 
@Test
public void testCompressorSetInputNullPointerException() {
    try {
        Lz4Compressor compressor = new Lz4Compressor();
        compressor.setInput(null, 0, 10);
        fail("testCompressorSetInputNullPointerException error !!!");
    } catch (NullPointerException ex) {
    // expected
    } catch (Exception e) {
        fail("testCompressorSetInputNullPointerException ex error !!!");
    }
}
Also used : Lz4Compressor(org.apache.hadoop.io.compress.lz4.Lz4Compressor) IOException(java.io.IOException) Test(org.junit.Test)

Aggregations

Lz4Compressor (org.apache.hadoop.io.compress.lz4.Lz4Compressor)10 Test (org.junit.Test)10 IOException (java.io.IOException)9 Lz4Decompressor (org.apache.hadoop.io.compress.lz4.Lz4Decompressor)5 DataInputStream (java.io.DataInputStream)2 LZ4Compressor (net.jpountz.lz4.LZ4Compressor)2 BlockCompressorStream (org.apache.hadoop.io.compress.BlockCompressorStream)2 BlockDecompressorStream (org.apache.hadoop.io.compress.BlockDecompressorStream)2 SnappyCompressor (org.apache.hadoop.io.compress.snappy.SnappyCompressor)2 SnappyDecompressor (org.apache.hadoop.io.compress.snappy.SnappyDecompressor)2 BufferedInputStream (java.io.BufferedInputStream)1 BufferedOutputStream (java.io.BufferedOutputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 DataOutputStream (java.io.DataOutputStream)1 SocketException (java.net.SocketException)1 WritableByteChannel (java.nio.channels.WritableByteChannel)1 Checksum (java.util.zip.Checksum)1 SSLHandshakeException (javax.net.ssl.SSLHandshakeException)1 LZ4BlockOutputStream (net.jpountz.lz4.LZ4BlockOutputStream)1