Skip to content

Commit

Permalink
test to execute in build dir
Browse files Browse the repository at this point in the history
  • Loading branch information
markodjurovic committed Oct 22, 2018
1 parent be06765 commit be3837a
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,22 @@
*/
public class OETLProcessorTest extends OETLBaseTest {

private static final String databaseDir = "./target/databases/";

@Before
public void setUp() throws Exception {
OFileUtils.deleteRecursively(new File("./target/databases/"));
OFileUtils.deleteRecursively(new File(databaseDir));

}

@Test
public void testMain() throws Exception {

final OETLProcessor processor = new OETLProcessorConfigurator()
.parseConfigAndParameters(new String[] { "-dbURL=plocal:/tmp/orientDBoetl/testMain",
.parseConfigAndParameters(new String[] { "-dbURL=plocal:" + databaseDir + "orientDBoetl/testMain",
"./src/test/resources/comment.json" });

assertThat(processor.getContext().getVariable("dbURL")).isEqualTo("plocal:/tmp/orientDBoetl/testMain");
assertThat(processor.getContext().getVariable("dbURL")).isEqualTo("plocal:" + databaseDir + "orientDBoetl/testMain");

OETLOrientDBLoader loader = (OETLOrientDBLoader) processor.getLoader();
loader.getPool().close();
Expand All @@ -58,11 +60,11 @@ public void testMain() throws Exception {
public void shouldParseSplitConfiguration() throws Exception {

final OETLProcessor processor = new OETLProcessorConfigurator()
.parseConfigAndParameters(new String[] { "-dbURL=plocal:/tmp/orientDBoetl/shouldParseSplitConfiguration",
.parseConfigAndParameters(new String[] { "-dbURL=plocal:" + databaseDir + "orientDBoetl/shouldParseSplitConfiguration",
"./src/test/resources/comment_split_1.json",
"./src/test/resources/comment_split_2.json" });

assertThat(processor.getContext().getVariable("dbURL")).isEqualTo("plocal:/tmp/orientDBoetl/shouldParseSplitConfiguration");
assertThat(processor.getContext().getVariable("dbURL")).isEqualTo("plocal:"+ databaseDir + "orientDBoetl/shouldParseSplitConfiguration");
assertThat(processor.getTransformers().get(0)).isInstanceOf(OETLVertexTransformer.class);
assertThat(processor.getExtractor().getName()).isEqualTo("csv");
OETLOrientDBLoader loader = (OETLOrientDBLoader) processor.getLoader();
Expand All @@ -75,7 +77,7 @@ public void shouldParseSplitConfiguration() throws Exception {
public void shouldExceuteBeginBlocktoExpandVariables() throws Exception {

final OETLProcessor processor = new OETLProcessorConfigurator()
.parseConfigAndParameters(new String[] { "-dbURL=plocal:/tmp/orientDBoetl/shouldExceuteBeginBlocktoExpandVariables",
.parseConfigAndParameters(new String[] { "-dbURL=plocal:"+ databaseDir + "orientDBoetl/shouldExceuteBeginBlocktoExpandVariables",
"./src/test/resources/comment.json" });

assertThat(processor.context.getVariable("filePath")).isEqualTo("./src/test/resources/comments.csv");
Expand Down

0 comments on commit be3837a

Please sign in to comment.