Search in sources :

Example 1 with ByteArrayFileWriter

use of teetime.stage.io.ByteArrayFileWriter in project TeeTime by teetime-framework.

the class CipherTest method executeTestWithConfigurationCreatedByBuilder.

@Test
public void executeTestWithConfigurationCreatedByBuilder() throws IOException {
    final Configuration configuration = ConfigurationBuilder.from(new InitialElementProducer<File>(new File(INPUT_FILE))).to(new File2ByteArray()).to(new CipherStage(PASSWORD, CipherMode.ENCRYPT)).to(new ZipByteArray(ZipMode.COMP)).to(new ZipByteArray(ZipMode.DECOMP)).to(new CipherStage(PASSWORD, CipherMode.DECRYPT)).end(new ByteArrayFileWriter(new File(OUTPUT_FILE)));
    final Execution<Configuration> execution = new Execution<Configuration>(configuration);
    execution.executeBlocking();
    Assert.assertTrue(Files.equal(new File(INPUT_FILE), new File(OUTPUT_FILE)));
}
Also used : Execution(teetime.framework.Execution) Configuration(teetime.framework.Configuration) File2ByteArray(teetime.stage.io.File2ByteArray) CipherStage(teetime.stage.CipherStage) ByteArrayFileWriter(teetime.stage.io.ByteArrayFileWriter) ZipByteArray(teetime.stage.ZipByteArray) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)1 Test (org.junit.Test)1 Configuration (teetime.framework.Configuration)1 Execution (teetime.framework.Execution)1 CipherStage (teetime.stage.CipherStage)1 ZipByteArray (teetime.stage.ZipByteArray)1 ByteArrayFileWriter (teetime.stage.io.ByteArrayFileWriter)1 File2ByteArray (teetime.stage.io.File2ByteArray)1