diff --git a/DataAnonymizer/src/main/java/com/strider/dataanonymizer/ColumnDiscoverer.java b/DataAnonymizer/src/main/java/com/strider/dataanonymizer/ColumnDiscoverer.java index d2fce215..659f38f0 100644 --- a/DataAnonymizer/src/main/java/com/strider/dataanonymizer/ColumnDiscoverer.java +++ b/DataAnonymizer/src/main/java/com/strider/dataanonymizer/ColumnDiscoverer.java @@ -63,7 +63,6 @@ public List discover(IDBFactory factory, Properties columnPropert continue; } if (p.matcher(columnName.toLowerCase()).matches()) { - // System.out.println(data.toVerboseStr()); log.debug(data.toVerboseStr()); matches.add(data); } diff --git a/DataAnonymizer/src/test/java/com/strider/dataanonymizer/DatabaseAnonymizerTest.java b/DataAnonymizer/src/test/java/com/strider/dataanonymizer/DatabaseAnonymizerTest.java index 88f06c3c..ae5c62dc 100644 --- a/DataAnonymizer/src/test/java/com/strider/dataanonymizer/DatabaseAnonymizerTest.java +++ b/DataAnonymizer/src/test/java/com/strider/dataanonymizer/DatabaseAnonymizerTest.java @@ -26,12 +26,17 @@ import org.junit.Test; import com.strider.dataanonymizer.database.H2DB; +import org.apache.log4j.Logger; +import static org.apache.log4j.Logger.getLogger; /** * @author Akira Matsuo */ public class DatabaseAnonymizerTest extends H2DB { + private static final Logger log = getLogger(DatabaseAnonymizerTest.class); + + @SuppressWarnings("serial") final Properties sampleAProps = new Properties() {{ setProperty("batch_size", "10" ); @@ -39,9 +44,9 @@ public class DatabaseAnonymizerTest extends H2DB { }}; private void printLine(ResultSet rs) throws SQLException { - System.out.println("Print Line..."); + log.debug("Print Line..."); while (rs.next()) { - System.out.println(rs.getInt("id") + ": " + rs.getString("fname") + ", " + rs.getString("lname")); + log.debug(rs.getInt("id") + ": " + rs.getString("fname") + ", " + rs.getString("lname")); } } // Note: if this test fails w/ NoSuchMethodException and running in an IDE ensure that the -parameter is passed to compiler diff --git a/DataAnonymizer/src/test/java/com/strider/dataanonymizer/database/MSSQLDBConnectionTest.java b/DataAnonymizer/src/test/java/com/strider/dataanonymizer/database/MSSQLDBConnectionTest.java index cfd4331f..eb834270 100644 --- a/DataAnonymizer/src/test/java/com/strider/dataanonymizer/database/MSSQLDBConnectionTest.java +++ b/DataAnonymizer/src/test/java/com/strider/dataanonymizer/database/MSSQLDBConnectionTest.java @@ -31,6 +31,8 @@ import org.mockito.runners.MockitoJUnitRunner; import com.strider.dataanonymizer.utils.ISupplierWithException; +import org.apache.log4j.Logger; +import static org.apache.log4j.Logger.getLogger; /** * Using mock to test Connection. @@ -38,6 +40,11 @@ */ @RunWith(MockitoJUnitRunner.class) public class MSSQLDBConnectionTest { + + + private static final Logger log = getLogger(MSSQLDBConnectionTest.class); + + @SuppressWarnings("serial") private Properties testProps = new Properties() {{ setProperty("vendor", "mssql"); @@ -61,7 +68,7 @@ protected Connection doConnect(ISupplierWithException field.setAccessible(true); try { // not exactly a great test, but checks that supplier has parent's properties at least String representation = ReflectionToStringBuilder.toString(field.get(supplier)); - System.out.println(representation); + log.debug(representation); assertTrue(representation.contains( "[driver=java.util.List,vendor=mssql,url=invalid-url,userName=invalid-user,password=invalid-pass]")); } catch (IllegalArgumentException | IllegalAccessException e) {