[mapguide-commits] r10282 - in branches/4.0/MgDev: . Bindings/src/Test/Java UnitTest

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Nov 9 23:15:38 PST 2026


Author: jng
Date: 2026-11-09 23:15:37 -0800 (Mon, 09 Nov 2026)
New Revision: 10282

Modified:
   branches/4.0/MgDev/Bindings/src/Test/Java/build.xml
   branches/4.0/MgDev/UnitTest/run_server_tests.sh
   branches/4.0/MgDev/UnitTest/run_web_tests.sh
   branches/4.0/MgDev/prepare_test_pack.sh
Log:
More 4.0.1 version bumps

Modified: branches/4.0/MgDev/Bindings/src/Test/Java/build.xml
===================================================================
--- branches/4.0/MgDev/Bindings/src/Test/Java/build.xml	2026-11-09 12:43:15 UTC (rev 10281)
+++ branches/4.0/MgDev/Bindings/src/Test/Java/build.xml	2026-11-10 07:15:37 UTC (rev 10282)
@@ -31,7 +31,11 @@
   <property name="mapguide.dictpath" location="../../../../Oem/CsMap/CsMapDev/Dictionaries" />
   <property name="unittest.logpath" location="${dist}/unittest.log" />
   <!-- Linux-specific -->
-  <property name="mapguide.ldpath" location="/usr/local/mapguideopensource-4.0.0/lib64:/usr/local/mapguideopensource-4.0.0/webserverextensions/lib64" />
+  <!-- The install tree's name carries the version (mapguideopensource-<major>.<minor>.<rel>), so it is
+       supplied by the caller with -Dinstall.dir (prepare_test_pack.sh does) rather than pinned here:
+       a baseline version bump renames it. checkunix requires it and says so if it is missing. -->
+  <property name="install.dir" value="" />
+  <property name="mapguide.ldpath" value="${install.dir}/lib64:${install.dir}/webserverextensions/lib64" />
   <path id="master-classpath">
     <fileset dir="${classpath}">
       <include name="*.jar" />
@@ -205,7 +209,14 @@
       <env key="MG_TEST_DATA_PATH" value="${testdata.dir}" />
     </java>
   </target>
-  <target name="checkunix" depends="dist,updatewebconfig">
+  <target name="requireinstdir">
+    <fail message="Pass -Dinstall.dir=<the MapGuide install tree> (the /usr/local/mapguideopensource directory that prepare_test_pack.sh discovers); the install directory carries the version, so the project cannot guess it.">
+      <condition>
+        <equals arg1="${install.dir}" arg2="" />
+      </condition>
+    </fail>
+  </target>
+  <target name="checkunix" depends="requireinstdir,dist,updatewebconfig">
     <echo message="Run Java tests for Unix" />
     <!-- Remove any log files and dumped binary files from previous run -->
     <delete>

Modified: branches/4.0/MgDev/UnitTest/run_server_tests.sh
===================================================================
--- branches/4.0/MgDev/UnitTest/run_server_tests.sh	2026-11-09 12:43:15 UTC (rev 10281)
+++ branches/4.0/MgDev/UnitTest/run_server_tests.sh	2026-11-10 07:15:37 UTC (rev 10282)
@@ -1,6 +1,8 @@
 #!/bin/sh
 
-MG_INST_DIR=/usr/local/mapguideopensource-4.0.0
+# The install tree carries the version (mapguideopensource-<major>.<minor>.<rel>), so it is
+# discovered rather than pinned: a baseline version bump renames it. --install-dir overrides.
+MG_INST_DIR=${MG_INSTALL_DIR:-$(ls -d /usr/local/mapguideopensource-[0-9]* 2>/dev/null | sort -V | tail -1)}
 MG_TEST_SCOPE=all
 
 while [ $# -gt 0 ]; do    # Until you run out of parameters...

Modified: branches/4.0/MgDev/UnitTest/run_web_tests.sh
===================================================================
--- branches/4.0/MgDev/UnitTest/run_web_tests.sh	2026-11-09 12:43:15 UTC (rev 10281)
+++ branches/4.0/MgDev/UnitTest/run_web_tests.sh	2026-11-10 07:15:37 UTC (rev 10282)
@@ -1,12 +1,13 @@
 #!/bin/sh
 
 THIS_DIR=$(pwd)
-MG_TEST_WEBCONFIG_PATH=/usr/local/mapguideopensource-4.0.0/webserverextensions/www/webconfig.ini
 MG_TEST_SUITE=all
 MG_MAPAGENT_BASE=localhost:8008
 MG_TEST_DATA_PATH=$THIS_DIR/UnitTest/TestData
-MENTOR_DICTIONARY_PATH=/usr/local/mapguideopensource-4.0.0/share/gis/coordsys
-MG_PHP_DIR=/usr/local/mapguideopensource-4.0.0/webserverextensions/php/bin
+# The three paths below live in the install tree, whose name carries the version
+# (mapguideopensource-<major>.<minor>.<rel>), so they are defaulted from the tree that was installed
+# rather than pinned: a baseline version bump renames it. Each keeps its own override flag.
+MG_INSTALL_DIR=${MG_INSTALL_DIR:-$(ls -d /usr/local/mapguideopensource-[0-9]* 2>/dev/null | sort -V | tail -1)}
 
 while [ $# -gt 0 ]; do    # Until you run out of parameters...
     case "$1" in
@@ -26,6 +27,10 @@
             MG_PHP_DIR="$2"
             shift
             ;;
+        --install-dir)
+            MG_INSTALL_DIR="$2"
+            shift
+            ;;
         --test-data-dir)
             MG_TEST_DATA_PATH="$2"
             shift
