-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DB Client application tests and tools example refactoring.
Applied rewiew comments from Romain. Signed-off-by: Tomas Kraus <Tomas.Kraus@oracle.com>
- Loading branch information
1 parent
71f09ce
commit 71c8367
Showing
30 changed files
with
781 additions
and
515 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
...F/native-image/io.helidon.dbclient.metrics.jdbc/helidon-dbclient-jdbc/reflect-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"name": "com.codahale.metrics.MetricRegistry", | ||
"allDeclaredConstructors": true, | ||
"allDeclaredMethods": true, | ||
"allPublicMethods": true, | ||
"allDeclaredFields": true, | ||
"allPublicFields": true | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2018, 2021 Oracle and/or its affiliates. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
############################################################################### | ||
# Error handling functions # | ||
############################################################################### | ||
|
||
# Multiple definition protection. | ||
# The same code is included in both local and pipeline environment setup. | ||
if [ -z "${__ERROR_HANDLER_INCLUDED__}" ]; then | ||
readonly __ERROR_HANDLER_INCLUDED__='true' | ||
|
||
# Default error handler. | ||
# Shell variables: CODE | ||
# BASH_SOURCE | ||
# LINENO | ||
# BASH_COMMAND | ||
on_error() { | ||
CODE="${?}" && \ | ||
set +x && \ | ||
printf "[ERROR] Error(code=%s) occurred at %s:%s command: %s\n" \ | ||
"${CODE}" "${BASH_SOURCE}" "${LINENO}" "${BASH_COMMAND}" | ||
} | ||
|
||
# Error handling setup | ||
# Arguments: $1 - error handler name (optional, default name is 'on_error') | ||
error_trap_setup() { | ||
# trace ERR through pipes | ||
set -o pipefail || true | ||
# trace ERR through commands and functions | ||
set -o errtrace || true | ||
# exit the script if any statement returns a non-true return value | ||
set -o errexit || true | ||
# Set error handler | ||
trap "${1:-on_error}" ERR | ||
} | ||
|
||
else | ||
echo "WARNING: ${WS_DIR}/etc/scripts/includes/error_handlers.sh included multiple times." | ||
echo "WARNING: Make sure that only one from local and pipeline environment setups is loaded." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Copyright (c) 2021 Oracle and/or its affiliates. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
############################################################################### | ||
# Local environment setup # | ||
############################################################################### | ||
# Shell variables: WS_DIR | ||
# Arguments: $1 - Script path | ||
# $2 - cd to Helidon root directory from script path | ||
# | ||
# Atleast WS_DIR or both arguments must be passed. | ||
|
||
# WS_DIR variable verification. | ||
if [ -z "${WS_DIR}" ]; then | ||
|
||
if [ -z "${1}" ]; then | ||
echo "ERROR: Missing required script path, exitting" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${2}" ]; then | ||
echo "ERROR: Missing required cd to Helidon root directory from script path, exitting" | ||
exit 1 | ||
fi | ||
|
||
readonly WS_DIR=$(cd $(dirname -- "${1}") ; cd ${2} ; pwd -P) | ||
|
||
fi | ||
|
||
# Multiple definition protection. | ||
if [ -z "${__LOCAL_ENV_INCLUDED__}" ]; then | ||
readonly __LOCAL_ENV_INCLUDED__='true' | ||
|
||
. ${WS_DIR}/etc/scripts/includes/error_handlers.sh | ||
|
||
# Docker helper functions | ||
|
||
# Docker database container start. | ||
# Database containers require listening TCP port to be mapped to specific host:port. | ||
# Arguments: $1 - name:version of the image | ||
# $2 - name of the container (--name ${2}) | ||
# $3 - container port publishing (--publish ${3}) | ||
# $4 - additional docker run command arguments | ||
# $5 - name of variable with container running status | ||
# $6 - container start trigger variable name (optional, default true) | ||
docker_db_start() { | ||
if [ -z "${6}" ] || [ -n "${6}" -a -n "${!6}" ]; then | ||
echo -n 'Starting Docker container: ' | ||
docker run -d \ | ||
--name "${2}" \ | ||
--publish "${3}" \ | ||
${4} \ | ||
--rm ${1} && \ | ||
[ -n "${5}" ] && eval "${5}='1'" | ||
fi | ||
} | ||
|
||
# Docker container stop. | ||
# Arguments: $1 - name of the container | ||
# $2 - docker trigger variable name (optional, default true) | ||
docker_stop() { | ||
if [ -z "${2}" ] || [ -n "${2}" -a -n "${!2}" ]; then | ||
echo -n 'Stopping Docker container: ' | ||
docker stop "${1}" | ||
fi | ||
} | ||
|
||
else | ||
echo "WARNING: ${WS_DIR}/etc/scripts/includes/local-env.sh included multiple times." | ||
fi |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.