[mapguide-commits] r8851 - in sandbox/jng/aspnet50/UnitTest/WebTier/Dnx/src/TestCommon: . ResourceService

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Dec 3 08:00:13 PST 2015


Author: jng
Date: 2015-12-03 08:00:12 -0800 (Thu, 03 Dec 2015)
New Revision: 8851

Modified:
   sandbox/jng/aspnet50/UnitTest/WebTier/Dnx/src/TestCommon/CommonUtility.cs
   sandbox/jng/aspnet50/UnitTest/WebTier/Dnx/src/TestCommon/ResourceService/Operations.cs
Log:
More relative path fixing. Failures down to 11/696

Modified: sandbox/jng/aspnet50/UnitTest/WebTier/Dnx/src/TestCommon/CommonUtility.cs
===================================================================
--- sandbox/jng/aspnet50/UnitTest/WebTier/Dnx/src/TestCommon/CommonUtility.cs	2015-12-03 15:55:00 UTC (rev 8850)
+++ sandbox/jng/aspnet50/UnitTest/WebTier/Dnx/src/TestCommon/CommonUtility.cs	2015-12-03 16:00:12 UTC (rev 8851)
@@ -113,10 +113,7 @@
 
         public static MgByteReader GetByteReaderFromPath(string path, bool bCheck = true)
         {
-            //Our DNX root is 2 levels deeper, so fix any input paths that expect the original depth
-            string fixedPath = path;
-            if (path?.Contains(TestDataRoot.Path) == false)
-                fixedPath = path?.Replace("../../TestData", TestDataRoot.Path) ?? string.Empty;
+            string fixedPath = FixRelativePath(path);
 
             if (bCheck)
             {
@@ -168,10 +165,7 @@
 
         public static string GetPath(string path)
         {
-            //Our DNX root is 2 levels deeper, so fix any input paths that expect the original depth
-            string fixedPath = path;
-            if (path?.Contains(TestDataRoot.Path) == false)
-                fixedPath = path?.Replace("../../TestData", TestDataRoot.Path) ?? string.Empty;
+            string fixedPath = FixRelativePath(path);
 
             if (Path.IsPathRooted(fixedPath))
                 return fixedPath.Replace("\\", "/");
@@ -179,6 +173,15 @@
                 return Path.Combine(GetAssemblyPath(), fixedPath).Replace("\\", "/");
         }
 
+        public static string FixRelativePath(string path)
+        {
+            //Our DNX root is 2 levels deeper, so fix any input paths that expect the original depth
+            string fixedPath = path;
+            if (path?.Contains(TestDataRoot.Path) == false)
+                fixedPath = path?.Replace("../../TestData", TestDataRoot.Path) ?? string.Empty;
+            return fixedPath;
+        }
+
         private static string GetAssemblyPath()
         {
             return PlatformServices.Default.Application.ApplicationBasePath;

Modified: sandbox/jng/aspnet50/UnitTest/WebTier/Dnx/src/TestCommon/ResourceService/Operations.cs
===================================================================
--- sandbox/jng/aspnet50/UnitTest/WebTier/Dnx/src/TestCommon/ResourceService/Operations.cs	2015-12-03 15:55:00 UTC (rev 8850)
+++ sandbox/jng/aspnet50/UnitTest/WebTier/Dnx/src/TestCommon/ResourceService/Operations.cs	2015-12-03 16:00:12 UTC (rev 8851)
@@ -294,7 +294,7 @@
 
                 string extension = CommonUtility.GetExtension(param["DATANAME"]);
                 string mimeType = CommonUtility.GetMimeType(extension);
-                MgByteSource dataSource = new MgByteSource(param["DATA"]);
+                MgByteSource dataSource = new MgByteSource(CommonUtility.FixRelativePath(param["DATA"]));
                 dataSource.SetMimeType(mimeType);
                 MgByteReader dataReader = dataSource.GetReader();
 



More information about the mapguide-commits mailing list