use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromFileTest method copiesFromFileToPath.
@Test
public void copiesFromFileToPath() throws Exception {
final String message = "Hello, товарищ path #1 äÄ üÜ öÖ and ß";
final File input = this.folder.newFile();
Files.write(input.toPath(), message.getBytes(StandardCharsets.UTF_8));
final File output = this.folder.newFile();
new LengthOf(new TeeInput(input, output.toPath())).value();
new Assertion<>("Must copy from input file to output path", new InputOf(output), new HasContent(message)).affirm();
}
use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromPathTest method copiesFromPathToFile.
@Test
public void copiesFromPathToFile() throws Exception {
final String message = "Hello, товарищ file #1 äÄ üÜ öÖ and ß";
final File input = this.folder.newFile();
Files.write(input.toPath(), message.getBytes(StandardCharsets.UTF_8));
final File output = this.folder.newFile();
new LengthOf(new TeeInput(input.toPath(), output)).value();
new Assertion<>("Must copy from input path to output file", new InputOf(output), new HasContent(message)).affirm();
}
use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromPathTest method copiesFromPathToPath.
@Test
public void copiesFromPathToPath() throws Exception {
final String message = "Hello, товарищ path #1 äÄ üÜ öÖ and ß";
final File input = this.folder.newFile();
Files.write(input.toPath(), message.getBytes(StandardCharsets.UTF_8));
final File output = this.folder.newFile();
new LengthOf(new TeeInput(input.toPath(), output.toPath())).value();
new Assertion<>("Must copy from input path to output path", new InputOf(output), new HasContent(message)).affirm();
}
use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromPathTest method copiesFromPathToOutput.
@Test
public void copiesFromPathToOutput() throws Exception {
final String message = "Hello, товарищ output #1 äÄ üÜ öÖ and ß";
final File input = this.folder.newFile();
Files.write(input.toPath(), message.getBytes(StandardCharsets.UTF_8));
final File output = this.folder.newFile();
new LengthOf(new TeeInput(input.toPath(), new OutputTo(output))).value();
new Assertion<>("Must copy from input path to output", new InputOf(output), new HasContent(message)).affirm();
}
use of org.cactoos.scalar.LengthOf in project cactoos by yegor256.
the class TeeInputFromUriTest method copiesFromUriToPath.
@Test
public void copiesFromUriToPath() throws Exception {
final String message = "Hello, товарищ path #1 äÄ üÜ öÖ and ß";
final File input = this.folder.newFile();
Files.write(input.toPath(), message.getBytes(StandardCharsets.UTF_8));
final File output = this.folder.newFile();
new LengthOf(new TeeInput(input.toURI(), output)).value();
new Assertion<>("Must copy from URI to path.", new InputOf(output), new HasContent(message)).affirm();
}
Aggregations