use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromInputTest method copiesFromInputWithCharsetAndSizeToWriter.
@Test
public void copiesFromInputWithCharsetAndSizeToWriter() throws Exception {
final String input = "Hello, товарищ writer #4 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
new LengthOf(new TeeInput(new InputOf(input), new WriterTo(output), StandardCharsets.UTF_8, input.length())).value();
new Assertion<>("Must copy from input with charset and size to output", new InputOf(output), new HasContent(input)).affirm();
}
use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromInputTest method copiesFromInputToFile.
@Test
public void copiesFromInputToFile() throws Exception {
final String input = "Hello, товарищ file #1 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
new LengthOf(new TeeInput(new InputOf(input), output)).value();
new Assertion<>("Must copy from input to the output file", new InputOf(output), new HasContent(input)).affirm();
}
use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromInputTest method copiesFromInputWithCharsetByNameAndSizeToWriter.
@Test
public void copiesFromInputWithCharsetByNameAndSizeToWriter() throws Exception {
final String input = "Hello, товарищ writer #6 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
new LengthOf(new TeeInput(new InputOf(input), new WriterTo(output), StandardCharsets.UTF_8.name(), input.length())).value();
new Assertion<>("Must copy from input with charset by name and size to output", new InputOf(output), new HasContent(input)).affirm();
}
use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromReaderTest method copiesFromReaderWithCharsetAndSizeToOutput.
@Test
public void copiesFromReaderWithCharsetAndSizeToOutput() throws Exception {
final String input = "Hello, товарищ output #4 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
new LengthOf(new TeeInput(new ReaderOf(input), new OutputTo(output), StandardCharsets.UTF_8, input.length())).value();
new Assertion<>("Must copy from reader with charset and size to output.", new InputOf(output), new HasContent(input)).affirm();
}
use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromReaderTest method copiesFromReaderToOutput.
@Test
public void copiesFromReaderToOutput() throws Exception {
final String input = "Hello, товарищ output #1 äÄ üÜ öÖ and ß";
final File output = this.folder.newFile();
new LengthOf(new TeeInput(new ReaderOf(input), new OutputTo(output))).value();
new Assertion<>("Must copy from reader to output.", new InputOf(output), new HasContent(input)).affirm();
}
Aggregations