Skip to content

Commit 2ace1f8

Browse files
committed
[more tests] rewrite as sysdba tests to simulate command line args
1 parent 1c37947 commit 2ace1f8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/test/java/com/googlecode/scheme2ddl/MainIT.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ public void testRunWithConfigPath() throws Exception {
244244
@Test
245245
public void testRunAsSysDbaTestConnection() throws Exception {
246246
String outputPath = tempOutput.getAbsolutePath();
247-
String[] args = {"-url", dbaAsSysdbaUrl, "-tc"};
247+
String dba[] = dbaAsSysdbaUrl.split(" ");
248+
assertTrue(dba.length==3);
249+
String[] args = {"-url", dba[0], dba[1], dba[2], "-tc"};
248250
Main.main(args);
249251
Assert.assertEquals(
250252
outContent.toString(),
@@ -256,7 +258,9 @@ public void testRunAsSysDbaTestConnection() throws Exception {
256258
@Test
257259
public void testRunAsSysDbaWithTypeFilter() throws Exception {
258260
String outputPath = tempOutput.getAbsolutePath();
259-
String[] args = {"-url", dbaAsSysdbaUrl, "--type-filter", "'SCHEDULE', 'JOB'"};
261+
String dba[] = dbaAsSysdbaUrl.split(" ");
262+
assertTrue(dba.length==3);
263+
String[] args = {"-url", dba[0], dba[1], dba[2], "--type-filter", "'SCHEDULE', 'JOB'"};
260264
Main.main(args);
261265
String out = outContent.toString();
262266
assertThat(out, containsString("Will try to process schema [SYS]"));
@@ -320,7 +324,9 @@ public void testCustomConfigWithSchemaList() throws Exception {
320324
@Test
321325
public void testCustomConfigWithSchemaListAsDba() throws Exception {
322326
String outputPath = tempOutput.getAbsolutePath();
323-
String[] args = {"-url", dbaAsSysdbaUrl, "-c", "src/test/resources/test_schema_list.config.xml", "-o", outputPath};
327+
String dba[] = dbaAsSysdbaUrl.split(" ");
328+
assertTrue(dba.length==3);
329+
String[] args = {"-url", dba[0], dba[1], dba[2], "-c", "src/test/resources/test_schema_list.config.xml", "-o", outputPath};
324330
Main.main(args);
325331
String out = outContent.toString();
326332
assertThat(out, not(containsString("Ignore 'schemaList' from advanced config, because oracle user is not connected as sys dba")));

0 commit comments

Comments
 (0)