[mapguide-commits] r6920 - in trunk/Tools/Maestro: MaestroAPITestRunner OSGeo.MapGuide.MaestroAPI.Http
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Jul 24 07:20:14 PDT 2012
Author: jng
Date: 2012-07-24 07:20:14 -0700 (Tue, 24 Jul 2012)
New Revision: 6920
Modified:
trunk/Tools/Maestro/MaestroAPITestRunner/MaestroAPITestRunner.csproj
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
Log:
This submission includes the following changes:
- Add a small optimization to auto-cache all classes for any get GetClassDefinition call where a full schema had to be retrieved.
- For some reason, the Schemas directory was not being copied by any build or post-build step I know of for the MaestroAPITestRunner project, causing all LocalConnection-related tests to fail. The MaestroAPITestRunner post-build has been fixed to properly copy the Schemas directory
Modified: trunk/Tools/Maestro/MaestroAPITestRunner/MaestroAPITestRunner.csproj
===================================================================
--- trunk/Tools/Maestro/MaestroAPITestRunner/MaestroAPITestRunner.csproj 2012-07-24 12:10:44 UTC (rev 6919)
+++ trunk/Tools/Maestro/MaestroAPITestRunner/MaestroAPITestRunner.csproj 2012-07-24 14:20:14 UTC (rev 6920)
@@ -156,6 +156,7 @@
<PostBuildEvent>IF EXIST "$(ProjectDir)Setup" XCOPY /Y /I "$(ProjectDir)Setup\*.*" "$(ProjectDir)$(OutDir)"
IF NOT EXIST "$(OutDir)Dictionaries" XCOPY /S /Y /I "$(SolutionDir)..\Maestro.AddIn.Local\Dictionaries\*.*" "$(ProjectDir)$(OutDir)Dictionaries"
IF NOT EXIST "$(OutDir)FDO" XCOPY /S /Y /I "$(SolutionDir)..\Maestro.AddIn.Local\FDO\*.*" "$(ProjectDir)$(OutDir)FDO"
+IF NOT EXIST "$(OutDir)Schemas" XCOPY /S /Y /I "$(SolutionDir)..\OSGeo.MapGuide.MaestroAPI\Schemas\*.*" "$(ProjectDir)$(OutDir)Schemas"
IF NOT EXIST "$(OutDir)Resources" XCOPY /S /Y /I "$(SolutionDir)..\Maestro.AddIn.Local\Resources\*.res" "$(ProjectDir)$(OutDir)Resources"
COPY /Y "$(SolutionDir)..\Maestro.AddIn.Local\*.dll" "$(ProjectDir)$(OutDir)"</PostBuildEvent>
</PropertyGroup>
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2012-07-24 12:10:44 UTC (rev 6919)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2012-07-24 14:20:14 UTC (rev 6920)
@@ -1848,7 +1848,24 @@
//We can't just assume first class item is the one, as ones that do not take
//class name hints will return the full schema
var schema = fsd.Schemas[0];
- return schema.GetClass(className);
+ if (schema.Classes.Count > 1)
+ {
+ //Since we have the full schema anyway, let's cache these other classes
+ ClassDefinition ret = null;
+ foreach (var cls in schema.Classes)
+ {
+ string key = resourceId + "!" + cls.QualifiedName;
+ m_classDefinitionCache[key] = cls;
+
+ if (cls.Name == className)
+ ret = cls;
+ }
+ return ret;
+ }
+ else
+ {
+ return schema.GetClass(className);
+ }
}
}
More information about the mapguide-commits
mailing list