Skip to content

Commit

Permalink
changed module names
Browse files Browse the repository at this point in the history
  • Loading branch information
chalkos committed Nov 3, 2015
1 parent 96a5bde commit 0b189ad
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 66 deletions.
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,79 +33,79 @@ Usage: dbptk [plugin] <importModule> [import module options] <exportModule> [exp
## Available import modules: -i <module>, --import=module
Import module: MySQLJDBC
Import module: microsoft-sql-server
-is, --import-server-name=value (required) the name (host name) of the server
-idb, --import-database=value (required) the name of the database we'll be accessing
-iu, --import-username=value (required) the name of the user to use in the connection
-ip, --import-password=value (required) the password of the user to use in the connection
-il, --import-use-integrated-login (optional) use windows login; by default the SQL Server login is used
-ide, --import-disable-encryption (optional) use to turn off encryption in the connection
-iin, --import-instance-name=value (optional) the name of the instance
-ipn, --import-port-number=value (optional) the port number of the server instance, default is 1433
Import module: mysql
-ih, --import-hostname=value (required) the hostname of the MySQL server
-idb, --import-database=value (required) the name of the database to import from
-iu, --import-username=value (required) the name of the user to use in connection
-ip, --import-password=value (required) the password of the user to use in connection
-ipn, --import-port-number=value (optional) the port that the MySQL server is listening
Import module: PostgreSQLJDBC
Import module: postgresql
-ih, --import-hostname=value (required) the name of the PostgreSQL server host (e.g. localhost)
-idb, --import-database=value (required) the name of the database to connect to
-iu, --import-username=value (required) the name of the user to use in connection
-ip, --import-password=value (required) the password of the user to use in connection
-ide, --import-disable-encryption (optional) use to turn off encryption in the connection
-ipn, --import-port-number=value (optional) the port of where the PostgreSQL server is listening, default is 5432
Import module: SIARD1
Import module: siard-1
-if, --import-file=value (required) Path to SIARD1 archive file
Import module: SIARD2
Import module: siard-2
-if, --import-file=value (required) Path to SIARD2 archive file
Import module: SQLServerJDBC
-is, --import-server-name=value (required) the name (host name) of the server
-idb, --import-database=value (required) the name of the database we'll be accessing
-iu, --import-username=value (required) the name of the user to use in the connection
-ip, --import-password=value (required) the password of the user to use in the connection
-il, --import-use-integrated-login (optional) use windows login; by default the SQL Server login is used
-ide, --import-disable-encryption (optional) use to turn off encryption in the connection
-iin, --import-instance-name=value (optional) the name of the instance
-ipn, --import-port-number=value (optional) the port number of the server instance, default is 1433
## Available export modules: -e <module>, --export=module
Export module: MySQLJDBC
Export module: microsoft-sql-server
-es, --export-server-name=value (required) the name (host name) of the server
-edb, --export-database=value (required) the name of the database we'll be accessing
-eu, --export-username=value (required) the name of the user to use in the connection
-ep, --export-password=value (required) the password of the user to use in the connection
-el, --export-use-integrated-login (optional) use windows login; by default the SQL Server login is used
-ede, --export-disable-encryption (optional) use to turn off encryption in the connection
-ein, --export-instance-name=value (optional) the name of the instance
-epn, --export-port-number=value (optional) the port number of the server instance, default is 1433
Export module: mysql
-eh, --export-hostname=value (required) the hostname of the MySQL server
-edb, --export-database=value (required) the name of the database to import from
-eu, --export-username=value (required) the name of the user to use in connection
-ep, --export-password=value (required) the password of the user to use in connection
-epn, --export-port-number=value (optional) the port that the MySQL server is listening
Export module: PostgreSQLJDBC
Export module: postgresql
-eh, --export-hostname=value (required) the name of the PostgreSQL server host (e.g. localhost)
-edb, --export-database=value (required) the name of the database to connect to
-eu, --export-username=value (required) the name of the user to use in connection
-ep, --export-password=value (required) the password of the user to use in connection
-ede, --export-disable-encryption (optional) use to turn off encryption in the connection
-epn, --export-port-number=value (optional) the port of where the PostgreSQL server is listening, default is 5432
Export module: SIARD1
Export module: siard-1
-ef, --export-file=value (required) Path to SIARD1 archive file
-ec, --export-compress (optional) use to compress the SIARD1 archive file with deflate method
-ep, --export-pretty-xml (optional) write human-readable XML
Export module: SIARD2
Export module: siard-2
-ef, --export-file=value (required) Path to SIARD2 archive file
-ec, --export-compress (optional) use to compress the SIARD2 archive file with deflate method
-ep, --export-pretty-xml (optional) write human-readable XML
Export module: SIARDDK
Export module: siard-dk
-ef, --export-folder=value (required) Path to SIARDDK archive folder
-eai, --export-archiveIndex=value (optional) Path to archiveIndex.xml input file
-eci, --export-contextDocumentationIndex=value (optional) Path to contextDocumentationIndex.xml input file
-ecf, --export-contextDocumentationFolder=value (optional) Path to contextDocumentation folder which should contain the context documentation for the archive
Export module: SQLServerJDBC
-es, --export-server-name=value (required) the name (host name) of the server
-edb, --export-database=value (required) the name of the database we'll be accessing
-eu, --export-username=value (required) the name of the user to use in the connection
-ep, --export-password=value (required) the password of the user to use in the connection
-el, --export-use-integrated-login (optional) use windows login; by default the SQL Server login is used
-ede, --export-disable-encryption (optional) use to turn off encryption in the connection
-ein, --export-instance-name=value (optional) the name of the instance
-epn, --export-port-number=value (optional) the port number of the server instance, default is 1433
```

You have to select an input and an output module, providing for each its configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ private DatabaseModuleFactoriesPair getModuleFactories(List<String> args) throws
DatabaseModuleFactory exportModuleFactory = null;
for (DatabaseModuleFactory factory : factories) {
String moduleName = factory.getModuleName();
if (moduleName.equals(importModuleName) && factory.producesImportModules()) {
if (moduleName.equalsIgnoreCase(importModuleName) && factory.producesImportModules()) {
importModuleFactory = factory;
}
if (moduleName.equals(exportModuleName) && factory.producesExportModules()) {
if (moduleName.equalsIgnoreCase(exportModuleName) && factory.producesExportModules()) {
exportModuleFactory = factory;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public boolean producesExportModules() {

@Override
public String getModuleName() {
return "DB2JDBC";
return "db2";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public boolean producesExportModules() {

@Override
public String getModuleName() {
return "MySQLJDBC";
return "mysql";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public boolean producesExportModules() {

@Override
public String getModuleName() {
return "PostgreSQLJDBC";
return "postgresql";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public boolean producesExportModules() {

@Override
public String getModuleName() {
return "SIARD1";
return "siard-1";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public boolean producesExportModules() {

@Override
public String getModuleName() {
return "SIARD2";
return "siard-2";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public boolean producesExportModules() {

@Override
public String getModuleName() {
return "SIARDDK";
return "siard-dk";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public boolean producesExportModules() {

@Override
public String getModuleName() {
return "SQLServerJDBC";
return "microsoft-sql-server";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public void setup() throws IOException, InterruptedException, URISyntaxException
db_source), String.format("mysqldump -v --user=\"%s\" --password=\"%s\" %s --compact", db_tmp_username,
db_tmp_password, db_target),

new String[] {"--import=MySQLJDBC", "--import-hostname=localhost", "--import-database", db_source,
"--import-username", db_tmp_username, "--import-password", db_tmp_password, "--export=SIARD1",
new String[] {"--import=mysql", "--import-hostname=localhost", "--import-database", db_source,
"--import-username", db_tmp_username, "--import-password", db_tmp_password, "--export=siard-1",
"--export-compress", "--export-file", Roundtrip.TMP_FILE_SIARD_VAR},

new String[] {"--import=SIARD1", "--import-file", Roundtrip.TMP_FILE_SIARD_VAR, "--export=MySQLJDBC",
new String[] {"--import=siard-1", "--import-file", Roundtrip.TMP_FILE_SIARD_VAR, "--export=mysql",
"--export-hostname=localhost", "--export-database", db_target, "--export-username", db_tmp_username,
"--export-password", db_tmp_password},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ public void setup() throws IOException, InterruptedException, URISyntaxException
"pg_dump --format plain --no-owner --no-privileges --column-inserts --no-security-labels --no-tablespaces",
"pg_dump --format plain --no-owner --no-privileges --column-inserts --no-security-labels --no-tablespaces",

new String[] {"--import=PostgreSQLJDBC", "--import-hostname=localhost", "--import-database", db_source,
new String[] {"--import=postgresql", "--import-hostname=localhost", "--import-database", db_source,
"--import-username", db_tmp_username, "--import-password", db_tmp_password, "--import-disable-encryption",
"--export=SIARD1", "--export-file", Roundtrip.TMP_FILE_SIARD_VAR},
"--export=siard-1", "--export-file", Roundtrip.TMP_FILE_SIARD_VAR},

new String[] {"--import=SIARD1", "--import-file", Roundtrip.TMP_FILE_SIARD_VAR, "--export=PostgreSQLJDBC",
new String[] {"--import=siard-1", "--import-file", Roundtrip.TMP_FILE_SIARD_VAR, "--export=postgresql",
"--export-hostname=localhost", "--export-database", db_target, "--export-username", db_tmp_username,
"--export-password", db_tmp_password, "--export-disable-encryption"}, new PostgreSqlDumpDiffExpectations(),
env_var_source, env_var_target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ private Connection setup() throws SQLException {
public void testConnection() throws IOException, InterruptedException, SQLException {
setup();

Main.internal_main("-i", "SQLServerJDBC", "-is", SERVER_NAME, "-iin", INSTANCE_NAME, "-idb", db_source, "-iu",
USERNAME, "-ip", PASSWORD, "-e", "SIARD1", "-ef", SIARD_FILE, "-ide");
Main.internal_main("-i", "microsoft-sql-server", "-is", SERVER_NAME, "-iin", INSTANCE_NAME, "-idb", db_source, "-iu",
USERNAME, "-ip", PASSWORD, "-e", "siard-1", "-ef", SIARD_FILE, "-ide");

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public class PostgreSQLModuleFactoryTest {

@Test
public void arguments_required_long() {
List<String> args = Arrays.asList("--import=PostgreSQLJDBC", "--import-username=name-user",
List<String> args = Arrays.asList("--import=postgresql", "--import-username=name-user",
"--import-password=abc1 23=456", "--import-hostname=the-server-name", "--import-database=dbname",
"--export=PostgreSQLJDBC", "--export-username=name-another-user", "--export-password=2bcd123=456",
"--export=postgresql", "--export-username=name-another-user", "--export-password=2bcd123=456",
"--export-hostname=another-server", "--export-database=another-db-name", "--import-disable-encryption");

// test parameters for import module
Expand All @@ -50,8 +50,8 @@ public void arguments_required_long() {

@Test
public void arguments_required_short() {
List<String> args = Arrays.asList("-i", "PostgreSQLJDBC", "-iu", "name-user", "-ip", "abc1 23=456", "-ih",
"the-server-name", "-idb", "dbname", "-e", "PostgreSQLJDBC", "-eu", "name-another-user", "-ep", "2bcd123=456",
List<String> args = Arrays.asList("-i", "postgresql", "-iu", "name-user", "-ip", "abc1 23=456", "-ih",
"the-server-name", "-idb", "dbname", "-e", "postgresql", "-eu", "name-another-user", "-ep", "2bcd123=456",
"-eh", "another-server", "-edb", "another-db-name", "-ede");

// test parameters for import module
Expand All @@ -75,9 +75,9 @@ public void arguments_required_short() {

@Test
public void arguments_portNumber_long() {
List<String> args = Arrays.asList("--import=PostgreSQLJDBC", "--import-username=name-user",
List<String> args = Arrays.asList("--import=postgresql", "--import-username=name-user",
"--import-password=abc1 23=456", "--import-hostname=the-server-name", "--import-database=dbname",
"--export=PostgreSQLJDBC", "--export-username=name-another-user", "--export-password=2bcd123=456",
"--export=postgresql", "--export-username=name-another-user", "--export-password=2bcd123=456",
"--export-hostname=another-server", "--export-database=another-db-name", "--import-disable-encryption",
"--import-port-number=1234", "--export-port-number=4321");

Expand All @@ -103,8 +103,8 @@ public void arguments_portNumber_long() {

@Test
public void arguments_portNumber_short() {
List<String> args = Arrays.asList("-i", "PostgreSQLJDBC", "-iu", "name-user", "-ip", "abc1 23=456", "-ih",
"the-server-name", "-idb", "dbname", "-e", "PostgreSQLJDBC", "-eu", "name-another-user", "-ep", "2bcd123=456",
List<String> args = Arrays.asList("-i", "postgresql", "-iu", "name-user", "-ip", "abc1 23=456", "-ih",
"the-server-name", "-idb", "dbname", "-e", "postgresql", "-eu", "name-another-user", "-ep", "2bcd123=456",
"-eh", "another-server", "-edb", "another-db-name", "-ede", "-ipn", "4567", "-epn", "7654");

// test parameters for import module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public class SQLServerJDBCModuleFactoryTest {

@Test
public void arguments_required_long() {
List<String> args = Arrays.asList("--import=SQLServerJDBC", "--import-username=name-user",
List<String> args = Arrays.asList("--import=microsoft-sql-server", "--import-username=name-user",
"--import-password=abc1 23=456", "--import-server-name=the-server-name", "--import-database=dbname",
"--import-disable-encryption", "--export=SQLServerJDBC", "--export-username=name-another-user",
"--import-disable-encryption", "--export=microsoft-sql-server", "--export-username=name-another-user",
"--export-password=2bcd123=456", "--export-server-name=another-server", "--export-database=another-db-name");

// test parameters for import module
Expand All @@ -50,8 +50,8 @@ public void arguments_required_long() {

@Test
public void arguments_required_short() {
List<String> args = Arrays.asList("-i", "SQLServerJDBC", "-iu", "name-user", "-ip", "abc1 23=456", "-is",
"the-server-name", "-idb", "dbname", "-e", "SQLServerJDBC", "-eu", "name-another-user", "-ep", "2bcd123=456",
List<String> args = Arrays.asList("-i", "microsoft-sql-server", "-iu", "name-user", "-ip", "abc1 23=456", "-is",
"the-server-name", "-idb", "dbname", "-e", "microsoft-sql-server", "-eu", "name-another-user", "-ep", "2bcd123=456",
"-es", "another-server", "-ede", "-edb", "another-db-name");

// test parameters for import module
Expand All @@ -74,8 +74,8 @@ public void arguments_required_short() {

@Test
public void arguments_instanceName_short() {
List<String> args = Arrays.asList("-i", "SQLServerJDBC", "-iu", "name-user", "-ip", "abc1 23=456", "-is",
"the-server-name", "-idb", "dbname", "-iin", "name-for-the-instance", "-e", "SQLServerJDBC", "-eu",
List<String> args = Arrays.asList("-i", "microsoft-sql-server", "-iu", "name-user", "-ip", "abc1 23=456", "-is",
"the-server-name", "-idb", "dbname", "-iin", "name-for-the-instance", "-e", "microsoft-sql-server", "-eu",
"name-another-user", "-ep", "2bcd123=456", "-es", "another-server", "-edb", "another-db-name", "-ein",
"name-for-another-instance");

Expand All @@ -100,9 +100,9 @@ public void arguments_instanceName_short() {

@Test
public void arguments_instanceName_long() {
List<String> args = Arrays.asList("--import=SQLServerJDBC", "--import-username=name-user",
List<String> args = Arrays.asList("--import=microsoft-sql-server", "--import-username=name-user",
"--import-password=abc1 23=456", "--import-server-name=the-server-name", "--import-database=dbname",
"--import-instance-name=name-for-the-instance", "--export=SQLServerJDBC", "--export-username=name-another-user",
"--import-instance-name=name-for-the-instance", "--export=microsoft-sql-server", "--export-username=name-another-user",
"--export-password=2bcd123=456", "--export-server-name=another-server", "--export-database=another-db-name",
"--export-instance-name=name-for-another-instance");

Expand All @@ -127,8 +127,8 @@ public void arguments_instanceName_long() {

@Test
public void arguments_portNumber_short() {
List<String> args = Arrays.asList("-i", "SQLServerJDBC", "-iu", "name-user", "-ip", "abc1 23=456", "-is",
"the-server-name", "-idb", "dbname", "-ipn", "1234", "-e", "SQLServerJDBC", "-eu", "name-another-user", "-ep",
List<String> args = Arrays.asList("-i", "microsoft-sql-server", "-iu", "name-user", "-ip", "abc1 23=456", "-is",
"the-server-name", "-idb", "dbname", "-ipn", "1234", "-e", "microsoft-sql-server", "-eu", "name-another-user", "-ep",
"2bcd123=456", "-es", "another-server", "-edb", "another-db-name", "-epn", "4321");

// test parameters for import module
Expand All @@ -152,9 +152,9 @@ public void arguments_portNumber_short() {

@Test
public void arguments_portNumber_long() {
List<String> args = Arrays.asList("--import=SQLServerJDBC", "--import-username=name-user",
List<String> args = Arrays.asList("--import=microsoft-sql-server", "--import-username=name-user",
"--import-password=abc1 23=456", "--import-server-name=the-server-name", "--import-database=dbname",
"--import-port-number=1234", "--export=SQLServerJDBC", "--export-username=name-another-user",
"--import-port-number=1234", "--export=microsoft-sql-server", "--export-username=name-another-user",
"--export-password=2bcd123=456", "--export-server-name=another-server", "--export-database=another-db-name",
"--export-port-number=4321");

Expand Down

0 comments on commit 0b189ad

Please sign in to comment.