mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 15:17:57 +01:00
Don't dump entities in JUnit
This commit is contained in:
parent
c398a3c4f5
commit
f2ae899938
@ -3,6 +3,7 @@ before_install:
|
|||||||
- sudo apt-get -qq update
|
- sudo apt-get -qq update
|
||||||
- sudo apt-get -y -q install tesseract-ocr tesseract-ocr-fra tesseract-ocr-jpn
|
- sudo apt-get -y -q install tesseract-ocr tesseract-ocr-fra tesseract-ocr-jpn
|
||||||
env:
|
env:
|
||||||
|
global:
|
||||||
- TESSDATA_PREFIX=/usr/share/tesseract-ocr
|
- TESSDATA_PREFIX=/usr/share/tesseract-ocr
|
||||||
- LC_NUMERIC=C
|
- LC_NUMERIC=C
|
||||||
before_script:
|
before_script:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Sismics Docs
|
Sismics Docs [![Build Status](https://secure.travis-ci.org/sismics/docs.png)](http://travis-ci.org/sismics/docs)
|
||||||
============
|
============
|
||||||
|
|
||||||
_Web interface_
|
_Web interface_
|
||||||
|
@ -37,17 +37,15 @@ import com.sismics.util.ResourceUtil;
|
|||||||
*
|
*
|
||||||
* @author jtremeaux
|
* @author jtremeaux
|
||||||
*/
|
*/
|
||||||
public abstract class DbOpenHelper {
|
abstract class DbOpenHelper {
|
||||||
/**
|
/**
|
||||||
* Logger.
|
* Logger.
|
||||||
*/
|
*/
|
||||||
private static final Logger log = LoggerFactory.getLogger(DbOpenHelper.class);
|
private static final Logger log = LoggerFactory.getLogger(DbOpenHelper.class);
|
||||||
|
|
||||||
private final SqlStatementLogger sqlStatementLogger;
|
|
||||||
|
|
||||||
private final JdbcConnectionAccess jdbcConnectionAccess;
|
private final JdbcConnectionAccess jdbcConnectionAccess;
|
||||||
|
|
||||||
private final List<Exception> exceptions = new ArrayList<Exception>();
|
private final List<Exception> exceptions = new ArrayList<>();
|
||||||
|
|
||||||
private Formatter formatter;
|
private Formatter formatter;
|
||||||
|
|
||||||
@ -55,9 +53,9 @@ public abstract class DbOpenHelper {
|
|||||||
|
|
||||||
private Statement stmt;
|
private Statement stmt;
|
||||||
|
|
||||||
public DbOpenHelper(ServiceRegistry serviceRegistry) throws HibernateException {
|
DbOpenHelper(ServiceRegistry serviceRegistry) throws HibernateException {
|
||||||
final JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class);
|
final JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class);
|
||||||
sqlStatementLogger = jdbcServices.getSqlStatementLogger();
|
SqlStatementLogger sqlStatementLogger = jdbcServices.getSqlStatementLogger();
|
||||||
jdbcConnectionAccess = jdbcServices.getBootstrapJdbcConnectionAccess();
|
jdbcConnectionAccess = jdbcServices.getBootstrapJdbcConnectionAccess();
|
||||||
formatter = (sqlStatementLogger.isFormat() ? FormatStyle.DDL : FormatStyle.NONE).getFormatter();
|
formatter = (sqlStatementLogger.isFormat() ? FormatStyle.DDL : FormatStyle.NONE).getFormatter();
|
||||||
}
|
}
|
||||||
@ -66,7 +64,6 @@ public abstract class DbOpenHelper {
|
|||||||
log.info("Opening database and executing incremental updates");
|
log.info("Opening database and executing incremental updates");
|
||||||
|
|
||||||
Connection connection = null;
|
Connection connection = null;
|
||||||
Writer outputFileWriter = null;
|
|
||||||
|
|
||||||
exceptions.clear();
|
exceptions.clear();
|
||||||
|
|
||||||
@ -130,14 +127,6 @@ public abstract class DbOpenHelper {
|
|||||||
exceptions.add(e);
|
exceptions.add(e);
|
||||||
log.error("Unable to close connection", e);
|
log.error("Unable to close connection", e);
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
if (outputFileWriter != null) {
|
|
||||||
outputFileWriter.close();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
exceptions.add(e);
|
|
||||||
log.error("Unable to close connection", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +136,7 @@ public abstract class DbOpenHelper {
|
|||||||
* @param version Version number
|
* @param version Version number
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
protected void executeAllScript(final int version) throws Exception {
|
void executeAllScript(final int version) throws Exception {
|
||||||
List<String> fileNameList = ResourceUtil.list(getClass(), "/db/update/", new FilenameFilter() {
|
List<String> fileNameList = ResourceUtil.list(getClass(), "/db/update/", new FilenameFilter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(File dir, String name) {
|
public boolean accept(File dir, String name) {
|
||||||
@ -173,7 +162,7 @@ public abstract class DbOpenHelper {
|
|||||||
* @throws IOException
|
* @throws IOException
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
*/
|
*/
|
||||||
protected void executeScript(InputStream inputScript) throws IOException, SQLException {
|
void executeScript(InputStream inputScript) throws IOException, SQLException {
|
||||||
List<String> lines = CharStreams.readLines(new InputStreamReader(inputScript));
|
List<String> lines = CharStreams.readLines(new InputStreamReader(inputScript));
|
||||||
|
|
||||||
for (String sql : lines) {
|
for (String sql : lines) {
|
||||||
|
@ -45,7 +45,7 @@ public abstract class BaseJerseyTest extends JerseyTest {
|
|||||||
@Override
|
@Override
|
||||||
protected Application configure() {
|
protected Application configure() {
|
||||||
enable(TestProperties.LOG_TRAFFIC);
|
enable(TestProperties.LOG_TRAFFIC);
|
||||||
enable(TestProperties.DUMP_ENTITY);
|
// enable(TestProperties.DUMP_ENTITY);
|
||||||
return new Application();
|
return new Application();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user