Skip to content

Commit 61f2864

Browse files
committed
Updated OSGeo-Live test utility module to add a shell script to aid in building the commandline used to invoke the test utility.
1 parent e0a33d2 commit 61f2864

File tree

1 file changed

+24
-0
lines changed
  • tools/osgeo-postgis-jdbc-test-util/src/main/scripts

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
# The following sets variables based in command arguments
4+
TEST_JAR="${1}" # This should be the postgis-jdbc jar file to be tested.
5+
DB_HOSTNAME_AND_PORT=${2} # This should be the hostname:port of the database
6+
DB_USERNAME=${3} # This should be the database user to login as.
7+
DB_PASSWORD=${4} # This should be the database password to be used during login.
8+
9+
# The following can be changed to point to the jar containing the test utility. By default it
10+
# points to a jar file in a local maven repository.
11+
MVN_REPO_LOCATION=~/.m2/repository
12+
GROUP_ID_DIR=/net/postgis
13+
TEST_UTIL_JAR=${MVN_REPO_LOCATION}${GROUP_ID_DIR}/osgeo-postgis-jdbc-test-util/0.0.1-SNAPSHOT/osgeo-postgis-jdbc-test-util-0.0.1-SNAPSHOT.jar
14+
15+
# The following variables are derived from the variables above.
16+
# They are used to invoke the JVM with the test utility.
17+
JDBC_URL="jdbc:postgresql://${DB_HOSTNAME_AND_PORT}/postgis1"
18+
JDBC_USERNAME=${DB_USERNAME}
19+
JDBC_PASSWORD=${DB_PASSWORD}
20+
21+
# The exactly commandline used to invoke the utility is output before it is actually invoked.
22+
echo "==> java -classpath ${TEST_JAR}:${TEST_UTIL_JAR} net.postgis.osgeo.util.Main ${JDBC_URL} ${JDBC_USERNAME} ${JDBC_PASSWORD}"
23+
24+
java -classpath ${TEST_JAR}:${TEST_UTIL_JAR} net.postgis.osgeo.util.Main ${JDBC_URL} ${JDBC_USERNAME} ${JDBC_PASSWORD}

0 commit comments

Comments
 (0)