Mark tests as not working under TARGET_JVM
[mono.git] / mcs / class / System.XML / Test / System.Xml.Xsl / XsltExceptionTests.cs
1 //
2 // XsltExceptionTests.cs - Unit tests for System.Xml.Xsl.XsltException
3 //
4 // Author:
5 //      Gert Driesen <drieseng@users.sourceforge.net>
6 //
7 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
16 // 
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
19 // 
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28
29 using NUnit.Framework;
30
31 using System;
32 using System.Runtime.Serialization;
33 using System.Xml.Xsl;
34
35 namespace MonoCasTests.System.Xml.Xsl {
36         [TestFixture]
37         public class XsltExceptionTests
38         {
39 #if NET_2_0
40                 [Test]
41                 public void Constructor0 ()
42                 {
43                         XsltException xsltException = new XsltException ();
44                         Assert.AreEqual (0, xsltException.LineNumber, "#1");
45                         Assert.AreEqual (0, xsltException.LinePosition, "#2");
46                         Assert.AreEqual (string.Empty, xsltException.Message, "#3");
47                         Assert.IsNull (xsltException.SourceUri, "#4");
48                         Assert.IsNull (xsltException.InnerException, "#5");
49                         Assert.IsNull (xsltException.Source, "#6");
50 #if !TARGET_JVM
51                         Assert.IsNull (xsltException.StackTrace, "#7");
52                         Assert.IsNull (xsltException.TargetSite, "#8");
53 #endif
54                 }
55
56                 [Test]
57                 public void Constructor1 ()
58                 {
59                         string msg = "mono";
60
61                         XsltException xsltException = new XsltException (msg);
62                         Assert.AreEqual (0, xsltException.LineNumber, "#1");
63                         Assert.AreEqual (0, xsltException.LinePosition, "#2");
64                         Assert.AreEqual (msg, xsltException.Message, "#3");
65                         Assert.IsNull (xsltException.SourceUri, "#4");
66                         Assert.IsNull (xsltException.InnerException, "#5");
67                         Assert.IsNull (xsltException.Source, "#6");
68 #if !TARGET_JVM
69                         Assert.IsNull (xsltException.StackTrace, "#7");
70                         Assert.IsNull (xsltException.TargetSite, "#8");
71 #endif
72                 }
73 #endif
74
75                 [Test]
76                 public void Constructor2 ()
77                 {
78                         string msg = "mono";
79                         Exception cause = new ApplicationException ("cause");
80
81                         XsltException xsltException = new XsltException (msg, cause);
82                         Assert.AreEqual (0, xsltException.LineNumber, "#A1");
83                         Assert.AreEqual (0, xsltException.LinePosition, "#A2");
84                         Assert.AreEqual (msg, xsltException.Message, "#A3");
85                         Assert.IsNull (xsltException.SourceUri, "#A4");
86                         Assert.AreSame (cause, xsltException.InnerException, "#A5");
87                         Assert.IsNull (xsltException.Source, "#A6");
88 #if !TARGET_JVM
89                         Assert.IsNull (xsltException.StackTrace, "#A7");
90                         Assert.IsNull (xsltException.TargetSite, "#A8");
91 #endif
92                         xsltException = new XsltException ((string) null, cause);
93                         Assert.AreEqual (0, xsltException.LineNumber, "#B1");
94                         Assert.AreEqual (0, xsltException.LinePosition, "#B2");
95                         Assert.IsNotNull (xsltException.Message, "#B3");
96                         Assert.AreEqual (string.Empty, xsltException.Message, "#B4");
97                         Assert.IsNull (xsltException.SourceUri, "#B5");
98                         Assert.AreSame (cause, xsltException.InnerException, "#B6");
99                         Assert.IsNull (xsltException.Source, "#B7");
100 #if !TARGET_JVM
101                         Assert.IsNull (xsltException.StackTrace, "#B8");
102                         Assert.IsNull (xsltException.TargetSite, "#B9");
103 #endif
104                         xsltException = new XsltException (msg, (Exception) null);
105                         Assert.AreEqual (0, xsltException.LineNumber, "#C1");
106                         Assert.AreEqual (0, xsltException.LinePosition, "#C2");
107                         Assert.AreEqual (msg, xsltException.Message, "#C3");
108                         Assert.IsNull (xsltException.SourceUri, "#C4");
109                         Assert.IsNull (xsltException.InnerException, "#C5");
110                         Assert.IsNull (xsltException.Source, "#C6");
111 #if !TARGET_JVM
112                         Assert.IsNull (xsltException.StackTrace, "#C7");
113                         Assert.IsNull (xsltException.TargetSite, "#C8");
114 #endif
115                         xsltException = new XsltException ((string) null, (Exception) null);
116                         Assert.AreEqual (0, xsltException.LineNumber, "#D1");
117                         Assert.AreEqual (0, xsltException.LinePosition, "#D2");
118                         Assert.AreEqual (string.Empty, xsltException.Message, "#D3");
119                         Assert.IsNull (xsltException.SourceUri, "#D4");
120                         Assert.IsNull (xsltException.InnerException, "#D5");
121                         Assert.IsNull (xsltException.Source, "#D6");
122 #if !TARGET_JVM
123                         Assert.IsNull (xsltException.StackTrace, "#D7");
124                         Assert.IsNull (xsltException.TargetSite, "#D8");
125 #endif
126                 }
127         }
128 }