[fdo-commits] r753 - branches/3.2.x/Fdo/Managed/UnitTest

svn_fdo at osgeo.org svn_fdo at osgeo.org
Fri Feb 9 10:30:08 EST 2007


Author: romicadascalescu
Date: 2007-02-09 10:30:01 -0500 (Fri, 09 Feb 2007)
New Revision: 753

Modified:
   branches/3.2.x/Fdo/Managed/UnitTest/EntryPoint.cs
   branches/3.2.x/Fdo/Managed/UnitTest/mgXmlTest.cs
Log:
Fixed managed unit test.

Modified: branches/3.2.x/Fdo/Managed/UnitTest/EntryPoint.cs
===================================================================
--- branches/3.2.x/Fdo/Managed/UnitTest/EntryPoint.cs	2007-02-09 06:02:44 UTC (rev 752)
+++ branches/3.2.x/Fdo/Managed/UnitTest/EntryPoint.cs	2007-02-09 15:30:01 UTC (rev 753)
@@ -134,7 +134,7 @@
 
             //mgXmlTest
             mgXmlTest XmlTest = new mgXmlTest();
-            //XmlTest.testXsl(); //first transform failed, output different result with the unmanaged code, quite strange
+            XmlTest.testXsl();
             XmlTest.testNameAdjust();
             //XmlTest.testRead(); //parse failed
             XmlTest.testWrite();

Modified: branches/3.2.x/Fdo/Managed/UnitTest/mgXmlTest.cs
===================================================================
--- branches/3.2.x/Fdo/Managed/UnitTest/mgXmlTest.cs	2007-02-09 06:02:44 UTC (rev 752)
+++ branches/3.2.x/Fdo/Managed/UnitTest/mgXmlTest.cs	2007-02-09 15:30:01 UTC (rev 753)
@@ -92,7 +92,7 @@
                 stylesheetStream.Reset();
         
                 // create transformer
-                XslTransformer tfmr = new XslTransformer(new XmlReader(inStream), new XmlReader(stylesheetStream), new XmlWriter(outStream));
+                XslTransformer tfmr = new XslTransformer(new XmlReader(inStream), new XmlReader(stylesheetStream), new XmlWriter(outStream, false));
         
                 // Set the stylesheet parameters for selecting Dog size and colour
                 DictionaryElementCollection paramss = tfmr.Parameters;
@@ -231,7 +231,13 @@
                         
                 // Test against input streams (StringStream) that have no set length. Verify that we don't get
                 // end-of-file error messages in this case.
-                tfmr = new XslTransformer(new XmlReader(new mgStringStream(pXmlIn)), new XmlReader(new mgStringStream(pStylesheet)), new XmlWriter(outStream, false));
+                inStream.Length = 0;
+                inStream.Write((new ASCIIEncoding()).GetBytes(pXmlIn), Convert.ToUInt32(pXmlIn.Length));
+                inStream.Reset();
+                stylesheetStream.Length = 0;
+                stylesheetStream.Write((new ASCIIEncoding()).GetBytes(pStylesheet), Convert.ToUInt32(pStylesheet.Length));
+                stylesheetStream.Reset();
+                tfmr = new XslTransformer(new XmlReader(inStream), new XmlReader(stylesheetStream), new XmlWriter(outStream, false));
                 tfmr.Transform(); 
             }
             catch (OSGeo.FDO.Common.Exception e)



More information about the fdo-commits mailing list