Merge pull request #505 from roji/shutdown_flow
[mono.git] / mcs / class / corlib / Test / System.IO / FileNotFoundExceptionTest.cs
index 5e601d7e6ba15e4f1a28798f07f1c9df2db88471..52038c997b1491ad5e90f3ba7cbd2505d46677e0 100644 (file)
@@ -63,8 +63,12 @@ namespace MonoTests.System.IO {
                        Assert.IsNotNull (fnf.Message, "#4");
                        Assert.AreEqual ("message", fnf.Message, "#5");
                        Assert.IsNull (fnf.FusionLog, "#6");
+#if TARGET_JVM
+            Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": message"),"#7");
+#else
                        Assert.AreEqual (fnf.GetType ().FullName + ": message",
                                fnf.ToString (), "#7");
+#endif
                }
 
                [Test]
@@ -80,8 +84,12 @@ namespace MonoTests.System.IO {
                        Assert.IsNotNull (fnf.Message, "#4");
                        Assert.AreEqual (string.Empty, fnf.Message, "#5");
                        Assert.IsNull (fnf.FusionLog, "#6");
+#if TARGET_JVM
+            Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": "), "#7");
+#else
                        Assert.AreEqual (fnf.GetType ().FullName + ": ",
                                fnf.ToString (), "#7");
+#endif
                }
 
                [Test]
@@ -100,7 +108,7 @@ namespace MonoTests.System.IO {
                        Assert.IsNotNull (fnf.Message, "#4"); // File or assembly name (null), or ...
 #endif
                        Assert.IsNull (fnf.FusionLog, "#5");
-#if NET_2_0
+#if NET_2_0 && !TARGET_JVM
                        Assert.AreEqual (fnf.GetType ().FullName + ": ",
                                fnf.ToString (), "#6");
 #else
@@ -124,8 +132,13 @@ namespace MonoTests.System.IO {
                        Assert.IsNotNull (fnf.Message, "#5");
                        Assert.AreEqual ("message", fnf.Message, "#6");
                        Assert.IsNull (fnf.FusionLog, "#7");
+#if TARGET_JVM
+            Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": message ---> "
+                + ame.GetType().FullName + ": something"), "#8");
+#else
                        Assert.AreEqual (fnf.GetType ().FullName + ": message ---> "
                                + ame.GetType ().FullName + ": something", fnf.ToString (), "#8");
+#endif
                }
 
                [Test]
@@ -143,8 +156,13 @@ namespace MonoTests.System.IO {
                        Assert.IsNotNull (fnf.Message, "#5");
                        Assert.AreEqual (string.Empty, fnf.Message, "#6");
                        Assert.IsNull (fnf.FusionLog, "#7");
+#if TARGET_JVM
+            Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ":  ---> "
+                + ame.GetType().FullName + ": something"), "#8");
+#else
                        Assert.AreEqual (fnf.GetType ().FullName + ":  ---> "
                                + ame.GetType ().FullName + ": something", fnf.ToString (), "#8");
+#endif
                }
 
                [Test]
@@ -166,8 +184,13 @@ namespace MonoTests.System.IO {
 #endif
                        Assert.IsNull (fnf.FusionLog, "#6");
 #if NET_2_0
+#if TARGET_JVM
+            Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ":  ---> "
+                + ame.GetType().FullName + ": something"), "#7");
+#else
                        Assert.AreEqual (fnf.GetType ().FullName + ":  ---> "
                                + ame.GetType ().FullName + ": something", fnf.ToString (), "#7");
+#endif
 #else
                        Assert.IsTrue (fnf.ToString ().StartsWith (fnf.GetType ().FullName), "#7");
                        Assert.IsFalse (fnf.ToString ().IndexOf (Environment.NewLine) != -1, "#9");
@@ -188,8 +211,12 @@ namespace MonoTests.System.IO {
                        Assert.IsNotNull (fnf.Message, "#4");
                        Assert.AreEqual ("message", fnf.Message, "#5");
                        Assert.IsNull (fnf.FusionLog, "#6");
+#if TARGET_JVM
+            Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": message"), "#7");
+#else
                        Assert.AreEqual (fnf.GetType ().FullName + ": message",
                                fnf.ToString (), "#7");
+#endif
                }
 
                [Test]
@@ -233,8 +260,12 @@ namespace MonoTests.System.IO {
                        Assert.IsNotNull (fnf.Message, "#5");
                        Assert.AreEqual ("message", fnf.Message, "#6");
                        Assert.IsNull (fnf.FusionLog, "#7");
+#if TARGET_JVM
+            Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": message"), "#8");
+#else
                        Assert.AreEqual (fnf.GetType ().FullName + ": message",
                                fnf.ToString (), "#8");
+#endif
                }
 
                [Test]
@@ -251,8 +282,13 @@ namespace MonoTests.System.IO {
                        Assert.IsNotNull (fnf.Message, "#A4");
                        Assert.AreEqual ("message", fnf.Message, "#A5");
                        Assert.IsNull (fnf.FusionLog, "#A6");
+#if TARGET_JVM
+            Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": message"), "#A7");
+#else
+               
                        Assert.AreEqual (fnf.GetType ().FullName + ": message",
                                fnf.ToString (), "#A7");
+#endif
 
                        fnf = new FileNotFoundException (string.Empty, (string) null);
 
@@ -264,8 +300,12 @@ namespace MonoTests.System.IO {
                        Assert.IsNotNull (fnf.Message, "#B4");
                        Assert.AreEqual (string.Empty, fnf.Message, "#B5");
                        Assert.IsNull (fnf.FusionLog, "#B6");
+#if TARGET_JVM
+            Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": "), "#B7");
+#else
                        Assert.AreEqual (fnf.GetType ().FullName + ": ",
                                fnf.ToString (), "#B7");
+#endif
                }
 
                [Test]
@@ -283,7 +323,11 @@ namespace MonoTests.System.IO {
                        Assert.IsNotNull (fnf.Message, "#5");
                        Assert.AreEqual (string.Empty, fnf.Message, "#6");
                        Assert.IsNull (fnf.FusionLog, "#7");
+#if TARGET_JVM
+            Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": "), "#8");
+#else
                        Assert.AreEqual (fnf.GetType ().FullName + ": ", fnf.ToString (), "#8");
+#endif
                }
 
                [Test]
@@ -305,7 +349,9 @@ namespace MonoTests.System.IO {
                        Assert.IsNull (fnf.FusionLog, "#5");
                        Assert.IsTrue (fnf.ToString ().StartsWith (fnf.GetType ().FullName
                                + ": "), "#6");
+#if !TARGET_JVM
                        Assert.IsFalse (fnf.ToString ().IndexOf (Environment.NewLine) != -1, "#7");
+#endif
                        Assert.IsFalse (fnf.ToString ().IndexOf ("''") != -1, "#8");
                }
 
@@ -376,7 +422,9 @@ namespace MonoTests.System.IO {
                        Assert.IsNull (fnf.FusionLog, "#B6");
                        Assert.IsTrue (fnf.ToString ().StartsWith (fnf.GetType ().FullName
                                + ": "), "#B7");
+#if !TARGET_JVM
                        Assert.IsFalse (fnf.ToString ().IndexOf (Environment.NewLine) != -1, "#B8");
+#endif
 #if NET_2_0
                        Assert.IsTrue (fnf.ToString ().IndexOf ("''") != -1, "#B9");
 #else