Skip to content

Commit

Permalink
Getting rid of System.out.println() statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
armenak committed Aug 23, 2015
1 parent 9415162 commit 6b87559
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public List<MatchMetaData> discover(IDBFactory factory, Properties columnPropert
continue;
}
if (p.matcher(columnName.toLowerCase()).matches()) {
// System.out.println(data.toVerboseStr());
log.debug(data.toVerboseStr());
matches.add(data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,27 @@
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" );
setProperty("requirement", "target/test-classes/Requirement-H2DB.xml");
}};

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@
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.
* @author Akira Matsuo
*/
@RunWith(MockitoJUnitRunner.class)
public class MSSQLDBConnectionTest {


private static final Logger log = getLogger(MSSQLDBConnectionTest.class);


@SuppressWarnings("serial")
private Properties testProps = new Properties() {{
setProperty("vendor", "mssql");
Expand All @@ -61,7 +68,7 @@ protected Connection doConnect(ISupplierWithException<Connection, SQLException>
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) {
Expand Down

0 comments on commit 6b87559

Please sign in to comment.