[mapguide-commits] r6913 - branches/2.4/MgDev/Desktop/UnitTest

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Jul 19 10:30:21 PDT 2012


Author: jng
Date: 2012-07-19 10:30:19 -0700 (Thu, 19 Jul 2012)
New Revision: 6913

Modified:
   branches/2.4/MgDev/Desktop/UnitTest/TestFeatureService.cpp
Log:
mg-desktop: The extended feature class support is still not perfect. This updated unit test proves it.

Modified: branches/2.4/MgDev/Desktop/UnitTest/TestFeatureService.cpp
===================================================================
--- branches/2.4/MgDev/Desktop/UnitTest/TestFeatureService.cpp	2012-07-19 17:03:56 UTC (rev 6912)
+++ branches/2.4/MgDev/Desktop/UnitTest/TestFeatureService.cpp	2012-07-19 17:30:19 UTC (rev 6913)
@@ -2748,6 +2748,50 @@
         bool bRead = dr->ReadNext();
         dr->Close();
         CPPUNIT_ASSERT(bRead);
+
+        //XML form should also have this class
+        STRING xml = pService->DescribeSchemaAsXml(lFeatureSource, L"");
+        CPPUNIT_ASSERT(!xml.empty());
+        Ptr<MgFeatureSchemaCollection> pSchemas = pService->XmlToSchema(xml);
+        CPPUNIT_ASSERT(NULL != pSchemas.p);
+        CPPUNIT_ASSERT(1 == pSchemas->GetCount());
+        Ptr<MgFeatureSchema> pSchema = pSchemas->GetItem(0);
+        Ptr<MgClassDefinitionCollection> pClasses = pSchema->GetClasses();
+        CPPUNIT_ASSERT(NULL != pClasses.p);
+        CPPUNIT_ASSERT(pClasses->GetCount() > 0);
+        bFound = false;
+        for (INT32 i = 0; i < pClasses->GetCount(); i++)
+        {
+            Ptr<MgClassDefinition> klass = pClasses->GetItem(i);
+            if (klass->GetName() == L"Ext1")
+            {
+                bFound = true;
+                break;
+            }
+        }
+        CPPUNIT_ASSERT(bFound);
+
+        //XML form should also have this class
+        xml = pService->DescribeSchemaAsXml(lFeatureSource, L"SHP_Schema");
+        CPPUNIT_ASSERT(!xml.empty());
+        pSchemas = pService->XmlToSchema(xml);
+        CPPUNIT_ASSERT(NULL != pSchemas.p);
+        CPPUNIT_ASSERT(1 == pSchemas->GetCount());
+        pSchema = pSchemas->GetItem(0);
+        pClasses = pSchema->GetClasses();
+        CPPUNIT_ASSERT(NULL != pClasses.p);
+        CPPUNIT_ASSERT(pClasses->GetCount() > 0);
+        bFound = false;
+        for (INT32 i = 0; i < pClasses->GetCount(); i++)
+        {
+            Ptr<MgClassDefinition> klass = pClasses->GetItem(i);
+            if (klass->GetName() == L"Ext1")
+            {
+                bFound = true;
+                break;
+            }
+        }
+        CPPUNIT_ASSERT(bFound);
     }
     catch(MgException* e)
     {



More information about the mapguide-commits mailing list