[mapguide-commits] r10123 - in branches/4.0/MgDev: Bindings Server/src/UnitTesting UnitTest

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Feb 8 15:04:51 PST 2025


Author: jng
Date: 2025-02-08 15:04:50 -0800 (Sat, 08 Feb 2025)
New Revision: 10123

Removed:
   branches/4.0/MgDev/UnitTest/Common/
Modified:
   branches/4.0/MgDev/Bindings/TODO.txt
   branches/4.0/MgDev/Server/src/UnitTesting/TestMisc.cpp
   branches/4.0/MgDev/UnitTest/test_readme.txt
Log:
Fold FoundationTest into server test suite. The only useful test to bring across is a test case to ensure MgConfiguration rejects invalid values.

Other test cases concern serialization of platform features like MapViewportDefinition which are not applicable for MapGuide, so such test code is not brought across.

Also tidy up test readme some more.

Modified: branches/4.0/MgDev/Bindings/TODO.txt
===================================================================
--- branches/4.0/MgDev/Bindings/TODO.txt	2025-02-08 21:50:12 UTC (rev 10122)
+++ branches/4.0/MgDev/Bindings/TODO.txt	2025-02-08 23:04:50 UTC (rev 10123)
@@ -9,7 +9,7 @@
  - [ ] Add memory leak test (ref: https://www.mail-archive.com/mapguide-users@lists.osgeo.org/msg26357.html) and see if this still happens
  - [x] Check in test case admin tool
  - [x] Consolidate Tools.sln into Bindings.sln
- - [ ] Relocate/remove existing test code
+ - [x] Relocate/remove existing test code
  - [x] Move packages dir up to to top-level MgDev subdirectory and make sure nuget.config sources from this dir
  - [x] Update build batch files to build bindings/portable
  - [~] Fix binding pre-build events to copy ACE/GEOS/lib_json dlls from their respective Oem directories
@@ -38,7 +38,7 @@
  - Test Suite
    - [x] Sync up current test data under /UnitTest to match what is in GitHub repo
    - [x] Add test data setup script for .net/Java test suites to copy the synced up test data under /UnitTest to the location the test suite is expecting
-   - [ ] Try using beta/prerelease DockPanelSuite for MgTestAdmin
+   - [~] Try using beta/prerelease DockPanelSuite for MgTestAdmin
  - Java binding
    - [ ] Running javadoc against the generated sources produces many errors. See if we can fix them
    - [x] Verify test suite still passes (Windows)
@@ -148,5 +148,5 @@
  - Old code cleanup/consolidation
    - [x] Remove old IMake
    - [x] Remove old binding projects from WebTier
-   - [ ] Fold FoundationTest into mgserver test suite
+   - [x] Fold FoundationTest into mgserver test suite
    - [x] Remove SQLite and its related projects from Oem
\ No newline at end of file

Modified: branches/4.0/MgDev/Server/src/UnitTesting/TestMisc.cpp
===================================================================
--- branches/4.0/MgDev/Server/src/UnitTesting/TestMisc.cpp	2025-02-08 21:50:12 UTC (rev 10122)
+++ branches/4.0/MgDev/Server/src/UnitTesting/TestMisc.cpp	2025-02-08 23:04:50 UTC (rev 10123)
@@ -1288,4 +1288,37 @@
     {
         throw;
     }
+}
+
+TEST_CASE("ConfigurationBadValue", "[Misc]")
+{
+    Ptr<MgStringProperty> prop = new MgStringProperty();
+    prop->SetName(L"TempPath");
+    prop->SetValue(L"?*BadPathTextShouldFailAndThrowMgConfigurationException");
+
+    MgConfiguration* config = MgConfiguration::GetInstance();
+
+    Ptr<MgPropertyCollection> propCol = new MgPropertyCollection();
+    propCol->Add(prop);
+
+    // If you get an MgConfigurationException here then MgConfiguration is working properly.
+    bool failed = false;
+    try
+    {
+        config->SetProperties(L"GeneralProperties", propCol);
+    }
+    catch (MgException* e)
+    {
+        if (e->GetExceptionCode() == MgExceptionCodes::MgConfigurationException)
+        {
+            failed = true;
+            e->Release();
+        }
+        else
+        {
+            e->Raise();
+        }
+    }
+
+    REQUIRE(failed == true);
 }
\ No newline at end of file

Modified: branches/4.0/MgDev/UnitTest/test_readme.txt
===================================================================
--- branches/4.0/MgDev/UnitTest/test_readme.txt	2025-02-08 21:50:12 UTC (rev 10122)
+++ branches/4.0/MgDev/UnitTest/test_readme.txt	2025-02-08 23:04:50 UTC (rev 10123)
@@ -5,10 +5,10 @@
 
 The test data in this suite is provided and required for the tests to run properly
 
-Usage
-=====
+Usage (windows)
+===============
 
-To run the server test suite on Windows, run the command as follows:
+To run the server test suite, run the command as follows:
 
 run_server_tests.bat [-h]
                      [-s=ServerBinPath]
@@ -19,7 +19,7 @@
 ServerPath: -s[erverpath]=path to your server bin directory
 ServerTestScope: -sts=The server test suite to run
 
-To run the web tier test suite on Windows, run the command as follows:
+To run the web tier test suite, run the command as follows:
 
 run_web_tests.bat [-h]
                   [-m=MapAgentBase]
@@ -47,6 +47,7 @@
 
  - An installed/pre-configured copy of MapGuide Open Source, this could be installed by the Windows installer, or configured via the InstantSetup utility
  - Java SDK (if running the Java test suite). It must be the same bitness as your MapGuide Server (ie: 64-bit)
+ - node.js with npx globally accessible. This is required if you want to run the mapagent test suite
 
 General Notes (Windows):
 ========================
@@ -66,6 +67,7 @@
 
  * server: always (provided you have elevated privileges for a non-InstantSetup installation)
  * php: always (provided you supply the correct PhpDir path)
- * dotnet: always (the test runner is self-contained)
+ * dotnet: always (the .net test runner is self-contained)
  * java: You must supply the JAVA_HOME environment variable
+ * mapagent: You must have node.js installed and npx is accessible
  * all: All of the above conditions must be satisfied
\ No newline at end of file



More information about the mapguide-commits mailing list