From f2ae8999380e752b0bcd31b161d7512c43f37601 Mon Sep 17 00:00:00 2001 From: jendib Date: Thu, 5 May 2016 21:33:31 +0200 Subject: [PATCH] Don't dump entities in JUnit --- .travis.yml | 5 ++-- README.md | 2 +- .../com/sismics/util/jpa/DbOpenHelper.java | 25 ++++++------------- .../com/sismics/docs/rest/BaseJerseyTest.java | 2 +- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8a2fd166..f95ceb24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,8 @@ before_install: - sudo apt-get -qq update - sudo apt-get -y -q install tesseract-ocr tesseract-ocr-fra tesseract-ocr-jpn env: - - TESSDATA_PREFIX=/usr/share/tesseract-ocr - - LC_NUMERIC=C + global: + - TESSDATA_PREFIX=/usr/share/tesseract-ocr + - LC_NUMERIC=C before_script: - cd docs-parent \ No newline at end of file diff --git a/README.md b/README.md index 5b8898a1..dc6e5535 100644 --- a/README.md +++ b/README.md @@ -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_ diff --git a/docs-core/src/main/java/com/sismics/util/jpa/DbOpenHelper.java b/docs-core/src/main/java/com/sismics/util/jpa/DbOpenHelper.java index d742f670..dac8b80c 100644 --- a/docs-core/src/main/java/com/sismics/util/jpa/DbOpenHelper.java +++ b/docs-core/src/main/java/com/sismics/util/jpa/DbOpenHelper.java @@ -37,27 +37,25 @@ import com.sismics.util.ResourceUtil; * * @author jtremeaux */ -public abstract class DbOpenHelper { +abstract class DbOpenHelper { /** * Logger. */ private static final Logger log = LoggerFactory.getLogger(DbOpenHelper.class); - private final SqlStatementLogger sqlStatementLogger; - private final JdbcConnectionAccess jdbcConnectionAccess; - private final List exceptions = new ArrayList(); + private final List exceptions = new ArrayList<>(); private Formatter formatter; private boolean haltOnError; - + private Statement stmt; - public DbOpenHelper(ServiceRegistry serviceRegistry) throws HibernateException { + DbOpenHelper(ServiceRegistry serviceRegistry) throws HibernateException { final JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class); - sqlStatementLogger = jdbcServices.getSqlStatementLogger(); + SqlStatementLogger sqlStatementLogger = jdbcServices.getSqlStatementLogger(); jdbcConnectionAccess = jdbcServices.getBootstrapJdbcConnectionAccess(); formatter = (sqlStatementLogger.isFormat() ? FormatStyle.DDL : FormatStyle.NONE).getFormatter(); } @@ -66,7 +64,6 @@ public abstract class DbOpenHelper { log.info("Opening database and executing incremental updates"); Connection connection = null; - Writer outputFileWriter = null; exceptions.clear(); @@ -130,14 +127,6 @@ public abstract class DbOpenHelper { exceptions.add(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 * @throws Exception */ - protected void executeAllScript(final int version) throws Exception { + void executeAllScript(final int version) throws Exception { List fileNameList = ResourceUtil.list(getClass(), "/db/update/", new FilenameFilter() { @Override public boolean accept(File dir, String name) { @@ -173,7 +162,7 @@ public abstract class DbOpenHelper { * @throws IOException * @throws SQLException */ - protected void executeScript(InputStream inputScript) throws IOException, SQLException { + void executeScript(InputStream inputScript) throws IOException, SQLException { List lines = CharStreams.readLines(new InputStreamReader(inputScript)); for (String sql : lines) { diff --git a/docs-web-common/src/test/java/com/sismics/docs/rest/BaseJerseyTest.java b/docs-web-common/src/test/java/com/sismics/docs/rest/BaseJerseyTest.java index 283a76a6..704d17ea 100644 --- a/docs-web-common/src/test/java/com/sismics/docs/rest/BaseJerseyTest.java +++ b/docs-web-common/src/test/java/com/sismics/docs/rest/BaseJerseyTest.java @@ -45,7 +45,7 @@ public abstract class BaseJerseyTest extends JerseyTest { @Override protected Application configure() { enable(TestProperties.LOG_TRAFFIC); - enable(TestProperties.DUMP_ENTITY); + // enable(TestProperties.DUMP_ENTITY); return new Application(); }