diff --git a/extensions/database/src/com/google/refine/extension/database/DBQueryResultImportReader.java b/extensions/database/src/com/google/refine/extension/database/DBQueryResultImportReader.java index 2deb98bfa..0da3fa055 100644 --- a/extensions/database/src/com/google/refine/extension/database/DBQueryResultImportReader.java +++ b/extensions/database/src/com/google/refine/extension/database/DBQueryResultImportReader.java @@ -76,7 +76,9 @@ public class DBQueryResultImportReader implements TableDataReader { this.dbColumns = columns; this.databaseService = databaseService; this.dbQueryInfo = dbQueryInfo; - logger.info("batchSize:" + batchSize); + if(logger.isDebugEnabled()) { + logger.debug("batchSize:" + batchSize); + } } @@ -119,7 +121,7 @@ public class DBQueryResultImportReader implements TableDataReader { } if(processedRows % 10000 == 0) { if(logger.isDebugEnabled()) { - logger.debug("[[ {} rows processed... ]]",processedRows); + logger.debug("[[ {} rows processed... ]]",processedRows); } } } diff --git a/extensions/database/src/com/google/refine/extension/database/DatabaseImportController.java b/extensions/database/src/com/google/refine/extension/database/DatabaseImportController.java index 8a3e460e2..51cc2175e 100644 --- a/extensions/database/src/com/google/refine/extension/database/DatabaseImportController.java +++ b/extensions/database/src/com/google/refine/extension/database/DatabaseImportController.java @@ -465,7 +465,9 @@ public class DatabaseImportController implements ImportingController { jdbcConfig.setDatabaseSchema(request.getParameter("initialSchema")); String query = request.getParameter("query"); - logger.info("jdbcConfig::{}, query::{}", jdbcConfig, query); + if(logger.isDebugEnabled()) { + logger.debug("jdbcConfig::{}, query::{}", jdbcConfig, query); + } if (jdbcConfig.getDatabaseHost() == null || jdbcConfig.getDatabaseName() == null || jdbcConfig.getDatabasePassword() == null || jdbcConfig.getDatabaseType() == null || jdbcConfig.getDatabaseUser() == null || query == null) { diff --git a/extensions/database/src/com/google/refine/extension/database/DatabaseUtils.java b/extensions/database/src/com/google/refine/extension/database/DatabaseUtils.java index 4b96d1a21..db6960581 100644 --- a/extensions/database/src/com/google/refine/extension/database/DatabaseUtils.java +++ b/extensions/database/src/com/google/refine/extension/database/DatabaseUtils.java @@ -182,7 +182,9 @@ public class DatabaseUtils { public static void deleteAllSavedConnections() { - logger.info("delete All Saved Connections called..."); + if(logger.isDebugEnabled()) { + logger.debug("delete All Saved Connections called..."); + } try { @@ -221,8 +223,9 @@ public class DatabaseUtils { * @param connectionName */ public static void deleteSavedConnections(String connectionName) { - - logger.info("deleteSavedConnections called with: {}", connectionName); + if(logger.isDebugEnabled()) { + logger.debug("deleteSavedConnections called with: {}", connectionName); + } try { diff --git a/extensions/database/src/com/google/refine/extension/database/cmd/SavedConnectionCommand.java b/extensions/database/src/com/google/refine/extension/database/cmd/SavedConnectionCommand.java index 12ba7b4e3..4084972c5 100644 --- a/extensions/database/src/com/google/refine/extension/database/cmd/SavedConnectionCommand.java +++ b/extensions/database/src/com/google/refine/extension/database/cmd/SavedConnectionCommand.java @@ -91,7 +91,7 @@ public class SavedConnectionCommand extends DatabaseCommand { DatabaseConfiguration savedConn = DatabaseUtils.getSavedConnection(connectionName); if(savedConn == null) { - logger.error("Connection With name:: {} does not exist!", request.getParameter("connectionName")); + //logger.error("Connection With name:: {} does not exist!", request.getParameter("connectionName")); response.sendError(HttpStatus.SC_BAD_REQUEST, "Connection with name " + connectionName + " does not exists!"); response.flushBuffer(); return; @@ -246,7 +246,7 @@ public class SavedConnectionCommand extends DatabaseCommand { throws ServletException, IOException { if(logger.isDebugEnabled()) { - logger.info("doPost Connection: {}", request.getParameter("connectionName")); + logger.debug("doPost Connection: {}", request.getParameter("connectionName")); } DatabaseConfiguration jdbcConfig = getJdbcConfiguration(request); @@ -297,7 +297,7 @@ public class SavedConnectionCommand extends DatabaseCommand { if(logger.isDebugEnabled()) { logger.debug("databaseType::{} " , request.getParameter("databaseHost")); } - logger.info("databaseHost::{} " , request.getParameter("databaseServer")); + // logger.info("databaseHost::{} " , request.getParameter("databaseServer")); DatabaseConfiguration jdbcConfig = getJdbcConfiguration(request); StringBuilder sb = new StringBuilder(); diff --git a/extensions/database/test/com/google/refine/extension/database/DatabaseServiceTest.java b/extensions/database/test/com/google/refine/extension/database/DatabaseServiceTest.java index f65649e75..ddd0eda7e 100644 --- a/extensions/database/test/com/google/refine/extension/database/DatabaseServiceTest.java +++ b/extensions/database/test/com/google/refine/extension/database/DatabaseServiceTest.java @@ -51,17 +51,12 @@ public class DatabaseServiceTest extends DBExtensionTests{ } -// @AfterSuite -// public void afterSuite() { -// DBExtensionTestUtils.cleanUpTestData(testDbConfig); -// -// } + @Test public void testGetDatabaseUrl() { DatabaseService dbService = DatabaseService.get(testDbConfig.getDatabaseType()); String dbUrl = dbService.getDatabaseUrl(testDbConfig); - // System.out.println("dbUrl:" + dbUrl); Assert.assertNotNull(dbUrl); Assert.assertEquals(dbUrl, DBExtensionTestUtils.getJDBCUrl(testDbConfig)); } @@ -99,7 +94,6 @@ public class DatabaseServiceTest extends DBExtensionTests{ DatabaseService dbService = DatabaseService.get(testDbConfig.getDatabaseType()); Connection conn = dbService.getConnection(testDbConfig); - //System.out.println("conn:" + conn); Assert.assertNotNull(conn); } catch (DatabaseServiceException e) { @@ -173,7 +167,7 @@ public class DatabaseServiceTest extends DBExtensionTests{ Assert.assertNotNull(dbColumns); int cols = dbColumns.size(); - Assert.assertEquals(cols, 3); + Assert.assertEquals(cols, 10); } catch (DatabaseServiceException e) { diff --git a/extensions/database/test/com/google/refine/extension/database/cmd/ConnectCommandTest.java b/extensions/database/test/com/google/refine/extension/database/cmd/ConnectCommandTest.java index e98ee6cce..a94f43cab 100644 --- a/extensions/database/test/com/google/refine/extension/database/cmd/ConnectCommandTest.java +++ b/extensions/database/test/com/google/refine/extension/database/cmd/ConnectCommandTest.java @@ -44,7 +44,7 @@ public class ConnectCommandTest extends DBExtensionTests { @Optional(DEFAULT_MYSQL_PASSWORD) String mySqlDbPassword, @Optional(DEFAULT_TEST_TABLE) String mySqlTestTable) { MockitoAnnotations.initMocks(this); - // System.out.println("beforeTest " + pgSqlDbName); + testDbConfig = new DatabaseConfiguration(); testDbConfig.setDatabaseHost(mySqlDbHost); testDbConfig.setDatabaseName(mySqlDbName); @@ -60,13 +60,7 @@ public class ConnectCommandTest extends DBExtensionTests { DatabaseService.DBType.registerDatabase(MySQLDatabaseService.DB_NAME, MySQLDatabaseService.getInstance()); } - -// @AfterSuite -// public void afterSuite() { -// DBExtensionTestUtils.cleanUpTestData(testDbConfig); -// -// } -// + @Test public void testDoPost() { diff --git a/extensions/database/test/com/google/refine/extension/database/cmd/ExecuteQueryCommandTest.java b/extensions/database/test/com/google/refine/extension/database/cmd/ExecuteQueryCommandTest.java index cb46ce221..30bcd544f 100644 --- a/extensions/database/test/com/google/refine/extension/database/cmd/ExecuteQueryCommandTest.java +++ b/extensions/database/test/com/google/refine/extension/database/cmd/ExecuteQueryCommandTest.java @@ -58,13 +58,6 @@ public class ExecuteQueryCommandTest extends DBExtensionTests { DatabaseService.DBType.registerDatabase(MySQLDatabaseService.DB_NAME, MySQLDatabaseService.getInstance()); } -// -// @AfterSuite -// public void afterSuite() { -// DBExtensionTestUtils.cleanUpTestData(testDbConfig); -// -// } - @Test public void testDoPost() { diff --git a/extensions/database/test/com/google/refine/extension/database/cmd/TestConnectCommandTest.java b/extensions/database/test/com/google/refine/extension/database/cmd/TestConnectCommandTest.java index 024f647e3..f59db52b9 100644 --- a/extensions/database/test/com/google/refine/extension/database/cmd/TestConnectCommandTest.java +++ b/extensions/database/test/com/google/refine/extension/database/cmd/TestConnectCommandTest.java @@ -60,11 +60,7 @@ public class TestConnectCommandTest extends DBExtensionTests{ } -// @AfterSuite -// public void afterSuite() { -// DBExtensionTestUtils.cleanUpTestData(testDbConfig); -// -// } + @Test public void testDoPost() { diff --git a/extensions/database/test/com/google/refine/extension/database/cmd/TestQueryCommandTest.java b/extensions/database/test/com/google/refine/extension/database/cmd/TestQueryCommandTest.java index 6b922226d..cd3100af7 100644 --- a/extensions/database/test/com/google/refine/extension/database/cmd/TestQueryCommandTest.java +++ b/extensions/database/test/com/google/refine/extension/database/cmd/TestQueryCommandTest.java @@ -59,12 +59,6 @@ public class TestQueryCommandTest extends DBExtensionTests { } -// @AfterSuite -// public void afterSuite() { -// DBExtensionTestUtils.cleanUpTestData(testDbConfig); -// -// } - @Test public void testDoPost() { diff --git a/extensions/database/test/com/google/refine/extension/database/mariadb/MariaDBConnectionManagerTest.java b/extensions/database/test/com/google/refine/extension/database/mariadb/MariaDBConnectionManagerTest.java index e5bab949e..a02d44a4f 100644 --- a/extensions/database/test/com/google/refine/extension/database/mariadb/MariaDBConnectionManagerTest.java +++ b/extensions/database/test/com/google/refine/extension/database/mariadb/MariaDBConnectionManagerTest.java @@ -46,12 +46,7 @@ public class MariaDBConnectionManagerTest extends DBExtensionTests { } -// @AfterSuite -// public void afterSuite() { -// DBExtensionTestUtils.cleanUpTestData(testDbConfig); -// -// } - + @Test public void testTestConnection() { diff --git a/extensions/database/test/com/google/refine/extension/database/mariadb/MariaDBDatabaseServiceTest.java b/extensions/database/test/com/google/refine/extension/database/mariadb/MariaDBDatabaseServiceTest.java index 9d57307a3..3456954e2 100644 --- a/extensions/database/test/com/google/refine/extension/database/mariadb/MariaDBDatabaseServiceTest.java +++ b/extensions/database/test/com/google/refine/extension/database/mariadb/MariaDBDatabaseServiceTest.java @@ -168,10 +168,5 @@ public class MariaDBDatabaseServiceTest extends DBExtensionTests{ } } - -// @AfterSuite -// public void afterSuite() { -// DBExtensionTestUtils.cleanUpTestData(testDbConfig); -// logger.info("<>"); -// } + } diff --git a/extensions/database/test/com/google/refine/extension/database/mysql/MySQLConnectionManagerTest.java b/extensions/database/test/com/google/refine/extension/database/mysql/MySQLConnectionManagerTest.java index 786c91bc2..70b560e7d 100644 --- a/extensions/database/test/com/google/refine/extension/database/mysql/MySQLConnectionManagerTest.java +++ b/extensions/database/test/com/google/refine/extension/database/mysql/MySQLConnectionManagerTest.java @@ -43,11 +43,7 @@ public class MySQLConnectionManagerTest extends DBExtensionTests { } -// @AfterSuite -// public void afterSuite() { -// DBExtensionTestUtils.cleanUpTestData(testDbConfig); -// } -// + @Test public void testTestConnection() { diff --git a/extensions/database/test/com/google/refine/extension/database/pgsql/PgSQLConnectionManagerTest.java b/extensions/database/test/com/google/refine/extension/database/pgsql/PgSQLConnectionManagerTest.java index b55cbeaa9..09b18bd11 100644 --- a/extensions/database/test/com/google/refine/extension/database/pgsql/PgSQLConnectionManagerTest.java +++ b/extensions/database/test/com/google/refine/extension/database/pgsql/PgSQLConnectionManagerTest.java @@ -28,7 +28,7 @@ public class PgSQLConnectionManagerTest extends DBExtensionTests { @Optional(DEFAULT_PGSQL_PASSWORD) String pgSqlDbPassword, @Optional(DEFAULT_TEST_TABLE) String pgSqlTestTable) { MockitoAnnotations.initMocks(this); - // System.out.println("beforeTest " + pgSqlDbName); + testDbConfig = new DatabaseConfiguration(); testDbConfig.setDatabaseHost(pgSqlDbHost); testDbConfig.setDatabaseName(pgSqlDbName); diff --git a/extensions/database/test/com/google/refine/extension/database/pgsql/PgSQLDatabaseServiceTest.java b/extensions/database/test/com/google/refine/extension/database/pgsql/PgSQLDatabaseServiceTest.java index f579c02ed..78b1ca8d2 100644 --- a/extensions/database/test/com/google/refine/extension/database/pgsql/PgSQLDatabaseServiceTest.java +++ b/extensions/database/test/com/google/refine/extension/database/pgsql/PgSQLDatabaseServiceTest.java @@ -33,7 +33,6 @@ public class PgSQLDatabaseServiceTest extends DBExtensionTests{ @Optional(DEFAULT_PGSQL_PASSWORD) String pgSqlDbPassword, @Optional(DEFAULT_TEST_TABLE) String pgSqlTestTable) { MockitoAnnotations.initMocks(this); - // System.out.println("beforeTest " + pgSqlDbName); testDbConfig = new DatabaseConfiguration(); testDbConfig.setDatabaseHost(pgSqlDbHost); testDbConfig.setDatabaseName(pgSqlDbName); @@ -55,7 +54,7 @@ public class PgSQLDatabaseServiceTest extends DBExtensionTests{ public void testGetDatabaseUrl() { PgSQLDatabaseService pgSqlService = (PgSQLDatabaseService)DatabaseService.get(PgSQLDatabaseService.DB_NAME); String dbUrl = pgSqlService.getDatabaseUrl(testDbConfig); - System.out.println("dbUrl:" + dbUrl); + Assert.assertNotNull(dbUrl); Assert.assertEquals(dbUrl, DBExtensionTestUtils.getJDBCUrl(testDbConfig)); }