@@ -37,10 +42,11 @@
         --help)
             echo "Usage: $0 (options)"
             echo "Options:"
-            echo "  --webconfig-path [Path to webconfig.ini, default: $MG_TEST_WEBCONFIG_PATH]"
+            echo "  --webconfig-path [Path to webconfig.ini, default: from --install-dir]"
             echo "  --test-suite [Web tier test suite to run, default: $MG_TEST_SUITE]"
-            echo "  --coordsys-path [Path to CS-Map dictionaries, default: $MENTOR_DICTIONARY_PATH]"
-            echo "  --php-dir [Path to directory containing the php executable, default: $MG_PHP_DIR]"
+            echo "  --coordsys-path [Path to CS-Map dictionaries, default: from --install-dir]"
+            echo "  --php-dir [Path to directory containing the php executable, default: from --install-dir]"
+            echo "  --install-dir [MapGuide install directory, default: $MG_INSTALL_DIR]"
             echo "  --test-data-dir [Root directory for test data, default: $MG_TEST_DATA_PATH]"
             echo "  --mapagent-base [Base domain/port for mapagent, default: $MG_MAPAGENT_BASE]"
             exit
@@ -49,6 +55,12 @@
     shift   # Check next set of parameters.
 done
 
+# Defaults for the paths that live in the install tree, computed after the flags so that
+# --install-dir feeds them and an explicit flag still wins.
+MG_TEST_WEBCONFIG_PATH=${MG_TEST_WEBCONFIG_PATH:-$MG_INSTALL_DIR/webserverextensions/www/webconfig.ini}
+MENTOR_DICTIONARY_PATH=${MENTOR_DICTIONARY_PATH:-$MG_INSTALL_DIR/share/gis/coordsys}
+MG_PHP_DIR=${MG_PHP_DIR:-$MG_INSTALL_DIR/webserverextensions/php/bin}
+
 test_mapagent()
 {
     echo "Testing mapagent"
@@ -75,7 +87,7 @@
     echo "Testing Java"
     PREV_DIR=$(pwd)
     cd "$THIS_DIR/UnitTest/Java" || exit
-    LD_LIBRARY_PATH=/usr/local/mapguideopensource-4.0.0/webserverextensions/lib64 "$JAVA_HOME"/bin/java -jar MgUnitTest.jar
+    LD_LIBRARY_PATH="$MG_INSTALL_DIR/webserverextensions/lib64" "$JAVA_HOME"/bin/java -jar MgUnitTest.jar
     cd "$PREV_DIR" || exit
 }
 

Modified: branches/4.0/MgDev/prepare_test_pack.sh
===================================================================
--- branches/4.0/MgDev/prepare_test_pack.sh	2026-11-09 12:43:15 UTC (rev 10281)
+++ branches/4.0/MgDev/prepare_test_pack.sh	2026-11-10 07:15:37 UTC (rev 10282)
@@ -1,5 +1,9 @@
 #!/bin/sh
 MG_TEST_OUTPUT_DIR=~/mapguide_test
+# The tree the MapGuide install went into. It carries the version (mapguideopensource-<major>.<minor>.<rel>),
+# so it is discovered rather than pinned: a baseline version bump renames it, and the Java test
+# runner is built against the install's MapGuideApi.jar.
+MG_INSTALL_DIR=${MG_INSTALL_DIR:-$(ls -d /usr/local/mapguideopensource-[0-9]* 2>/dev/null | sort -V | tail -1)}
 
 while [ $# -gt 0 ]; do    # Until you run out of parameters...
     case "$1" in
@@ -7,10 +11,15 @@
             MG_TEST_OUTPUT_DIR="$2"
             shift
             ;;
+        --install-dir)
+            MG_INSTALL_DIR="$2"
+            shift
+            ;;
         --help)
             echo "Usage: $0 (options)"
             echo "Options:"
             echo "  --output [Output directory, default: $MG_TEST_OUTPUT_DIR]"
+            echo "  --install-dir [MapGuide install directory, default: $MG_INSTALL_DIR]"
             exit
             ;;
     esac
@@ -17,6 +26,16 @@
     shift   # Check next set of parameters.
 done
 
+# The copied test scripts default their own paths from MG_INSTALL_DIR, so export the tree we
+# resolved here rather than letting each of them re-discover it.
+export MG_INSTALL_DIR
+
+if [ -z "$MG_INSTALL_DIR" ] || [ ! -d "$MG_INSTALL_DIR/webserverextensions/www/WEB-INF/lib" ]; then
+    echo "FATAL: could not find a MapGuide install with webserverextensions/www/WEB-INF/lib"
+    echo "       under [$MG_INSTALL_DIR]. Pass --install-dir, or build/install first."
+    exit 1
+fi
+
 ANT_CMD=ant
 which $ANT_CMD
 if [ $? -ne 0 ]; then
@@ -49,7 +68,10 @@
 
 # Deploy Java test runner
 cd "$THIS_DIR/Bindings/src/Test/Java" || exit
-$ANT_CMD -Ddist="$STAGING_DIR/UnitTest/Java" -Djarsrc.web="/usr/local/mapguideopensource-4.0.0/webserverextensions/www/WEB-INF/lib" -f build.xml || exit
+$ANT_CMD -Ddist="$STAGING_DIR/UnitTest/Java" \
+    -Dinstall.dir="$MG_INSTALL_DIR" \
+    -Djarsrc.web="$MG_INSTALL_DIR/webserverextensions/www/WEB-INF/lib" \
+    -f build.xml || exit
 if [ -f "$THIS_DIR/Bindings/src/Test/Java/webconfig.ini" ];
 then
     rm "$THIS_DIR/Bindings/src/Test/Java/webconfig.ini"



More information about the mapguide-commits mailing list