[mapguide-commits] r6489 - trunk/MgDev/Server/src/UnitTesting

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Feb 8 00:30:02 EST 2012


Author: liuar
Date: 2012-02-07 21:30:02 -0800 (Tue, 07 Feb 2012)
New Revision: 6489

Modified:
   trunk/MgDev/Server/src/UnitTesting/TestKmlService.cpp
   trunk/MgDev/Server/src/UnitTesting/TestSiteManager.cpp
Log:
update the server UT test code:
1. test site manager the session format is out of date
2. KMLl Service can't connect the server when run the UT

Modified: trunk/MgDev/Server/src/UnitTesting/TestKmlService.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestKmlService.cpp	2012-02-08 03:47:39 UTC (rev 6488)
+++ trunk/MgDev/Server/src/UnitTesting/TestKmlService.cpp	2012-02-08 05:30:02 UTC (rev 6489)
@@ -388,12 +388,26 @@
         STRING agentUri = L"http://myserver/mapguide/mapagent/mapagent.fcgi";
         STRING format = L"KML";
 
-        //call GetLayerKml
-        Ptr<MgByteReader> reader = m_svcKml->GetFeaturesKml(layer, extents, width, height, dpi, drawOrder, agentUri, format);
+        try
+        {
+            //call GetLayerKml
+            Ptr<MgByteReader> reader = m_svcKml->GetFeaturesKml(layer, extents, width, height, dpi, drawOrder, agentUri, format);
 
-        STRING mimeType = reader->GetMimeType();
-        CPPUNIT_ASSERT(mimeType.compare(MgMimeType::Kml) == 0);
+            STRING mimeType = reader->GetMimeType();
+            CPPUNIT_ASSERT(mimeType.compare(MgMimeType::Kml) == 0);
+        }
+        catch(MgConnectionFailedException* e)
+        {
+            SAFE_RELEASE(e);
+            ACE_DEBUG((LM_INFO, ACE_TEXT("\nTestCase_GetFeaturesKml skipped because unable to connect to test server.\n")));
 
+            // We need to update the mapguide server status so that it can be used again because we have used the
+            // same exception class for servers outside the one actually executing this code.
+            MgSiteManager* siteManager = MgSiteManager::GetInstance();
+            Ptr<MgSiteInfo> siteInfo = siteManager->GetSiteInfo(0);
+            siteInfo->SetStatus(MgSiteInfo::Ok);
+        }
+
         //compare results against referenced content
         //TODO: Find a way to make the comparison work on Windows AND Linux
         //TODO: Find a way to allow tolerance in floating point value comparisons

Modified: trunk/MgDev/Server/src/UnitTesting/TestSiteManager.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestSiteManager.cpp	2012-02-08 03:47:39 UTC (rev 6488)
+++ trunk/MgDev/Server/src/UnitTesting/TestSiteManager.cpp	2012-02-08 05:30:02 UTC (rev 6489)
@@ -18,7 +18,7 @@
 #include "MapGuideCommon.h"
 #include "TestSiteManager.h"
 #include "FoundationDefs.h"
-const STRING TEST_SESSION_ID = L"48cb0286-0000-1000-8001-005056c00008_en_6F7A8590045708AE0D05";
+const STRING TEST_SESSION_ID = L"48cb0286-0000-1000-8001-005056c00008_en_MTExLjEyMi4xMzMuMTQ0045708AE0D05";
 const STRING TEST_TARGET = L"111.122.133.144";
 const STRING TEST_SUPPORT_SERVER = L"144.133.122.111";
 const INT32 TEST_SITE_PORT = 1111;



More information about the mapguide-commits mailing list