You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by br...@apache.org on 2014/02/26 14:59:39 UTC

svn commit: r1572073 - in /incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests: FileUtil.cs ProjectImporterAssertions.cs

Author: brett
Date: Wed Feb 26 14:59:38 2014
New Revision: 1572073

URL: http://svn.apache.org/r1572073
Log:
get a better string comparison in failing tests

Modified:
    incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests/FileUtil.cs
    incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests/ProjectImporterAssertions.cs

Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests/FileUtil.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests/FileUtil.cs?rev=1572073&r1=1572072&r2=1572073&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests/FileUtil.cs (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests/FileUtil.cs Wed Feb 26 14:59:38 2014
@@ -161,31 +161,6 @@ namespace NPanday.ProjectImporter.Import
             returnValue = returnValue.Substring(0, endIndex + 1);
             return returnValue;
         }
-        public static string CrossCheckPomElement(string refLocation, string pomPath)
-        {
-            if (!File.Exists(refLocation))
-            {
-                return string.Format(MSG_ERROR_EXPECTEDFILE_NOTFOUND, refLocation);
-            }
-            if (!File.Exists(pomPath))
-            {
-                return string.Format(MSG_ERROR_ACTUALFILE_NOTFOUND, pomPath);
-            }
-
-            FileInfo first = new FileInfo(pomPath);
-            FileInfo second = new FileInfo(refLocation);
-
-            using (FileStream fs1 = first.OpenRead())
-            using (FileStream fs2 = second.OpenRead())
-            {
-                for (int i = 0; i < first.Length; i++)
-                {
-                    if (fs1.ReadByte() != fs2.ReadByte())
-                        return string.Format("POMs {0} and {1} do not match @ byte {2}", pomPath, refLocation, i);
-                }
-            }
-            return null;
-        }
 
         public static string GetBaseDirectory()
         {

Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests/ProjectImporterAssertions.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests/ProjectImporterAssertions.cs?rev=1572073&r1=1572072&r2=1572073&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests/ProjectImporterAssertions.cs (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests/ProjectImporterAssertions.cs Wed Feb 26 14:59:38 2014
@@ -92,11 +92,7 @@ namespace NPanday.ProjectImporter.Import
             int pomCount = testPomFiles.Length;
             for (int index = 0; index < pomCount; index++)
             {
-                string returnMsg = FileUtil.CrossCheckPomElement(testPomFiles[index], pomFiles[index]);
-                if (!string.IsNullOrEmpty(returnMsg))
-                {
-                    Assert.Fail(returnMsg);
-                }
+                Assert.AreEqual(File.ReadAllText(testPomFiles[index]).Trim(), File.ReadAllText(pomFiles[index]).Trim());
             }
         }
         #endregion