Merge pull request #3563 from lewurm/interpreter
[mono.git] / mcs / class / System.Web.Services / Test / System.Web.Services.Description / ServiceDescriptionTest.cs
index dcb390c3f36d3a11dd91ecd63533ed9da7c956ed..1aeb13d19f97c553134dff4e89ff1c377082996e 100644 (file)
@@ -24,6 +24,7 @@ namespace MonoTests.System.Web.Services.Description
        public class ServiceDescriptionTest
        {
                [Test]
+               [Category ("MacNotWorking")] // https://bugzilla.xamarin.com/show_bug.cgi?id=51254
                public void SimpleWrite ()
                {
                        ServiceDescription sd = new ServiceDescription ();
@@ -47,11 +48,18 @@ namespace MonoTests.System.Web.Services.Description
                        Assert.IsNull (sd.TargetNamespace);
                }
 
-#if NET_2_0
+               [Test]
+               public void ReadAndRetrievalUrl ()
+               {
+                       Assert.AreEqual (String.Empty, new ServiceDescription ().RetrievalUrl, "#1");
+                       ServiceDescription sd = ServiceDescription.Read ("Test/System.Web.Services.Description/test2.wsdl");
+                       Assert.AreEqual (String.Empty, sd.RetrievalUrl, "#2");
+               }
+
                [Test]
                public void Namespaces ()
                {
-                       FileStream fs = new FileStream ("Test/System.Web.Services.Description/test.wsdl", FileMode.Open);
+                       FileStream fs = new FileStream ("Test/System.Web.Services.Description/test.wsdl", FileMode.Open, FileAccess.Read);
                        XmlTextReader xtr = new XmlTextReader (fs);
 
                        ServiceDescription sd = ServiceDescription.Read (xtr);
@@ -76,7 +84,7 @@ namespace MonoTests.System.Web.Services.Description
                [Test]
                public void ExtensibleAttributes ()
                {
-                   FileStream fs = new FileStream("Test/System.Web.Services.Description/test.wsdl", FileMode.Open);
+                   FileStream fs = new FileStream ("Test/System.Web.Services.Description/test.wsdl", FileMode.Open, FileAccess.Read);
                    XmlTextReader xtr = new XmlTextReader(fs);
 
                    ServiceDescription sd = ServiceDescription.Read(xtr);
@@ -97,7 +105,7 @@ namespace MonoTests.System.Web.Services.Description
                [Test]
                public void Extensions ()
                {
-                   FileStream fs = new FileStream("Test/System.Web.Services.Description/test.wsdl", FileMode.Open);
+                       FileStream fs = new FileStream("Test/System.Web.Services.Description/test.wsdl", FileMode.Open, FileAccess.Read);
                    XmlTextReader xtr = new XmlTextReader(fs);
 
                    ServiceDescription sd = ServiceDescription.Read(xtr);
@@ -133,6 +141,14 @@ namespace MonoTests.System.Web.Services.Description
                    Assert.AreEqual (typeof (SoapAddressBinding), sd.Services [0].Ports [0].Extensions [0].GetType ()); 
                    CheckXmlElement (sd.Services [0].Ports [0].Extensions [1], "portElem");
 
+                   string out_file = Path.GetTempFileName ();
+                   try {
+                           using (FileStream out_fs = new FileStream(out_file, FileMode.Create))
+                                   sd.Write (out_fs);
+                   } finally {
+                           if (!String.IsNullOrEmpty (out_file))
+                                   File.Delete (out_file);
+                   }
                }
 
                void CheckExtensions (DocumentableItem di, string elemName, string val)
@@ -173,7 +189,6 @@ namespace MonoTests.System.Web.Services.Description
                        ServiceDescription sd = ServiceDescription.Read (XmlReader.Create (new StringReader ("<definitions xmlns='http://schemas.xmlsoap.org/wsdl/'><hoge/></definitions>")), true);
                        Assert.IsTrue (sd.ValidationWarnings.Count > 0);
                }
-#endif
 
     }