diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-09-02 14:15:46 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-10-21 11:47:16 +0200 |
commit | 84f9ce9150abfb5f4424d8e94fefa932af3172fa (patch) | |
tree | 5205a6d141793c190fe1e0cacda2b5f1bac6b06f /build/oracle | |
parent | 7e70aa043b7a2482590b0e5459284d2c848eb474 (diff) |
Add infrastructure for oracle development testing and implement native test
Diffstat (limited to 'build/oracle')
-rwxr-xr-x | build/oracle/configure | 75 | ||||
-rwxr-xr-x | build/oracle/oracle | 73 |
2 files changed, 148 insertions, 0 deletions
diff --git a/build/oracle/configure b/build/oracle/configure new file mode 100755 index 0000000..46e5061 --- /dev/null +++ b/build/oracle/configure @@ -0,0 +1,75 @@ +#! /usr/bin/env bash + +# file : build/oracle/configure +# author : Constantin Michael <constantin@codesynthesis.com> +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; see accompanying LICENSE file + +# +# dcf_root - dynamic configuration root +# + +$echo +$echo "Please enter the Oracle client program path." +$echo + +driver=`read_path --command sqlplus` + +$echo +$echo "Please enter the Oracle database user." +$echo + +user=`read_value "odb_test"` + +$echo +$echo "Please enter the Oracle database password." +$echo + +passwd=`read_value ""` + +$echo +$echo "Please enter the Oracle listener host." +$echo + +host=`read_value ""` + +$echo +$echo "Please enter the Oracle listener port." +$echo + +port=`read_value ""` + +$echo +$echo "Please enter the Oracle service to use. Note that the associated" +$echo "database WILL BE MODIFIED." +$echo + +service=`read_value ""` + +opt=$dcf_root/db.options +drv=$dcf_root/db-driver + +if [ -n "$user" ]; then +echo "--user '$user'" >$opt +fi + +if [ -n "$passwd" ]; then +echo "--password '$passwd'" >>$opt +fi + +if [ -n "$service" ]; then +echo "--service '$service'" >>$opt +fi + +if [ -n "$host" ]; then +echo "--host '$host'" >>$opt +fi + +if [ -n "$port" ]; then +echo "--port '$port'" >>$opt +fi + +echo "#!/bin/sh" >$drv +echo "opt=\`cat $opt\`" >>$drv +echo "eval $scf_root/oracle/oracle --driver $driver \$opt \$*" >>$drv +chmod 755 $drv diff --git a/build/oracle/oracle b/build/oracle/oracle new file mode 100755 index 0000000..76badcb --- /dev/null +++ b/build/oracle/oracle @@ -0,0 +1,73 @@ +#! /usr/bin/env bash + +# file : build/oracle/oracle +# author : Constantin Michael <constantin@codesynthesis.com> +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; see accompanying LICENSE file + +# +# Oracle driver wrapper. +# + +while [ $# -gt 0 ]; do + case $1 in + --driver) + driver=$2 + shift 2 + ;; + --user) + user="$2" + shift 2 + ;; + --password) + passwd="$2" + shift 2 + ;; + --service) + service="$2" + shift 2 + ;; + --host) + host="$2" + shift 2 + ;; + --port) + port="$2" + shift 2 + ;; + *) + break + ;; + esac +done + +if [ -z "$driver" ]; then + driver=sqlplus +fi + +opt="-L" +conn=$user + +if [ -n "$passwd" ]; then + conn="$conn/$passwd" +fi + +if [ -n "$host" ]; then + conn="$conn@//$host" + + if [ -n "$port" ]; then + conn="$conn:$port" + fi + + if [ -n "$service" ]; then + conn="$conn/$service" + fi +elif [ -n "$service" ]; then + conn="$conn@$service" +fi + +if [ -n "$1" ]; then + exec $driver $opt $conn <$1 +else + exec $driver $opt $conn +fi |