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

added tests which include PipeFactoryLoader

parent e935b3df
No related branches found
No related tags found
No related merge requests found
teetime.framework.pipe.SingleElementPipeFactory teetime.framework.pipe.SingleElementPipeFactory
teetime.framework.pipe.OrderedGrowableArrayPipeFactory teetime.framework.pipe.OrderedGrowableArrayPipeFactory
teetime.framework.pipe.UnorderedGrowablePipeFactory 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; ...@@ -10,11 +10,14 @@ import java.util.List;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactoryLoader;
public class FileSearcherTest { public class FileSearcherTest {
@Test @Test
public void fileInClasspath() throws IOException { 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()); Assert.assertEquals(false, list.isEmpty());
} }
...@@ -32,7 +35,15 @@ public class FileSearcherTest { ...@@ -32,7 +35,15 @@ public class FileSearcherTest {
@Test @Test
public void emptyConfig() throws IOException { 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 { 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