mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user