Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ _read_config() {
# - keys have '.' chars changed to '_'
# - keys of the form KEY.# (where # is a number) are concatenated into a single environment variable named KEY
parse_line() {
line="$1"
line="${1//[$'\r\n']}"
if [[ "${line}" =~ ^([^#\s][^=]+)=(.+)$ ]]; then
key="${BASH_REMATCH[1]//./_}"
value="${BASH_REMATCH[2]}"
Expand Down Expand Up @@ -320,6 +320,9 @@ print_active_database() {
echo "Active database: ${dbms_active_database:-graph.db}"
}

use_default_main_class() {
MAIN_CLASS="#{ongdb.mainClass}"
}

setup_arbiter_options() {
is_arbiter() {
Expand All @@ -339,7 +342,7 @@ setup_arbiter_options() {
else
SHUTDOWN_TIMEOUT="${ONGDB_SHUTDOWN_TIMEOUT:-120}"
MIN_ALLOWED_OPEN_FILES=40000
MAIN_CLASS="#{ongdb.mainClass}"
use_default_main_class

print_start_message() {
# Global default
Expand Down Expand Up @@ -542,6 +545,8 @@ do_status() {
}

do_version() {
check_java
use_default_main_class
build_classpath

assemble_command_line
Expand Down Expand Up @@ -592,7 +597,6 @@ main() {
;;

--version|version)
setup_java
do_version
;;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ test_description="Test Java arguments"
. ./lib/sharness.sh
fake_install

test_expect_success "should set heap size constraints when checking version from wrapper conf" "
test_expect_success "should not set heap size constraints when checking version from wrapper conf" "
clear_config &&
set_config 'dbms.memory.heap.initial_size' '512m' ongdb-wrapper.conf &&
set_config 'dbms.memory.heap.max_size' '1024m' ongdb-wrapper.conf &&
ongdb-home/bin/ongdb version || true &&
test_expect_java_arg '-Xms512m' &&
test_expect_java_arg '-Xmx1024m'
! test_expect_java_arg '-Xms512m' &&
! test_expect_java_arg '-Xmx1024m'
"

test_expect_success "should set heap size constraints when checking version" "
test_expect_success "should not set heap size constraints when checking version" "
clear_config &&
set_config 'dbms.memory.heap.initial_size' '512m' ongdb.conf &&
set_config 'dbms.memory.heap.max_size' '1024m' ongdb.conf &&
ongdb-home/bin/ongdb version || true &&
test_expect_java_arg '-Xms512m' &&
test_expect_java_arg '-Xmx1024m'
! test_expect_java_arg '-Xms512m' &&
! test_expect_java_arg '-Xmx1024m'
"

for run_command in run_console run_daemon; do
Expand Down
Loading