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

added tests which include PipeFactoryLoader

parent 99288bea
No related branches found
No related tags found
No related merge requests found
teetime.framework.pipe.SingleElementPipeFactory
teetime.framework.pipe.OrderedGrowableArrayPipeFactory
teetime.framework.pipe.UnorderedGrowablePipeFactory
teetime.framework.pipe.SpScPipeFactory
teetime.framework.pipe.SpScPipeFactory
\ No newline at end of file
......@@ -10,11 +10,14 @@ import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactoryLoader;
public class FileSearcherTest {
@Test
public void fileInClasspath() throws IOException {
List<URL> list = FileSearcher.loadResources("data/input.txt");
List<URL> list = FileSearcher.loadResources("pipe-factories.conf");
Assert.assertEquals(false, list.isEmpty());
}
......@@ -32,7 +35,15 @@ public class FileSearcherTest {
@Test
public void emptyConfig() throws IOException {
// List<IPipeFactory> list = PipeFactoryLoader.mergeConfigFiles();
List<IPipeFactory> list = PipeFactoryLoader.mergeConfigFiles("data/empty-test.conf");
Assert.assertEquals(true, list.isEmpty());
}
@Test
public void singleConfig() throws IOException {
List<IPipeFactory> list = PipeFactoryLoader.mergeConfigFiles("pipe-factories.conf");
int lines = this.countLines(new File("conf/pipe-factories.conf"));
Assert.assertEquals(lines, list.size());
}
private int countLines(final File fileName) throws IOException {
......
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