Skip to content
Snippets Groups Projects
Commit d96e5b46 authored by Nelson Tavares de Sousa's avatar Nelson Tavares de Sousa
Browse files

added a simple test

parent c5021709
No related branches found
No related tags found
No related merge requests found
...@@ -47,6 +47,10 @@ public final class File2SeqOfWords extends AbstractConsumerStage<File> { ...@@ -47,6 +47,10 @@ public final class File2SeqOfWords extends AbstractConsumerStage<File> {
this("UTF-8", 1024); this("UTF-8", 1024);
} }
public File2SeqOfWords(final int bufferCapacity) {
this("UTF-8", bufferCapacity);
}
public File2SeqOfWords(final String charset, final int bufferCapacity) { public File2SeqOfWords(final String charset, final int bufferCapacity) {
super(); super();
this.charset = charset; this.charset = charset;
......
package teetime.stage.io;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import teetime.framework.test.StageTester;
public class File2SeqOfWordsTest {
@Test
public void testExecute() throws Exception {
File2SeqOfWords stage = new File2SeqOfWords(14);
List<String> outputList = new ArrayList<String>();
StageTester.test(stage).send(Arrays.asList(new File("./src/test/resources/data/input.txt"))).to(stage.getInputPort()).and().receive(outputList)
.from(stage.getOutputPort()).start();
assertEquals(outputList.get(0), "Lorem ipsum");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment