Search in sources :

Example 6 with CompressionProvider

use of org.pentaho.di.core.compress.CompressionProvider in project pentaho-kettle by pentaho.

the class GZIPCompressionOutputStreamTest method testWrite.

@Test
public void testWrite() throws IOException {
    CompressionProvider provider = outStream.getCompressionProvider();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    outStream = new GZIPCompressionOutputStream(out, provider);
    outStream.write("Test".getBytes());
}
Also used : CompressionProvider(org.pentaho.di.core.compress.CompressionProvider) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Test(org.junit.Test)

Example 7 with CompressionProvider

use of org.pentaho.di.core.compress.CompressionProvider in project pentaho-kettle by pentaho.

the class GZIPCompressionOutputStreamTest method testClose.

@Test
public void testClose() throws IOException {
    CompressionProvider provider = outStream.getCompressionProvider();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    outStream = new GZIPCompressionOutputStream(out, provider) {
    };
    outStream.close();
    try {
        outStream.write("This will throw an Exception if the stream is already closed".getBytes());
        fail();
    } catch (IOException e) {
    // Success, The Output Stream was already closed
    }
}
Also used : CompressionProvider(org.pentaho.di.core.compress.CompressionProvider) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException) Test(org.junit.Test)

Example 8 with CompressionProvider

use of org.pentaho.di.core.compress.CompressionProvider in project pentaho-kettle by pentaho.

the class GZIPCompressionOutputStreamTest method getCompressionProvider.

@Test
public void getCompressionProvider() {
    CompressionProvider provider = outStream.getCompressionProvider();
    assertEquals(provider.getName(), PROVIDER_NAME);
}
Also used : CompressionProvider(org.pentaho.di.core.compress.CompressionProvider) Test(org.junit.Test)

Example 9 with CompressionProvider

use of org.pentaho.di.core.compress.CompressionProvider in project pentaho-kettle by pentaho.

the class SnappyCompressionOutputStreamTest method getCompressionProvider.

@Test
public void getCompressionProvider() {
    CompressionProvider provider = outStream.getCompressionProvider();
    assertEquals(provider.getName(), PROVIDER_NAME);
}
Also used : CompressionProvider(org.pentaho.di.core.compress.CompressionProvider) Test(org.junit.Test)

Example 10 with CompressionProvider

use of org.pentaho.di.core.compress.CompressionProvider in project pentaho-kettle by pentaho.

the class SnappyCompressionOutputStreamTest method testClose.

@Test
public void testClose() throws IOException {
    CompressionProvider provider = outStream.getCompressionProvider();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    outStream = new SnappyCompressionOutputStream(out, provider);
    outStream.close();
}
Also used : CompressionProvider(org.pentaho.di.core.compress.CompressionProvider) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Test(org.junit.Test)

Aggregations

CompressionProvider (org.pentaho.di.core.compress.CompressionProvider)27 Test (org.junit.Test)14 ByteArrayOutputStream (java.io.ByteArrayOutputStream)11 KettleException (org.pentaho.di.core.exception.KettleException)7 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)7 IOException (java.io.IOException)6 FileInputList (org.pentaho.di.core.fileinput.FileInputList)6 InputStreamReader (java.io.InputStreamReader)5 InputStream (java.io.InputStream)4 ArrayList (java.util.ArrayList)4 FileObject (org.apache.commons.vfs2.FileObject)4 Before (org.junit.Before)4 CompressionInputStream (org.pentaho.di.core.compress.CompressionInputStream)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 List (java.util.List)2 CTabFolder (org.eclipse.swt.custom.CTabFolder)2 FocusListener (org.eclipse.swt.events.FocusListener)2 ModifyEvent (org.eclipse.swt.events.ModifyEvent)2 ModifyListener (org.eclipse.swt.events.ModifyListener)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2