Added logging to ExportDbTest to help debug on bamboo.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@34077 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2012-02-20 14:01:43 +00:00
parent 31872bfce7
commit 9c27f0f682

View File

@@ -25,6 +25,8 @@ import org.alfresco.util.schemacomp.ExportDb;
import org.alfresco.util.schemacomp.ExportDbTest; import org.alfresco.util.schemacomp.ExportDbTest;
import org.alfresco.util.schemacomp.model.DbObject; import org.alfresco.util.schemacomp.model.DbObject;
import org.alfresco.util.schemacomp.model.Schema; import org.alfresco.util.schemacomp.model.Schema;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.PlatformTransactionManager;
@@ -39,7 +41,7 @@ public abstract class AbstractExportTester
protected ExportDb exporter; protected ExportDb exporter;
protected PlatformTransactionManager tx; protected PlatformTransactionManager tx;
protected SimpleJdbcTemplate jdbcTemplate; protected SimpleJdbcTemplate jdbcTemplate;
private final static Log log = LogFactory.getLog(AbstractExportTester.class);
public AbstractExportTester(ExportDb exporter, PlatformTransactionManager tx, SimpleJdbcTemplate jdbcTemplate) public AbstractExportTester(ExportDb exporter, PlatformTransactionManager tx, SimpleJdbcTemplate jdbcTemplate)
{ {
@@ -56,8 +58,8 @@ public abstract class AbstractExportTester
{ {
doDatabaseSetup(); doDatabaseSetup();
exporter.execute(); exporter.execute();
// Dump the schema for diagnostics // Log the schema for diagnostics
System.out.println(getSchema()); dumpSchema();
commonPostExportChecks(); commonPostExportChecks();
doExportTest(); doExportTest();
} }
@@ -96,4 +98,27 @@ public abstract class AbstractExportTester
} }
} }
} }
private void dumpSchema()
{
if (log.isDebugEnabled())
{
log.debug("Iterating through Schema objects:");
}
int i = 0;
for (DbObject dbo : getSchema())
{
i++;
if (log.isDebugEnabled())
{
// Log the object's toString() - indented for clarity.
log.debug(" " + dbo);
}
}
if (log.isDebugEnabled())
{
log.debug("Schema object contains " + i + " objects.");
}
}
} }