Skip to content

Commit

Permalink
LPS-58278 SF
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchandotcom committed Sep 3, 2015
1 parent f3ee465 commit 1c5b6f7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
Expand Up @@ -44,7 +44,7 @@ public List<String> getJdbcProperties() {
if (_HYPERSONIC) {
return Arrays.asList(
new String[] {
"portal:jdbc.default.url=".concat(_DATABASE_URL),
"portal:jdbc.default.url=" + _DATABASE_URL,
"portal:jdbc.default.username=sa",
"portal:jdbc.default.password="
});
Expand All @@ -70,9 +70,9 @@ private static BaseTestCallback<Server, Object> _getTestCallback() {
static {
Props props = new PropsImpl();

String jdbcDriver = props.get("jdbc.default.driverClassName");
String className = props.get("jdbc.default.driverClassName");

_HYPERSONIC = jdbcDriver.equals(jdbcDriver.class.getName());
_HYPERSONIC = className.equals(jdbcDriver.class.getName());

if (_HYPERSONIC) {
String jdbcURL = props.get("jdbc.default.url");
Expand All @@ -81,7 +81,7 @@ private static BaseTestCallback<Server, Object> _getTestCallback() {

if (index < 0) {
throw new ExceptionInInitializerError(
"Invalid HSQL jdbc url: " + jdbcURL);
"Invalid Hypersonic JDBC URL " + jdbcURL);
}

String databaseName = jdbcURL.substring(index + 1);
Expand All @@ -94,8 +94,7 @@ private static BaseTestCallback<Server, Object> _getTestCallback() {

_DATABASE_NAME = databaseName;
_DATABASE_URL =
HypersonicServerTestCallback.DATABASE_URL_BASE.concat(
_DATABASE_NAME);
HypersonicServerTestCallback.DATABASE_URL_BASE + _DATABASE_NAME;
}
else {
_DATABASE_NAME = null;
Expand Down
Expand Up @@ -55,7 +55,7 @@ public void doAfterClass(Description description, Server server)
throws SQLException {

try (Connection connection = DriverManager.getConnection(
DATABASE_URL_BASE.concat(_databaseName), "sa", "");
DATABASE_URL_BASE + _databaseName, "sa", "");
Statement statement = connection.createStatement()) {

statement.execute("SHUTDOWN COMPACT");
Expand All @@ -81,7 +81,7 @@ public int stop() {

if (!_shutdownCountDownLatch.await(1, TimeUnit.MINUTES)) {
throw new IllegalStateException(
"Unable to shutdown HSQLDB " + _databaseName);
"Unable to shut down Hypersonic " + _databaseName);
}

return state;
Expand All @@ -108,32 +108,32 @@ else if (state == ServerConstants.SERVER_STATE_SHUTDOWN) {

};

File hsqlHome = new File(_HSQL_HOME);
File hsqlHomeDir = new File(_HSQL_HOME);

hsqlHome.mkdirs();
hsqlHomeDir.mkdirs();

server.setErrWriter(
new UnsyncPrintWriter(
new File(hsqlHome, _databaseName.concat(".err.log"))));
new File(hsqlHomeDir, _databaseName + ".err.log")));
server.setLogWriter(
new UnsyncPrintWriter(
new File(hsqlHome, _databaseName.concat(".std.log"))));
new File(hsqlHomeDir, _databaseName + ".std.log")));

server.setDatabaseName(0, _databaseName);
server.setDatabasePath(0, _HSQL_HOME.concat(_databaseName));
server.setDatabasePath(0, _HSQL_HOME + _databaseName);

server.start();

if (!startCountDownLatch.await(1, TimeUnit.MINUTES)) {
throw new IllegalStateException(
"Unable to start up HSQLDB " + _databaseName);
"Unable to start up Hypersonic " + _databaseName);
}

return server;
}

private static final String _HSQL_HOME = PropsValues.LIFERAY_HOME.concat(
"/data/hsql/");
private static final String _HSQL_HOME =
PropsValues.LIFERAY_HOME + "/data/hsql/";

private final String _databaseName;

Expand Down

0 comments on commit 1c5b6f7

Please sign in to comment.