It was once part of a special Java target profile, but this is no longer used today.
[assembly: Guid ("1ea4dbf0-3c3b-11cf-810c-00aa00389b71")]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: ImportedFromTypeLib ("Accessibility")]
namespace Novell.Directory.Ldap.Utilclass
{
-#if TARGET_JVM
- // This dummy class workarounds a MS CSC bug by using SupportClass before
- // using its inner class (SupportClass.AbstractSetSupport)
- class RespExtensionSetDummy : SupportClass {}
-#endif
/// <summary> This class extends the AbstractSet and Implements the Set
/// so that it can be used to maintain a list of currently
[assembly: AssemblyCopyright(" (C) 2003 Novell, Inc")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-#if !TARGET_JVM
[assembly: CLSCompliant(true)]
-#endif
//
// Version information for an assembly consists of the following four values:
[assembly: AssemblyVersion (Consts.FxVersion)]
-#if (!TARGET_JVM)
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../mono.pub")]
-#endif
using Novell.Directory.Ldap.Asn1;
using Novell.Directory.Ldap.Rfc2251;
using Novell.Directory.Ldap.Utilclass;
-#if !TARGET_JVM
using Mono.Security.Protocol.Tls;
using Mono.Security.X509.Extensions;
-#endif
using Syscert = System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
using System.Net;
using System.Collections;
using System.IO;
using System.Text;
-#if !TARGET_JVM
using Mono.Security.X509;
-#endif
using System.Text.RegularExpressions;
using System.Globalization;
using System.Reflection;
{
if ((in_Renamed == null) || (out_Renamed == null))
{
-#if !TARGET_JVM
if(Ssl)
{
this.host = host;
out_Renamed = (System.IO.Stream) sslstream;*/
}
else{
-#endif
socket = new System.Net.Sockets.TcpClient(host, port);
in_Renamed = (System.IO.Stream) socket.GetStream();
out_Renamed = (System.IO.Stream) socket.GetStream();
-#if !TARGET_JVM
}
-#endif
}
else
{
if (socket != null || sock != null)
{
-#if !TARGET_JVM
// Just before closing the sockets, abort the reader thread
if ((reader != null) && (reason != "reader: thread stopping"))
reader.Abort();
-#endif
// Close the socket
try
{
/* package */
internal void startTLS()
{
-#if !TARGET_JVM
try
{
waitForReader(null);
throw new LdapException("The host is unknown", LdapException.CONNECT_ERROR, null, uhe);
}
return ;
-#endif
}
/*
// before closing sockets, from shutdown
return;
}
-#if TARGET_JVM
- catch (ObjectDisposedException)
- {
- // we do not support Thread.Abort under java
- // so we close the stream and the working thread
- // catches ObjectDisposedException exception
- return;
- }
-#endif
catch (System.IO.IOException ioe)
{
using Novell.Directory.Ldap.Asn1;
using Novell.Directory.Ldap.Rfc2251;
using Novell.Directory.Ldap.Utilclass;
-#if !TARGET_JVM
using Mono.Security.Protocol.Tls;
-#else
-using org.ietf.jgss;
-using javax.security.auth;
-using javax.security.auth.login;
-using java.security;
-
-using Novell.Directory.Ldap.Security;
-using System.Collections.Specialized;
-using System.Configuration;
-#endif
using System.Security.Cryptography.X509Certificates;
namespace Novell.Directory.Ldap
public virtual void Bind(System.String dn, System.String passwd, AuthenticationTypes authenticationTypes)
{
-#if TARGET_JVM
- if (authenticationTypes != AuthenticationTypes.None &&
- authenticationTypes != AuthenticationTypes.ServerBind &&
- authenticationTypes != AuthenticationTypes.Anonymous)
- BindSecure(dn, passwd, authenticationTypes);
- else
-#endif
Bind(Ldap_V3, dn, passwd, defSearchCons);
return ;
}
LdapMessage msg;
-#if TARGET_JVM
- if (mech != null)
- msg = new LdapBindRequest(version, "", mech, passwd, cons.getControls());
- else
-#endif
msg = new LdapBindRequest(version, dn, passwd, cons.getControls());
msgId = msg.MessageID;
}
}
-#if TARGET_JVM
- // stopping reader to enable stream replace after secure binding is complete, see Connection.ReplaceStreams()
- if (mech != null)
- {
- if (conn.BindSemIdClear) {
- // need to acquire a semaphore only if bindSemId is clear
- // because if we receive SASL_BIND_IN_PROGRESS the semaphore is not
- // released when the response is queued
- conn.acquireWriteSemaphore(msgId);
- conn.BindSemId = msgId;
- }
- conn.stopReaderOnReply(msgId);
- }
- else
-#endif
// The semaphore is released when the bind response is queued.
conn.acquireWriteSemaphore(msgId);
return SendRequestToServer(msg, cons.TimeLimit, queue, bindProps);
}
-#if TARGET_JVM
- private void BindSecure(System.String username, System.String password, AuthenticationTypes authenticationTypes)
- {
- if ((authenticationTypes & AuthenticationTypes.Secure) != 0) {
- LoginContext loginContext = null;
- try {
- if (username != null && password != null) {
- AuthenticationCallbackHandler callbackHandler = new AuthenticationCallbackHandler (username,password);
- loginContext = new LoginContext (SecurityAppName, callbackHandler);
- }
- else
- loginContext = new LoginContext (SecurityAppName);
-
- loginContext.login ();
- }
- catch (Exception e) {
- throw new LdapException ("Failed to create login security context", 80, "", e);
- }
-
- Krb5Helper krb5Helper = null;
- try {
- krb5Helper = new Krb5Helper ("ldap@" + conn.Host, username, loginContext.getSubject (), authenticationTypes, SecurityMech);
- }
- finally {
- loginContext.logout();
- }
- sbyte [] token = krb5Helper.ExchangeTokens (Krb5Helper.EmptyToken);
-
- for (;;) {
- LdapResponseQueue queue = Bind(LdapConnection.Ldap_V3, username, token, null, null, AuthenticationMech);
- LdapResponse res = (LdapResponse) queue.getResponse ();
- if (res.ResultCode != LdapException.SASL_BIND_IN_PROGRESS &&
- res.ResultCode != LdapException.SUCCESS) {
- krb5Helper.Dispose();
- throw new LdapException(ExceptionMessages.CONNECTION_ERROR, res.ResultCode, res.ErrorMessage);
- }
- Asn1OctetString serverSaslCreds = ((RfcBindResponse)res.Asn1Object.Response).ServerSaslCreds;
- token = serverSaslCreds != null ? serverSaslCreds.byteValue () : null;
-
- token = krb5Helper.ExchangeTokens(token == null ? Krb5Helper.EmptyToken : token);
-
- if (res.ResultCode != LdapException.SASL_BIND_IN_PROGRESS)
- break;
-
- conn.ReplaceStreams (conn.InputStream,conn.OutputStream);
- }
-
- System.IO.Stream inStream = conn.InputStream;
- System.IO.Stream newIn = new SecureStream (inStream, krb5Helper);
- System.IO.Stream outStream = conn.OutputStream;
- System.IO.Stream newOut = new SecureStream (outStream, krb5Helper);
- conn.ReplaceStreams (newIn,newOut);
- }
- }
-
- static string SecurityMech
- {
- get {
- string securityMech = null;
- NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("mainsoft.directoryservices/settings");
- if (config != null)
- securityMech = config ["securitymech"];
-
- if (securityMech == null)
- throw new ArgumentException("Security mechanism id not found in application settings");
-
- return securityMech;
- }
- }
-
- static string SecurityAppName
- {
- get {
- string securityAppName = null;
- NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("mainsoft.directoryservices/settings");
- if (config != null)
- securityAppName = config ["securityappname"];
-
- if (securityAppName == null)
- throw new ArgumentException("Application section name not found in application settings");
-
- return securityAppName;
- }
- }
-
- static string AuthenticationMech
- {
- get {
- string authenticationMech = null;
- NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("mainsoft.directoryservices/settings");
- if (config != null)
- authenticationMech = config ["authenticationmech"];
-
- if (authenticationMech == null)
- throw new ArgumentException("Authentication mechanism not found in application settings");
-
- return authenticationMech;
- }
- }
-#endif
//*************************************************************************
// compare methods
[CLSCompliantAttribute(false)]
public static sbyte[] ToSByteArray(byte[] byteArray)
{
-#if TARGET_JVM
- return vmw.common.TypeUtils.ToSByteArray(byteArray);
-#else
sbyte[] sbyteArray = new sbyte[byteArray.Length];
for(int index=0; index < byteArray.Length; index++)
sbyteArray[index] = (sbyte) byteArray[index];
return sbyteArray;
-#endif
}
/*******************************/
/// <summary>
[CLSCompliantAttribute(false)]
public static byte[] ToByteArray(sbyte[] sbyteArray)
{
-#if TARGET_JVM
- return (byte[])vmw.common.TypeUtils.ToByteArray(sbyteArray);;
-#else
byte[] byteArray = new byte[sbyteArray.Length];
for(int index=0; index < sbyteArray.Length; index++)
byteArray[index] = (byte) sbyteArray[index];
return byteArray;
-#endif
}
/// <summary>
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM //TARGET_JVM does not support signing
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: InternalsVisibleTo ("System.Web, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
internal class ElementMap
{
-#if TARGET_JVM
- const string elementMapsKey = "ElementMap_elementMaps";
- static Hashtable elementMaps
- {
- get
- {
- Hashtable tbl = (Hashtable) AppDomain.CurrentDomain.GetData (elementMapsKey);
- if (tbl == null) {
- lock (typeof (ElementMap)) {
- tbl = (Hashtable) AppDomain.CurrentDomain.GetData (elementMapsKey);
- if (tbl == null) {
- tbl = Hashtable.Synchronized (new Hashtable ());
- AppDomain.CurrentDomain.SetData (elementMapsKey, tbl);
- }
- }
- }
- return tbl;
- }
- }
-#else
static readonly Hashtable elementMaps = Hashtable.Synchronized (new Hashtable ());
-#endif
readonly ConfigurationPropertyCollection properties;
readonly ConfigurationCollectionAttribute collectionAttribute;
return ConfigurationFactory.Create (typeof(ExeConfigurationHost), map, userLevel);
}
-#if TARGET_JVM
- [MonoLimitation ("Supported only when the userLevel parameter is set to ConfigurationUserLevel.None. Other values are not supported because Environment.GetFolderPath method is not implemented.")]
-#endif
public static Configuration OpenExeConfiguration (ConfigurationUserLevel userLevel)
{
return OpenExeConfigurationInternal (userLevel, Assembly.GetEntryAssembly () ?? Assembly.GetCallingAssembly (), null);
using System.Collections;
using System.Xml;
using System.IO;
-#if !TARGET_JVM
using System.Security.Cryptography.Xml;
-#endif
using System.Configuration.Internal;
namespace System.Configuration
{
throw new NotImplementedException ();
}
-#if !TARGET_JVM
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern private static string get_bundled_machine_config ();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern private static string get_bundled_app_config ();
-#endif
public virtual Stream OpenStreamForRead (string streamName)
{
if (String.CompareOrdinal (streamName, System.Runtime.InteropServices.RuntimeEnvironment.SystemConfigurationFile) == 0) {
-#if TARGET_JVM
- return (Stream) vmw.common.IOUtils.getStreamForGHConfigs (streamName);
-#else
string bundle = get_bundled_machine_config ();
if (bundle != null)
return new MemoryStream (System.Text.Encoding.UTF8.GetBytes (bundle));
-#endif
}
if (String.CompareOrdinal (streamName, AppDomain.CurrentDomain.SetupInformation.ConfigurationFile) == 0) {
-#if TARGET_JVM
- throw new NotImplementedException();
-#else
string bundle = get_bundled_app_config ();
if (bundle != null)
return new MemoryStream (System.Text.Encoding.UTF8.GetBytes (bundle));
-#endif
}
if (!File.Exists (streamName))
{
SysConfig cfg = ConfigurationManager.OpenMachineConfiguration ();
Assert.IsTrue (cfg.Sections.Count > 0, "#1");
-#if !TARGET_JVM
ConfigurationSection s = cfg.SectionGroups ["system.net"].Sections ["connectionManagement"];
Assert.IsNotNull (s, "#2");
Assert.IsTrue (s is ConnectionManagementSection, "#3");
-#endif
}
[Test]
Assert.IsNull (p3, "A1");
}
-#if !TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Intersect_wrongtype ()
IPermission p3 = p1.Intersect (new StrongNameIdentityPermission (PermissionState.Unrestricted));
}
-#endif
[Test]
public void Union ()
Assert.IsTrue (((ConfigurationPermission)p3).IsUnrestricted(), "A2");
}
-#if !TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Union_wrongtypee ()
IPermission p3 = p1.Union (new StrongNameIdentityPermission (PermissionState.Unrestricted));
}
-#endif
[Test]
public void Subset ()
Assert.IsTrue (p2.IsSubsetOf (null), "A6");
}
-#if !TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Subset_wrongtype ()
Assert.IsFalse (p1.IsSubsetOf (new StrongNameIdentityPermission (PermissionState.Unrestricted)));
}
-#endif
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void ToXml ()
{
ConfigurationPermission p = new ConfigurationPermission (PermissionState.Unrestricted);
public static string ThisConfigFileName {
get {
-#if TARGET_JVM
- return "System.Configuration.Test20.jar.config";
-#else
var asm = Assembly.GetCallingAssembly ();
var exe = Path.GetFileName (asm.Location);
return exe + ".config";
-#endif
}
}
}
internal static bool IsUnsigned (Type t)
{
-#if !TARGET_JVM
if (t.IsPointer)
return IsUnsigned (t.GetElementType ());
-#endif
return t == typeof (ushort) ||
t == typeof (uint) ||
t == typeof (ulong) ||
}
[Test]
- [Category("TargetJvmNotWorking")]
public void TestCopyTo ()
{
var data = new [] {1, 2, 3, 4, 5};
}
[Test]
- [Category("TargetJvmNotSupported")]
public void ExpressionDelegateTarget ()
{
var p = Expression.Parameter (typeof (string), "str");
#if !NET_4_0
[Test]
- [Category ("TargetJvmNotSupported")]
public void GlobalsInScope ()
{
var foo = new Foo { gazonk = "gazonk" };
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
-#if TARGET_JVM
-[assembly: AssemblyDelaySign (false)]
-#else
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../ecma.pub")]
-#endif
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
}
}
- #if !TARGET_JVM
#if !MONO_STRICT
public
#endif
}
}
- #endif
}
[assembly: ComVisible (false)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../ecma.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: AllowPartiallyTrustedCallers]
return new OracleConnectionStringBuilder ();
}
-#if !TARGET_JVM
public override CodeAccessPermission CreatePermission (PermissionState state) {
return new OraclePermission (state);
}
-#endif
public override DbDataAdapter CreateDataAdapter () {
return new OracleDataAdapter ();
// The .NET Framework provides support for Oracle LOBs in the OracleClient namespace, but not in the Oracle namespace.
// Since Visual MainWin does not support the OracleClient namespace, a partial support for this important feature is provided in the Oracle namespace.
// See ms-help://MS.VSCC.2003/VMW.GH.1033/ghdoc/vmwdoc_ADONET_data_access_limitations_51.htm
-#if TARGET_JVM
-
- row.Add("BLOB", new byte[] {0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- }, 4000);
- row.Add("CLOB", SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- , 4000);
- row.Add("NCLOB", SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- , 4000);
-#endif
break;
#endregion
/// <returns>The number of deleted rows.</returns>
public static int ExecuteDelete(string a_sTableName, string a_sUniqueId)
{
-#if !TARGET_JVM
return 0;
-#endif
int l_iRecordsDeleted;
OracleCommand l_cmdDelete = new OracleCommand();
l_cmdDelete.Connection = new OracleConnection(ConnectedDataProvider.ConnectionString);
}
[Test]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public void run()
{
OracleCommand cmd = new OracleCommand();
//Test case for bug #4708
[Test(Description="Test case for bug #4708")]
-#if !TARGET_JVM
[Ignore ("JVM test")]
-#endif
public void TestLongSqlExpression()
{
BeginCase("Long SQL string cause java.lang.StackOverflowError (Test case for bug #4708)");
DoTestTypes3(con);
}
-#if TARGET_JVM
- DoTestTypes4(con);
-#endif
// DoTestTypes5(con); //Table direct --> multipe tables
DoTestTypes6(con);
//BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES
[Test]
-#if !TARGET_JVM
[Ignore ("JVM test")]
-#endif
public void run()
{
Exception exp = null;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public class OracleDataAdapter_Update_Ds : ADONetTesterClass
{
public static void Main()
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public class OracleDataAdapter_Update_DsStr : ADONetTesterClass
{
public static void Main()
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public class OracleDataAdapter_Update_Dt : ADONetTesterClass
{
public static void Main()
}
[Test]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public void run()
{
Exception exp = null;
}
[Test]
-#if !TARGET_JVM
[Ignore ("JVM test")]
-#endif
public void TestMultipleResultSetsWithSQLText()
{
}
[Test]
-#if !TARGET_JVM
[Ignore ("JVM test")]
-#endif
public void TestMultipleResultSetsWithSP()
{
#if !JAVA
}
[Test]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public void run()
{
Exception exp = null;
}
[Test]
-//#if !TARGET_JVM
-// [Category("NotWorking")]
-//#endif
public void SimpleTypesWithDBNull()
{
OracleConnection con=null;
}
}
}
-}
\ No newline at end of file
+}
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public class OracleTransaction_Rollback : ADONetTesterClass
{
public static void Main()
[assembly: SatelliteContractVersion (Consts.FxVersion)]
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
-#endif
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
[assembly: AssemblyDelaySign (true)]
-#if !TARGET_JVM
[assembly: AssemblyKeyFile("../ecma.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common {
public enum CatalogLocation
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.ComponentModel;
using System.Data;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.ComponentModel;
using System.Data;
using System.ComponentModel;
using System.Data;
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using System.Transactions;
#endif
protected abstract DbCommand CreateDbCommand ();
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
public virtual void EnlistTransaction (Transaction transaction)
{
throw new NotSupportedException ();
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common {
public abstract class DbDataSourceEnumerator
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.ComponentModel;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.ComponentModel;
public static DbProviderFactory GetFactory (DataRow providerRow)
{
string assemblyType = (string) providerRow ["AssemblyQualifiedName"];
-#if TARGET_JVM // case insensitive GetType is not supported
- Type type = Type.GetType (assemblyType, false);
-#else
Type type = Type.GetType (assemblyType, false, true);
-#endif
if (type != null && type.IsSubclassOf (typeof (DbProviderFactory))) {
// Provider factories are singletons with Instance field having
// the sole instance
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.Security;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common {
public enum DbProviderSupportedClasses
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if TARGET_JVM
-
-using System.ComponentModel;
-
-namespace System.Data.Common {
- public abstract class DbTable : DataTable
- {
- #region Constructors
-
- [MonoTODO]
- protected DbTable (DbProviderFactory providerFactory)
- {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- [MonoTODO]
- public ConflictOption ConflictOption {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbConnection Connection {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbCommand DeleteCommand {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbCommand InsertCommand {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbProviderFactory ProviderFactory {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public bool ReturnProviderSpecificTypes {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbCommand SelectCommand {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public override ISite Site {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DataTableMapping TableMapping {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public int UpdateBatchSize {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbCommand UpdateCommand {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public DataRelation AddChildTable (string relationName, DbTable childTable, string parentColumnName, string childColumnName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataRelation AddChildTable (string relationName, DbTable childTable, string[] parentColumnNames, string[] childColumnNames)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void BeginInit ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual DbCommandBuilder CreateCommandBuilder (DbConnection connection)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override void Dispose (bool disposing)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void EndInit ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Fill (object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Fill (FillOptions options, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Fill (FillOptions options, DbTransaction transaction, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int FillPage (int startRecord, int maxRecords, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int FillPage (int startRecord, int maxRecords, FillOptions options, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int FillPage (int startRecord, int maxRecords, FillOptions options, DbTransaction transaction, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual string GenerateQuery (DbCommandBuilder cmdBuilder)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual string GenerateQueryForHierarchy (DbCommandBuilder builder, DataTable[] tableList)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Update ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Update (UpdateOptions updateOptions)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Update (UpdateOptions updateOptions, DbTransaction transaction)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int UpdateRows (DataRow[] dataRows)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int UpdateRows (DataRow[] dataRows, UpdateOptions updateOptions)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int UpdateRows (DataRow[] dataRows, UpdateOptions updateOptions, DbTransaction transaction)
- {
- throw new NotImplementedException ();
- }
-
-
- #endregion // Methods
- }
-}
-
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common {
public enum SchemaLocation
using System.EnterpriseServices;
using System.Runtime.InteropServices;
using System.Text;
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using System.Transactions;
#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Data.Common;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.Data.Common;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Data.Common;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.Data.Common;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !TARGET_JVM
using Mono.Data.Tds.Protocol;
-#endif
using System;
using System.Xml;
using System.Text;
return AdjustScale (n, -(n.Scale), false);
}
-#if !TARGET_JVM
internal static SqlDecimal FromTdsBigDecimal (TdsBigDecimal x)
{
if (x == null)
else
return new SqlDecimal (x.Precision, x.Scale, !x.IsNegative, x.Data);
}
-#endif
public override int GetHashCode ()
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data {
public enum ConflictOption
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data {
public enum ConflictOptions
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data {
public enum FillOptions
{
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data {
public enum UpdateOptions
{
// The .NET Framework provides support for Oracle LOBs in the OracleClient namespace, but not in the OleDb namespace.
// Since Visual MainWin does not support the OracleClient namespace, a partial support for this important feature is provided in the OleDb namespace.
// See ms-help://MS.VSCC.2003/VMW.GH.1033/ghdoc/vmwdoc_ADONET_data_access_limitations_51.htm
-#if TARGET_JVM
-
- row.Add("BLOB", new byte[] {0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- }, 4000);
- row.Add("CLOB", SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- , 4000);
- row.Add("NCLOB", SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- , 4000);
-#endif
break;
#endregion
public void Default ()\r
{\r
DBDataPermissionAttribute a = new NonAbstractDBDataPermissionAttribute (SecurityAction.Assert);\r
-#if !TARGET_JVM\r
Assert.AreEqual (a.ToString (), a.TypeId.ToString (), "TypeId");\r
-#endif \r
Assert.IsFalse (a.Unrestricted, "Unrestricted");\r
Assert.IsFalse (a.AllowBlankPassword, "AllowBlankPassword");\r
Assert.AreEqual (String.Empty, a.ConnectionString, "ConnectionString");\r
}
[Test]
-#if TARGET_JVM
- [Ignore ("Does not work with TARGET_JVM")]
-#endif
public void ToStringTest()
{
Assert.AreEqual ("System.Data.Common.DataColumnMappingCollection", columnMapCollection.ToString(), "test1");
}
[Test]
-#if TARGET_JVM
- [Ignore ("Does not work with TARGET_JVM")]
-#endif
public void ToStringTest()
{
Assert.AreEqual("System.Data.Common.DataTableMappingCollection", tableMapCollection.ToString(), "test1");
using System.Data.SqlTypes;
using System.Threading;
using System.Globalization;
-#if TARGET_JVM
-using DivideByZeroException = System.ArithmeticException;
-#endif
namespace MonoTests.System.Data.SqlTypes
{
using System;
using System.Xml;
using System.Data.SqlTypes;
-#if TARGET_JVM
-using DivideByZeroException = System.ArithmeticException;
-#endif
#if NET_2_0
using System.Xml.Serialization;
using System.IO;
using System;
using System.Xml;
using System.Data.SqlTypes;
-#if TARGET_JVM
-using DivideByZeroException = System.ArithmeticException;
-#endif
#if NET_2_0
using System.Xml.Serialization;
}
[Test]
-#if TARGET_JVM
- [Ignore ("The option CompareOptions.IgnoreWidth is not supported")]
-#endif
public void CompareTo()
{
SqlByte Test = new SqlByte (1);
}
[Test]
-#if TARGET_JVM
- [Ignore ("The option CompareOptions.IgnoreWidth is not supported")]
-#endif
public void Greaters()
{
// GreateThan ()
}
[Test]
-#if TARGET_JVM
- [Ignore ("The option CompareOptions.IgnoreWidth is not supported")]
-#endif
public void Lessers()
{
// LessThan()
byte test = Test1.GetUnicodeBytes () [105];
Assert.Fail ("#N05");
} catch (Exception e) {
-#if TARGET_JVM
- Assert.IsTrue (typeof (IndexOutOfRangeException).IsAssignableFrom(e.GetType()), "#N06");
-#else
Assert.AreEqual (typeof (IndexOutOfRangeException), e.GetType(), "#N06");
-#endif
}
}
}
[Test]
-#if TARGET_JVM
- [Ignore ("The option CompareOptions.IgnoreWidth is not supported")]
-#endif
public void ThanOrEqualOperators()
{
// == -operator
dt.Rows[1].RejectChanges();
}
[Test]
-#if TARGET_JVM
- [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
public void DataTableSerializationTest2 ()
{
//Serialize Table
}
[Test]
-#if TARGET_JVM
- [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
public void Test_With_Null_Values2 ()
{
//Serialize Table
}
[Test]
-#if TARGET_JVM
- [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
public void DataSetSerializationTest2 ()
{
DataSet ds = new DataSet ();
Assert.AreEqual (ds.Relations [i].RelationName, ds.Relations [i].RelationName, "#9 Relation : {0} differs", ds.Relations [i]);
}
[Test]
-#if TARGET_JVM
- [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
public void Constraint_Relations_Test2 ()
{
//Serialize DataSet
}
[Test]
-#if TARGET_JVM
- [Ignore ("Does not work with TARGET_JVM")]
-#endif
public void ToStringTest ()
{
DataTable Table = new DataTable ("test_table");
Assert.AreEqual (1, Rows.Count, "test#01");
Assert.IsFalse (Rows.IsReadOnly, "test#02");
Assert.IsFalse (Rows.IsSynchronized, "test#03");
-#if !TARGET_JVM
Assert.AreEqual ("System.Data.DataRowCollection", Rows.ToString (), "test#04");
-#endif
string [] cols = new string [2];
cols [0] = "first";
Rows.Add (cols);
Assert.AreEqual (3, Rows.Count, "test#05");
-#if !TARGET_JVM
Assert.AreEqual ("System.Data.DataRow", Rows [0].ToString (), "test#06");
-#endif
Assert.AreEqual (DBNull.Value, Rows [0] [0], "test#07");
Assert.AreEqual (DBNull.Value, Rows [0] [1], "test#08");
Assert.AreEqual ("first", Rows [1] [0], "test#09");
}
[Test]
-#if TARGET_JVM
- [Ignore ("Does not work with TARGET_JVM")]
-#endif
public void ToStringTest()
{
DataTableCollection tbcol = _dataset[0].Tables;
}
[Test]
-#if TARGET_JVM
- [Ignore ("Should review the test")]
-#endif
public void TestReadXml()
{
// For reading, DataTable.ReadXml only supports reading in xml with
#region Read/Write XML Tests
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ReadXmlSchema ()
{
DataTable Table = new DataTable ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void WriteXmlSchema_Hierarchy ()
{
DataSet ds = new DataSet ();
[Test]
[Ignore ("MS behavior is far from consistent to be regarded as a reference implementation.")]
// See the same-named tests in DataSetTest.cs
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
// WriteXmlSchema doesn't have overload wityh 2 parameters in System.Data
// and is commented-out TWICE below
public void ReadWriteXmlSchema()
[Test]
[Ignore ("MS behavior is far from consistent to be regarded as a reference implementation.")]
// See the same-named tests in DataSetTest.cs
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ReadWriteXmlSchema_IgnoreSchema ()
{
DataSet ds = new DataSet ();
Assert.AreEqual (5, n, "n");
}
-#if !TARGET_JVM && !MONOTOUCH
+#if !MONOTOUCH
[Test]
public void NFIFromBug55978 ()
{
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")] // defect 5446
-#endif
public void Find_3 ()
{
dataView.Sort = "itemID, itemName";
[assembly: ComVisible (false)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: AllowPartiallyTrustedCallers]
[assembly: ComVisible (false)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: AllowPartiallyTrustedCallers]
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
{
return false;
}
-#if !TARGET_JVM
public void PaintValue (object value, Graphics canvas, Rectangle rectangle)
{
PaintValue (new PaintValueEventArgs (null, value, canvas, rectangle));
// but on the other hand the class is not abstract. Could never observe it did paint anything
return;
}
-#endif
#if NET_2_0
public virtual bool IsDropDownResizable {
get { return false; }
/// <summary>
/// Summary description for Blend.
/// </summary>
-#if TARGET_JVM
- [MonoTODO]
-#endif
public sealed class Blend
{
private float [] positions;
{
// MUST BE KEPT IN SYNC WITH gdip.h in libgdiplus!
// The first 6 fields MUST also match MS definition
-#if TARGET_JVM
- [MonoTODO]
-#endif
[StructLayout(LayoutKind.Sequential)]
public sealed class BitmapData {
private int width;
using System.Reflection;
namespace System.Drawing.Imaging {
-#if TARGET_JVM
- [MonoTODO]
-#endif
public sealed class ColorMap {
private Color newColor;
namespace System.Drawing.Imaging
{
-#if TARGET_JVM
- [MonoTODO]
-#endif
[StructLayout (LayoutKind.Sequential)]
public sealed class ColorMatrix
{
return flags;
}
}
-#if !TARGET_JVM
/* Caller should call FreeHGlobal*/
internal IntPtr getGDIPalette()
{
offset += 4;
}
}
-#endif
}
}
// Nothing
GC.SuppressFinalize(this);
}
-#if !TARGET_JVM
internal IntPtr ToNativePtr () {
IntPtr result;
IntPtr ptr;
return result;
}
-#endif
}
}
}
[MonoTODO ("Metafiles, both WMF and EMF formats, aren't supported.")]
-#if !TARGET_JVM
[StructLayout(LayoutKind.Sequential)]
-#endif
public sealed class MetafileHeader {
private MonoMetafileHeader header;
#if ONLY_1_1
[ComVisible (true)]
#endif
-#if !TARGET_JVM
[Editor ("System.Drawing.Design.ColorEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
-#endif
[Serializable]
public struct Color {
// however it's bad to keep a string (reference) in a struct
internal string name;
// #endif
-#if TARGET_JVM
- internal java.awt.Color NativeObject {
- get {
- return new java.awt.Color (R, G, B, A);
- }
- }
-
- internal static Color FromArgbNamed (int alpha, int red, int green, int blue, string name, KnownColor knownColor)
- {
- Color color = FromArgb (alpha, red, green, blue);
- color.state = (short) (ColorType.Known|ColorType.Named);
- color.name = KnownColors.GetName (knownColor);
- color.knownColor = (short) knownColor;
- return color;
- }
-
- internal static Color FromArgbSystem (int alpha, int red, int green, int blue, string name, KnownColor knownColor)
- {
- Color color = FromArgbNamed (alpha, red, green, blue, name, knownColor);
- color.state |= (short) ColorType.System;
- return color;
- }
-#endif
public string Name {
get {
lock (creatingCached) {
if (cached != null)
return cached;
-#if TARGET_JVM
- Color [] colors = new Color [KnownColors.Values.Length - 1];
- Array.Copy (KnownColors.Values, 1, colors, 0, colors.Length);
-#else
Array colors = Array.CreateInstance (typeof (Color), KnownColors.ArgbValues.Length - 1);
for (int i=1; i < KnownColors.ArgbValues.Length; i++) {
colors.SetValue (KnownColors.FromKnownColor ((KnownColor)i), i - 1);
}
-#endif
Array.Sort (colors, 0, colors.Length, new CompareColors ());
cached = new StandardValuesCollection (colors);
public FontConverter ()
{
}
-#if !TARGET_JVM
~FontConverter ()
{
// required to match API definition
}
-#endif
public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof (string))
public static readonly Rectangle Empty;
-#if TARGET_JVM
- internal java.awt.Rectangle NativeObject {
- get {
- return new java.awt.Rectangle(X,Y,Width,Height);
- }
- }
-#endif
/// <summary>
/// Ceiling Shared Method
public static readonly RectangleF Empty;
-#if TARGET_JVM
- internal java.awt.geom.Rectangle2D NativeObject {
- get {
- return new java.awt.geom.Rectangle2D.Float(X,Y,Width,Height);
- }
- }
-#endif
/// <summary>
/// FromLTRB Shared Method
}
-#if TARGET_JVM
- internal RectangleF (java.awt.geom.RectangularShape r2d) {
- this.x = (float) r2d.getX ();
- this.y = (float) r2d.getY ();
- this.width = (float) r2d.getWidth ();
- this.height = (float) r2d.getHeight ();
- }
-#endif
/// <summary>
/// Bottom Property
\r
#if MONOTOUCH\r
#else\r
-#if TARGET_JVM\r
-using awt = java.awt;\r
-using javax.imageio;\r
-using java.lang;\r
-using java.security;\r
-using java.awt.image;\r
-#else\r
using System.Windows.Forms;\r
#endif\r
-#endif\r
\r
using NUnit.Framework;\r
\r
Hashtable _hash;\r
CachedResults _results;\r
\r
-#if TARGET_JVM\r
- public const string FileName = "CachedResults.xml";\r
- public const string NewFileName = "NewCachedResults.xml";\r
-#else\r
public const string FileName = "dotnet.CachedResults.xml";\r
public const string NewFileName = "dotnet.NewCachedResults.xml";\r
-#endif\r
public readonly static XmlSerializer TestSuiteSerializer =\r
new XmlSerializer(typeof(CachedResults));\r
\r
}\r
public static DrawingTest Create (int width, int height, string ownerClass) {\r
DrawingTest test;\r
-#if TARGET_JVM\r
- test = new JavaDrawingTest ();\r
-#else\r
test = new NetDrawingTest ();\r
-#endif\r
test.Init (width, height);\r
test.OwnerClass = ownerClass;\r
return test;\r
#endregion\r
}\r
\r
-#if TARGET_JVM\r
- internal class JavaDrawingTest:DrawingTest {\r
- java.awt.image.BufferedImage _image;\r
- java.awt.image.BufferedImage Image {\r
- get {\r
- if (_image != null)\r
- return _image;\r
- Type imageType = typeof (Bitmap);\r
- PropertyInfo [] props = imageType.GetProperties (\r
- BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);\r
-\r
- PropertyInfo prop = null;\r
- foreach (PropertyInfo p in props) {\r
- if (p.Name == "NativeObject")\r
- if (p.PropertyType == typeof(java.awt.image.BufferedImage))\r
- prop = p;\r
- }\r
-\r
- MethodInfo method = prop.GetGetMethod (true);\r
- _image = (java.awt.image.BufferedImage) method.Invoke (_bitmap, new object [0]);\r
- return _image;\r
- }\r
- }\r
-\r
- public JavaDrawingTest () {}\r
-\r
- protected override double GetExpectedNorm (double myNorm) {\r
- return ExpectedResults.GetNorm(TestName);\r
- }\r
-\r
- protected override Bitmap GetReferenceImage(string testName) {\r
- try{\r
- string dotNetResultsFolder = @"";\r
- string fileName = dotNetResultsFolder + testName.Replace(":", "_") + ".png";\r
- return new Bitmap(fileName);\r
- }\r
- catch(System.Exception e) {\r
- throw new System.Exception("Error creating .Net reference image");\r
- }\r
- }\r
-\r
- private class JavaForm:java.awt.Dialog,IMyForm {\r
- class EventListener : java.awt.@event.WindowListener {\r
- #region WindowListener Members\r
-\r
- public void windowOpened(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowOpened implementation\r
- }\r
-\r
- public void windowActivated(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowActivated implementation\r
- }\r
-\r
- public void windowClosed(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowClosed implementation\r
- }\r
-\r
- public void windowDeiconified(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowDeiconified implementation\r
- }\r
-\r
- public void windowIconified(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowIconified implementation\r
- }\r
-\r
- public void windowClosing(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowClosing implementation\r
- java.awt.Window w = arg_0.getWindow();\r
- java.awt.Window par = w.getOwner ();\r
- w.dispose();\r
- par.dispose ();\r
- }\r
-\r
- public void windowDeactivated(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowDeactivated implementation\r
- }\r
-\r
- #endregion\r
- }\r
-\r
- java.awt.Image _image;\r
- Size _s;\r
-\r
- public JavaForm (string title, java.awt.Image anImage, Size s)\r
- : base(new java.awt.Frame(), title, true) {\r
- _image = anImage;\r
- _s = s;\r
- \r
- addWindowListener(new EventListener());\r
- }\r
- public override void paint (java.awt.Graphics g) {\r
- base.paint (g);\r
- awt.Insets insets = this.getInsets ();\r
- g.drawImage (_image, insets.left, insets.top, null);\r
- }\r
- void IMyForm.Show () {\r
- awt.Insets insets = this.getInsets ();\r
- base.setSize (_s.Width + insets.left + insets.right,\r
- _s.Width + insets.top + insets.bottom);\r
- this.show ();\r
- //save the image\r
- //ImageIO.write((java.awt.image.RenderedImage)_image, "png", new java.io.File("test.java.png"));\r
- }\r
- }\r
-\r
- protected override IMyForm CreateForm(string title) {\r
- return new JavaForm (title, Image, _bitmap.Size);\r
- }\r
- \r
- protected override string DetermineCallingFunction() {\r
- System.Exception e = new System.Exception ();\r
- java.lang.Class c = vmw.common.TypeUtils.ToClass (e);\r
- java.lang.reflect.Method m = c.getMethod ("getStackTrace",\r
- new java.lang.Class [0]);\r
- java.lang.StackTraceElement [] els = (java.lang.StackTraceElement [])\r
- m.invoke (e, new object [0]);\r
- java.lang.StackTraceElement el = els [4];\r
- return el.getClassName () + "." + _ownerClass + "." + el.getMethodName ();\r
- }\r
-\r
- public override string CalculateSHA1() {\r
- MessageDigest md = MessageDigest.getInstance ("SHA");\r
- DataBufferInt dbi = (DataBufferInt) Image.getRaster ().getDataBuffer ();\r
- for (int i=0; i<dbi.getNumBanks (); i++) {\r
- int [] curBank = dbi.getData (i);\r
- for (int j=0; j<curBank.Length; j++) {\r
- int x = curBank[j];\r
- md.update ((sbyte) (x & 0xFF));\r
- md.update ((sbyte) ((x>>8) & 0xFF));\r
- md.update ((sbyte) ((x>>16) & 0xFF));\r
- md.update ((sbyte) ((x>>24) & 0xFF));\r
- }\r
- }\r
- byte [] resdata = (byte[])vmw.common.TypeUtils.ToByteArray(md.digest());\r
- return Convert.ToBase64String (resdata);\r
- }\r
- }\r
-#else\r
internal class NetDrawingTest:DrawingTest {\r
public NetDrawingTest () {}\r
\r
}\r
\r
}\r
-#endif\r
\r
}\r
Assert.That(t.Compare(), Is.True);\r
}\r
[Test]\r
-#if TARGET_JVM\r
- [Category("NotWorking")] // defect 6145\r
-#endif\r
public void DrawImageWithResolution() {\r
t.Graphics.DrawImage(bmp2, 0, 0);\r
t.Show();\r
Assert.That(t.Compare(), Is.True);\r
}\r
[Test]\r
-#if TARGET_JVM\r
- [Category ("NotWorking")] // defect 6145\r
-#endif\r
public void DrawImageInContainer2() {\r
t.Graphics.BeginContainer(new Rectangle(10, 10, 50, 50), new Rectangle(70, 70, 100, 100), GraphicsUnit.Pixel);\r
t.Graphics.DrawImage(bmp2, 0, 0);\r
unit.DefaultValues ();
}
-#if !TARGET_JVM
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
public void UnitTests_PaintValue ()
unit.PaintValue_PaintValueEventArgs ();
unit.PaintValue ();
}
-#endif
// we use reflection to call UITypeEditor class as it's protected by a
// LinkDemand (which will be converted into full demand, i.e. a stack
#endif
}
-#if !TARGET_JVM
[Test]
public void PaintValue_PaintValueEventArgs_Null ()
{
{
editor.PaintValue (null, graphics, Rectangle.Empty);
}
-#endif
}
}
[Test]
[ExpectedException (typeof (OverflowException))]
-#if TARGET_JVM
- [Category ("NotWorking")] // defect 6364
-#endif
public void ColorBlend_Negative ()
{
ColorBlend cb = new ColorBlend (-1);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestDrawing ()
{
// create a bitmap with big enough dimensions
/* Checks bitmap features on a know 1bbp bitmap */
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Bitmap1bitFeatures ()
{
string sInFile = getInFile ("bitmaps/almogaver1bit.bmp");
/* Checks bitmap features on a know 8bbp bitmap */
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Bitmap8bitFeatures ()
{
string sInFile = getInFile ("bitmaps/almogaver8bits.bmp");
/* Checks bitmap features on a know 24-bits bitmap */
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[Test]
public void Bitmap24bitFeatures()
{
}
}
-#if !TARGET_JVM
[Test]
public void Bitmap24bitData ()
{
}
}
}
-#endif
/* Checks bitmap features on a know 32-bits bitmap (codec)*/
[Test]
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_24bppRgb ()
{
Save (PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb, true);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppRgb ()
{
Save (PixelFormat.Format32bppRgb, PixelFormat.Format32bppRgb, true);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppArgb ()
{
Save (PixelFormat.Format32bppArgb, PixelFormat.Format32bppRgb, true);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppPArgb ()
{
Save (PixelFormat.Format32bppPArgb, PixelFormat.Format32bppRgb, true);
Assert.AreEqual (0, cm.Matrix41, "4,1");\r
Assert.AreEqual (0, cm.Matrix42, "4,2");\r
Assert.AreEqual (0, cm.Matrix43, "4,3");\r
-#if !TARGET_JVM\r
Assert.AreEqual (100, Marshal.SizeOf (cm), "object");\r
Assert.AreEqual (100, Marshal.SizeOf (typeof (ColorMatrix)), "type");\r
-#endif\r
}\r
\r
[Test]\r
// Text Color Matrix processing
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ColorMatrix1 ()
{
Color clr_src, clr_rslt;
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ColorMatrix2 ()
{
Color clr_src, clr_rslt;
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ColorMatrix_80323_UsingAlpha ()
{
Bug80323 (Color.FromArgb (100, 255, 0, 0));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ColorMatrix_80323_WithoutAlpha ()
{
// this color is identical, once drawn over the bitmap, to Color.FromArgb (100, 255, 0, 0)
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_Null ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_Default_Any ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_Default_Count ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Any ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Bitmap ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Brush ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Count ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Default ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Pen ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Text ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_SkipGrays_Any ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_SkipGrays_Count ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_InvalidFlag ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_InvalidType()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrices_Null_ColorMatrix ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrices_ColorMatrix_Null_AltGrays ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
public void SetColorMatrices_Gray ()
{
Color c = ProcessColorMatrices (Color.Gray, global_color_matrix, global_gray_matrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
public void SetColorMatrices_Color ()
{
Color c = ProcessColorMatrices (Color.MidnightBlue, global_color_matrix, global_gray_matrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrices_InvalidFlags ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrices_InvalidType ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
public void ColorMatrixAlpha ()
{
for (int i = 0; i < 256; i++) {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Decoders ()
{
Assert.AreEqual (8, decoders.Count, "Count");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Encoders ()
{
Assert.AreEqual (5, encoders.Count, "Count");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void BMPCodec()
{
Guid g = new Guid ("557cf400-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void GifCodec()
{
Guid g = new Guid ("557cf402-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void JpegCodec()
{
Guid g = new Guid ("557cf401-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void PngCodec()
{
Guid g = new Guid ("557cf406-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TiffCodec ()
{
Guid g = new Guid ("557cf405-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IconCodec_Encoder ()
{
Guid g = new Guid ("557cf407-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IconCodec_Decoder ()
{
Guid g = new Guid ("557cf407-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void EmfCodec_Encoder ()
{
Guid g = new Guid ("557cf403-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void EmfCodec_Decoder ()
{
Guid g = new Guid ("557cf403-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void WmfCodec_Encoder ()
{
Guid g = new Guid ("557cf404-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void WmfCodec_Decoder ()
{
Guid g = new Guid ("557cf404-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Ignore ("#8853")]
-#endif
public void Bitmap8bbpIndexedGreyscaleFeatures ()
{
string sInFile = getInFile ("bitmaps/nature-greyscale.jpg");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Bitmap8bbpIndexedGreyscalePixels ()
{
string sInFile = getInFile ("bitmaps/nature-greyscale.jpg");
}
}
-#if !TARGET_JVM
[Test]
public void Bitmap8bbpIndexedGreyscaleData ()
{
}
}
}
-#endif
/* Checks bitmap features on a known 24-bits bitmap */
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Bitmap24bitFeatures ()
{
string sInFile = getInFile ("bitmaps/nature24bits.jpg");
}
}
-#if !TARGET_JVM
[Test]
public void Bitmap24bitData ()
{
}
}
}
-#endif
private void Save (PixelFormat original, PixelFormat expected)
{
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_24bppRgb ()
{
Save (PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppRgb ()
{
Save (PixelFormat.Format32bppRgb, PixelFormat.Format24bppRgb);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppArgb ()
{
Save (PixelFormat.Format32bppArgb, PixelFormat.Format24bppRgb);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppPArgb ()
{
Save (PixelFormat.Format32bppPArgb, PixelFormat.Format24bppRgb);
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void CanConvertFrom () {
Assert.IsTrue (colconv.CanConvertFrom (typeof (String)), "CCF#1");
Assert.IsTrue (colconv.CanConvertFrom (null, typeof (String)), "CCF#1a");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFrom ()
{
Color color = (Color) colconv.ConvertFrom (null, CultureInfo.InvariantCulture,
[Test]
[ExpectedException (typeof (Exception))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFrom_x4 ()
{
colconv.ConvertFrom (null, CultureInfo.InvariantCulture,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_InvalidNumber ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_InvalidNumber ()
{
try {
[Test]
[ExpectedException (typeof (Exception))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void FromHtml_PoundNegative ()
{
ColorTranslator.FromHtml ("#-1");
[Test]
[ExpectedException (typeof (Exception))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void FromHtml_Unknown ()
{
ColorTranslator.FromHtml ("unknown-color-test");
[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public class TestBitmap {
[Test]
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_BitmapData_Null ()
{
-#if !TARGET_JVM
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
bmp.LockBits (rect, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb, null);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_32_32_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_32_24_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_24_24_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format24bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_24_32_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format24bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
#endif
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void FileDoesNotExists ()
{
Bitmap bmp = new Bitmap ("FileDoesNotExists.jpg");
hash = new MD5CryptoServiceProvider().ComputeHash (pixels);
return ByteArrayToString (hash);
}
-#if !TARGET_JVM
public string RotateIndexedBmp (Bitmap src, RotateFlipType type)
{
int pixels_per_byte;
byte[] hash = new MD5CryptoServiceProvider().ComputeHash (pixel_data);
return ByteArrayToString (hash);
}
-#endif
/*
}
-#if !TARGET_JVM
/*
Rotate 1- and 4-bit bitmaps in different ways and check the
resulting pixels using MD5
}
}
}
-#endif
[Test]
public void DefaultFormat1 ()
{
}
[TestFixture]
-#if TARGET_JVM
- [Ignore ("Unsafe code is not supported")]
-#endif
public class BitmapFullTrustTest {
-#if !TARGET_JVM
[Test]
public void BitmapIntIntIntPixelFormatIntPtrCtor ()
{
Assert.IsTrue (image2.RawFormat.Equals (ImageFormat.MemoryBmp), "2.RawFormat");
}
}
-#endif
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Throws ArgumentException - Implementation specific")]
-#endif
public void Dispose ()
{
Brushes.YellowGreen.Dispose ();
0x01, 0x00, 0x0B };
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Deserialize ()
{
BinaryFormatter bf = new BinaryFormatter ();
67,111,108,111,114,5,115,116,97,116,101,1,0,0,0,9,7,7,2,0,0,0,10,0,0,0,0,0,0,0,0,37,0,1,0,11 };
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Deserialize2 ()
{
BinaryFormatter bf = new BinaryFormatter ();
67,111,108,111,114,5,115,116,97,116,101,1,0,0,0,9,7,7,2,0,0,0,10,255,0,0,255,0,0,0,0,0,0,2,0,11};
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Deserialize3 ()
{
BinaryFormatter bf = new BinaryFormatter ();
}
}
-#if !TARGET_JVM
private void Compare (KnownColor kc, GetSysColorIndex index)
{
// we get BGR than needs to be converted into ARGB
Compare (KnownColor.MenuHighlight, GetSysColorIndex.COLOR_MENUHIGHLIGHT);
#endif
}
-#endif // TARGET_JVM
}
}
public string lfFaceName;
}
-#if !TARGET_JVM
[Test]
[Category ("CAS")]
[ExpectedException (typeof (SecurityException))]
Font f = new Font ("Arial", 10);
f.ToLogFont (null);
}
-#endif
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentNullException))]
-#endif
-#if TARGET_JVM
- [Category ("NotWorking")]
#endif
public void Font_StringNull_Float ()
{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float ()
{
Font f = new Font (name, 12.5f);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle ()
{
Font f = new Font (name, 12.5f, FontStyle.Bold);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle_GraphicsUnit ()
{
Font f = new Font (name, 12.5f, FontStyle.Italic, GraphicsUnit.Pixel);
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle_GraphicsUnit_Display ()
{
new Font (name, 12.5f, FontStyle.Italic, GraphicsUnit.Display);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle_GraphicsUnit_Byte ()
{
Font f = new Font (name, 12.5f, FontStyle.Strikeout, GraphicsUnit.Inch, Byte.MaxValue);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle_GraphicsUnit_Byte_Bool ()
{
Font f = new Font (name, 12.5f, FontStyle.Underline, GraphicsUnit.Document, Byte.MinValue, true);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Bold);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle_GraphicsUnit ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Italic, GraphicsUnit.Millimeter);
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle_GraphicsUnit_Display ()
{
new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Italic, GraphicsUnit.Display);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle_GraphicsUnit_Byte ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Strikeout, GraphicsUnit.Inch, Byte.MaxValue);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle_GraphicsUnit_Byte_Bool ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Underline, GraphicsUnit.Document, Byte.MinValue, true);
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Dispose_Height ()
{
Font f = new Font (name, 12.5f);
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Dispose_ToLogFont ()
{
-#if !TARGET_JVM
Font f = new Font (name, 12.5f);
f.Dispose ();
LOGFONT lf = new LOGFONT();
f.ToLogFont (lf);
-#endif
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Dispose_ToLogFont_LoopCharSet ()
{
-#if !TARGET_JVM
Font f = new Font (name, 12.5f);
f.Dispose ();
LOGFONT lf = new LOGFONT ();
Assert.Fail ("Unexcepted exception {0} at iteration {1}", e, i);
}
}
-#endif
}
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Dispose_ToHFont ()
{
-#if !TARGET_JVM
Font f = new Font (name, 12.5f);
f.Dispose ();
f.ToHfont ();
-#endif
}
[Test]
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Check parameters")]
-#endif
public void Constructor_IconNull_Int_Int ()
{
new Icon ((Icon)null, 32, 32);
}
[Test]
-#if TARGET_JVM
- [Ignore ("Constructor_Icon_IntNegative_Int Not Working")]
-#endif
public void Constructor_Icon_IntNegative_Int ()
{
Icon neg = new Icon (icon, -32, 32);
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Check parameters")]
-#endif
public void Constructor_IconNull_Size ()
{
new Icon ((Icon) null, new Size (32, 32));
}
[Test]
-#if TARGET_JVM
- [Ignore ("Constructor_Icon_Size_Negative Not Working")]
-#endif
public void Constructor_Icon_Size_Negative ()
{
Icon neg = new Icon (icon, new Size (-32, -32));
}
[Test]
-#if TARGET_JVM
- [Ignore ("Constructor_Icon_Int_Int_NonSquare Not Working")]
-#endif
public void Constructor_Icon_Int_Int_NonSquare ()
{
Icon non_square = new Icon (icon, 32, 16);
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Check parameters")]
-#endif
public void Constructor_Type_StringNull ()
{
new Icon (typeof (Icon), null);
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Constructor_StreamNull_Size Not Implemented")]
-#endif
public void Constructor_StreamNull_Size ()
{
-#if !TARGET_JVM
new Icon ((Stream) null, new Size (32, 32));
-#endif
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
-#if TARGET_JVM
- [Ignore ("Constructor_StringNull_Size Not Implemented")]
-#endif
public void Constructor_StringNull_Size ()
{
-#if !TARGET_JVM
new Icon ((string) null, new Size (32, 32));
-#endif
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
-#if TARGET_JVM
- [Ignore ("Constructor_StringNull_Int_Int Not Implemented")]
-#endif
public void Constructor_StringNull_Int_Int ()
{
-#if !TARGET_JVM
new Icon ((string) null, 32, 32);
-#endif
}
#endif
Assert.AreEqual (32, clone.Size.Height, "Size.Height");
}
-#if !TARGET_JVM
[Test]
public void CloneHandleIcon ()
{
Assert.AreEqual (SystemIcons.Hand.Size.Width, clone.Size.Width, "Size.Width");
Assert.AreEqual (SystemIcons.Hand.Size.Height, clone.Size.Height, "Size.Height");
}
-#endif
private void XPIcon (int size)
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("SelectFromUnusualSize_Small16 Not Working")]
-#endif
public void SelectFromUnusualSize_Small16 ()
{
using (FileStream fs = File.OpenRead (TestBitmap.getInFile ("bitmaps/80509.ico"))) {
[Test]
[ExpectedException (typeof (NullReferenceException))]
-#if TARGET_JVM
- [Ignore ("Throws NullReference, do we need to follow?")]
-#endif
public void Save_Null ()
{
icon.Save (null);
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon16ToBitmap Not Working")]
-#endif
public void Icon16ToBitmap ()
{
using (Bitmap b = icon16.ToBitmap ()) {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon32ToBitmap Not Working")]
-#endif
public void Icon32ToBitmap ()
{
using (Bitmap b = icon32.ToBitmap ()) {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon48ToBitmap Not Working")]
-#endif
public void Icon48ToBitmap ()
{
using (Bitmap b = icon48.ToBitmap ()) {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon64ToBitmap Not Working")]
-#endif
public void Icon64ToBitmap ()
{
using (Bitmap b = icon64.ToBitmap ()) {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon96ToBitmap Not Working")]
-#endif
public void Icon96ToBitmap ()
{
using (Bitmap b = icon96.ToBitmap ()) {
}
[Test] // bug #415581
-#if TARGET_JVM
- [Ignore ("Icon256ToBitmap Not Working")]
-#endif
public void Icon256ToBitmap ()
{
using (FileStream fs = File.OpenRead (TestBitmap.getInFile ("bitmaps/415581.ico"))) {
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("ExtractAssociatedIcon is not implemented")]
-#endif
public void ExtractAssociatedIcon_Null ()
{
-#if !TARGET_JVM
Icon.ExtractAssociatedIcon (null);
-#endif
}
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("ExtractAssociatedIcon is not implemented")]
-#endif
public void ExtractAssociatedIcon_Empty ()
{
-#if !TARGET_JVM
Icon.ExtractAssociatedIcon (String.Empty);
-#endif
}
[Test]
[ExpectedException (typeof (FileNotFoundException))]
-#if TARGET_JVM
- [Ignore ("ExtractAssociatedIcon is not implemented")]
-#endif
public void ExtractAssociatedIcon_DoesNotExists ()
{
-#if !TARGET_JVM
Icon.ExtractAssociatedIcon ("does-not-exists.png");
-#endif
}
#endif
}
[TestFixture]
-#if TARGET_JVM
- [Ignore ("Unsafe code is not supported")]
-#endif
public class IconFullTrustTest {
-#if !TARGET_JVM
#if NET_2_0
[Test]
public void ExtractAssociatedIcon ()
IconTest.SaveAndCompare ("HICON", icon3, false);
}
}
-#endif
}
}
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (icoConv.CanConvertFrom (typeof (byte [])), "CCF#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertTo ()
{
Assert.IsTrue (icoConv.CanConvertTo (typeof (String)), "CCT#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Icon newIcon = (Icon) icoConv.ConvertFrom (null, CultureInfo.InvariantCulture, iconBytes);
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertTo ()
{
Assert.AreEqual (iconStr, (String) icoConv.ConvertTo (null,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (imgConv.CanConvertFrom (typeof (byte [])), "CCF#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertTo ()
{
Assert.IsTrue (imgConv.CanConvertTo (typeof (String)), "CCT#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFrom ()
{
Image newImage = (Image) imgConv.ConvertFrom (null, CultureInfo.InvariantCulture, imageBytes);
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_BadString ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_BadString_WithCulture ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_Bitmap ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_Point ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_SizeF ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_Object ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_BadString ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_BadString_Culture ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_Bitmap ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_Point ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_SizeF ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_Object ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertTo ()
{
Assert.AreEqual (imageStr, (String) imgConv.ConvertTo (null, CultureInfo.InvariantCulture,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Rectangle ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Image ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Size ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Bitmap ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Point ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Metafile ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Object ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Int ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Rectangle ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Image ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Size ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Bitmap ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Point ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Metafile ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Object ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Int ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetPropertiesSupported ()
{
Assert.IsTrue (imgConv.GetPropertiesSupported (), "GPS#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
#if NET_2_0
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (ptconv.CanConvertFrom (typeof (String)), "CCF#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Assert.AreEqual (pt, (Point) ptconv.ConvertFrom (null, CultureInfo.InvariantCulture,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
Attribute [] attrs;
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string ()
{
// save current culture
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (rconv.CanConvertFrom (typeof (String)), "CCF#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Assert.AreEqual (rect, (Rectangle) rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
Attribute [] attrs;
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string ()
{
// save current culture
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestCloneAndEquals()
{
Bitmap bmp = new Bitmap (600, 800);
/*Tests infinite, empty, etc*/
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestInfiniteAndEmpty()
{
Bitmap bmp = new Bitmap (600, 800);
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestUnionGroup1 ()
{
Bitmap bmp = new Bitmap (600, 800);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestUnionGroup2 ()
{
RectangleF[] rects;
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestComplementGroup1 ()
{
RectangleF[] rects;
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestComplementGroup2 ()
{
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestExcludeGroup1 ()
{
RectangleF[] rects;
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestExcludeGroup2 ()
{
Bitmap bmp = new Bitmap (600, 800);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ExcludeBug402613 ()
{
Region r = new Region();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestIntersect()
{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestXor()
{
Bitmap bmp = new Bitmap (600, 800);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestTranslate()
{
Region rgn1 = new Region (new RectangleF (10, 10, 120,120));
[Test]
[ExpectedException (typeof (ArgumentNullException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Constructor_GraphicsPath_Null ()
{
GraphicsPath gp = null;
[Test]
[ExpectedException (typeof (ArgumentNullException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Constructor_RegionData_Null ()
{
RegionData rd = null;
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_IntIntNull ()
{
Assert.IsTrue (new Region ().IsVisible (0, 0, null));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_IntIntIntIntNull ()
{
Assert.IsFalse (new Region ().IsVisible (0, 0, 0, 0, null));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_PointNull ()
{
Point p = new Point ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_PointFNull ()
{
PointF p = new PointF ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_RectangleNull ()
{
Rectangle r = new Rectangle ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_RectangleFNull ()
{
RectangleF r = new RectangleF ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_SingleSingleNull ()
{
Assert.IsTrue (new Region ().IsVisible (0f, 0f, null));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_SingleSingleSingleSingleNull ()
{
Assert.IsFalse (new Region ().IsVisible (0f, 0f, 0f, 0f, null));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
[ExpectedException (typeof (ArgumentNullException))]
public void Equals_NullGraphics ()
{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
[ExpectedException (typeof (ArgumentNullException))]
public void GetRegionScans_Null ()
{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Region_Empty ()
{
Region region = new Region ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Rectangle_GetRegionScans ()
{
Matrix matrix = new Matrix ();
}
[TestFixture]
-#if TARGET_JVM
- [Ignore ("Unsafe code is not supported")]
-#endif
// the test cases in this fixture aren't restricted wrt running unmanaged code
public class RegionTestUnmanaged {
-#if !TARGET_JVM
private Bitmap bitmap;
private Graphics graphic;
Assert.IsFalse (IntPtr.Zero == ptr, "ptr");
r.ReleaseHrgn (ptr);
}
-#endif
#endif
}
}
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (szconv.CanConvertFrom (typeof (String)), "CCF#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Assert.AreEqual (sz, (Size) szconv.ConvertFrom (null, CultureInfo.InvariantCulture,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
Attribute [] attrs;
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string ()
{
// save current culture
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (szconv.CanConvertFrom (typeof (String)), "CCF#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Assert.AreEqual (sz, (SizeF) szconv.ConvertFrom (null, CultureInfo.InvariantCulture,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
Attribute [] attrs;
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string ()
{
// save current culture
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string_exc_2 ()
{
try {
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Default_Dispose ()
{
StringFormat sf = new StringFormat ();
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ctor_StringFormatFlags ()
{
using (StringFormat sf = new StringFormat ((StringFormatFlags)Int32.MinValue)) {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ctor_StringFormatFlags_Int32 ()
{
using (StringFormat sf = new StringFormat ((StringFormatFlags) Int32.MinValue, Int32.MinValue)) {
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void GenericDefault_Local_Dispose ()
{
StringFormat sf = StringFormat.GenericDefault;
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void GenericTypographic_Local_Dispose ()
{
StringFormat sf = StringFormat.GenericTypographic;
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Alignment_Invalid ()
{
using (StringFormat sf = new StringFormat ()) {
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void HotkeyPrefix_Invalid ()
{
using (StringFormat sf = new StringFormat ()) {
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void LineAlignment_Invalid ()
{
using (StringFormat sf = new StringFormat ()) {
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Trimming_Invalid ()
{
using (StringFormat sf = new StringFormat ()) {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Clone_Complex ()
{
using (StringFormat sf = new StringFormat ()) {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TabsStops()
{
using (StringFormat smf = new StringFormat ()) {
[Test]
[ExpectedException (typeof (NullReferenceException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetTabStops_Null ()
{
using (StringFormat sf = new StringFormat ()) {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetDigitSubstitution ()
{
using (StringFormat sf = new StringFormat ()) {
[Test]
[ExpectedException (typeof (NullReferenceException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetMeasurableCharacterRanges_Null ()
{
using (StringFormat sf = new StringFormat ()) {
[Test]
[ExpectedException (typeof (OverflowException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetMeasurableCharacterRanges_TooBig ()
{
using (StringFormat sf = new StringFormat ()) {
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
-#if !TARGET_JVM
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../ecma.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: CLSCompliant (false)]
\r
public static void Shutdown ()\r
{\r
-#if !TARGET_JVM\r
if (_poolThread != null)\r
_poolThread.Abort();\r
-#endif\r
}\r
\r
public static int MaxOpenConnections\r
RemotingThreadPool threadPool;
-#if TARGET_JVM
- private volatile bool stopped = false;
-#endif
void Init (IServerChannelSinkProvider serverSinkProvider)
{
{
try
{
-#if !TARGET_JVM
while(true)
-#else
- while(!stopped)
-#endif
{
Socket socket = listener.AcceptSocket ();
ClientConnection reader = new ClientConnection (this, socket, sink);
public void StartListening (object data)
{
-#if TARGET_JVM
- stopped = false;
-#endif
listener = new TcpListener (bindAddress, port);
if (server_thread == null)
{
public void StopListening (object data)
{
-#if TARGET_JVM
- stopped = true;
-#endif
if (server_thread == null) return;
-#if !TARGET_JVM
server_thread.Abort ();
-#else
- server_thread.Interrupt ();
-#endif
listener.Stop ();
threadPool.Free ();
server_thread.Join ();
RemotingSurrogateSelector surrogateSelector = new RemotingSurrogateSelector ();
StreamingContext context = new StreamingContext (StreamingContextStates.Remoting, null);
-#if !TARGET_JVM
_serializationFormatter = new BinaryFormatter (surrogateSelector, context);
_deserializationFormatter = new BinaryFormatter (null, context);
-#else
- _serializationFormatter = (BinaryFormatter) vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (surrogateSelector, context, false);
- _deserializationFormatter = (BinaryFormatter) vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (null, context, false);
-#endif
_serializationFormatter.FilterLevel = _filterLevel;
_deserializationFormatter.FilterLevel = _filterLevel;
AutoResetEvent threadDone = new AutoResetEvent (false);
ArrayList runningThreads = new ArrayList ();
-#if TARGET_JVM
- volatile
-#endif
bool stopped = false;
static object globalLock = new object ();
threadDone.Set ();
workItems.Clear ();
foreach (Thread t in runningThreads)
-#if !TARGET_JVM
t.Abort ();
-#else
- t.Interrupt();
-#endif
runningThreads.Clear ();
}
if (this == sharedPool)
void PoolThread ()
{
-#if !TARGET_JVM
while (true) {
-#else
- while (!stopped)
- {
-#endif
ThreadStart work = null;
do {
lock (workItems) {
if (sf != null) {\r
if(_serverFaultExceptionField != null)\r
e = (Exception) _serverFaultExceptionField.GetValue(sf);\r
-#if TARGET_JVM \r
- if (e == null && sf.ExceptionType != null)\r
- {\r
- try\r
- {\r
- Type te = Type.GetType(sf.ExceptionType);\r
- if (te != null)\r
- {\r
- ConstructorInfo ce = te.GetConstructor(\r
- BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance,\r
- null, new Type[] {typeof(string)}, null);\r
-\r
- if (ce != null)\r
- {\r
- e = (Exception) ce.Invoke(new object[] {sf.ExceptionMessage});\r
- }\r
- else\r
- {\r
- e = (Exception) Activator.CreateInstance(te);\r
- }\r
- }\r
- }\r
- catch\r
- {\r
- e = null;\r
- }\r
- }\r
-#endif\r
}\r
if (e == null)\r
e = new RemotingException (fault.FaultString);\r
\r
object GetNullValue (Type paramType)\r
{\r
-#if TARGET_JVM \r
- if (paramType.IsEnum)\r
- {\r
- return Activator.CreateInstance(paramType);\r
- }\r
-#endif\r
switch (Type.GetTypeCode (paramType))\r
{\r
case TypeCode.Boolean: return false;\r
case TypeCode.UInt32: return (uint)0;\r
case TypeCode.UInt64: return (ulong)0;\r
default: \r
-#if TARGET_JVM \r
- if (paramType.IsValueType)\r
- {\r
- return Activator.CreateInstance(paramType);\r
- }\r
-#endif \r
return null;\r
}\r
}\r
using System.Xml;
using System.Reflection;
using System.Net;
-#if !TARGET_JVM
using System.CodeDom.Compiler;
using Microsoft.CSharp;
-#endif
namespace System.Runtime.Remoting.MetadataServices
{
{
}
-#if !TARGET_JVM
[MonoTODO ("strong name")]
public static void ConvertCodeSourceFileToAssemblyFile (
string codePath,
memStream.Position = 0;
cg.GenerateCode (clientProxy, outputDirectory, memStream, outCodeStreamList, proxyUrl, proxyNamespace);
}
-#endif
public static void ConvertTypesToSchemaToFile (ServiceType [] types, SdlType sdlType, string path)
{
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: ComVisible (true)]
object objReturn = \r
FormatterServices.GetUninitializedObject(type);\r
\r
-#if NET_2_0 && !TARGET_JVM\r
+#if NET_2_0\r
objMgr.RaiseOnDeserializingEvent (objReturn);\r
#endif\r
if(objReturn is ISerializable)\r
private FormatterAssemblyStyle _assemblyFormat = FormatterAssemblyStyle.Full;\r
private FormatterTypeStyle _typeFormat = FormatterTypeStyle.TypesWhenNeeded;\r
private static string defaultMessageNamespace;\r
-#if NET_2_0 && !TARGET_JVM\r
+#if NET_2_0\r
SerializationObjectManager _manager;\r
#endif\r
\r
_xmlWriter.Formatting = Formatting.Indented;\r
_surrogateSelector = selector;\r
_context = context;\r
-#if NET_2_0 && !TARGET_JVM\r
+#if NET_2_0\r
_manager = new SerializationObjectManager (_context);\r
#endif\r
}\r
Thread.CurrentThread.CurrentCulture = savedCi;\r
}\r
\r
-#if NET_2_0 && !TARGET_JVM\r
+#if NET_2_0\r
_manager.RaiseOnSerializedEvent ();\r
#endif\r
}\r
}\r
if(currentObject is ISerializable || surrogate != null) needsSerializationInfo = true;\r
\r
-#if NET_2_0 && !TARGET_JVM\r
+#if NET_2_0\r
_manager.RegisterObject (currentObject);\r
#endif\r
\r
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../ecma.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: BestFitMapping (false)]
[assembly: NeutralResourcesLanguage ("en-US")]
-#if !(TARGET_JVM || TARGET_DOTNET)
+#if !(TARGET_DOTNET)
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../winfx.pub")]
[assembly: NeutralResourcesLanguage ("en-US")]
-#if !(TARGET_JVM || TARGET_DOTNET)
+#if !(TARGET_DOTNET)
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../winfx.pub")]
rset = new ResourceManager (scriptResourceName, assembly).GetResourceSet (Threading.Thread.CurrentThread.CurrentUICulture, true, true);\r
}\r
catch (MissingManifestResourceException) {\r
-#if TARGET_JVM // GetResourceSet does not throw MissingManifestResourceException if ressource is not exists\r
- }\r
- if (rset == null) {\r
-#endif\r
if (scriptResourceName.EndsWith (".resources", RuntimeHelpers.StringComparison)) {\r
scriptResourceName = scriptResourceName.Substring (0, scriptResourceName.Length - 10);\r
rset = new ResourceManager (scriptResourceName, assembly).GetResourceSet (Threading.Thread.CurrentThread.CurrentUICulture, true, true);\r
}\r
-#if !TARGET_JVM\r
else\r
throw;\r
-#endif\r
}\r
if (rset == null)\r
break;\r
if (url.EndsWith (AuthenticationService.DefaultWebServicePath, StringComparison.Ordinal))
handlerType = typeof(AuthenticationService);
else {
-#if !TARGET_JVM
handlerType = BuildManager.GetCompiledType (url);
-#endif
if (handlerType == null)
handlerType = WebServiceParser.GetCompiledType (url, context);
}
scd.AddComponentProperty ("myName2", "myCompId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, null, {\"myName2\":\"myCompId2\",\"myName1\":\"myCompId1\"}, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, null, null, {\"myName1\":\"myCompId1\",\"myName2\":\"myCompId2\"}, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddElementProperty ("myName2", "myElemId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":$get(\"myElemId2\"),\"myName1\":$get(\"myElemId1\")}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":$get(\"myElemId1\"),\"myName2\":$get(\"myElemId2\")}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddProperty ("myName2", "myValue2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":\"myValue2\",\"myName1\":\"myValue1\"}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":\"myValue1\",\"myName2\":\"myValue2\"}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddProperty ("myName2", null);
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":null,\"myName1\":null}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":null,\"myName2\":null}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddEvent ("myName2", "myHandler2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, {\"myName2\":myHandler2,\"myName1\":myHandler1}, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, null, {\"myName1\":myHandler1,\"myName2\":myHandler2}, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddScriptProperty ("myName2", "myScript2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":myScript2,\"myName1\":myScript1}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":myScript1,\"myName2\":myScript2}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Test]
scd.AddComponentProperty ("myName2", "myCompId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, null, {\"myName2\":\"myCompId2\",\"myName1\":\"myCompId1\"});", script);
-#else
Assert.AreEqual ("$create(My.Type, null, null, {\"myName1\":\"myCompId1\",\"myName2\":\"myCompId2\"});", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddElementProperty ("myName2", "myElemId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":$get(\"myElemId2\"),\"myName1\":$get(\"myElemId1\")}, null, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":$get(\"myElemId1\"),\"myName2\":$get(\"myElemId2\")}, null, null);", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddProperty ("myName2", "myValue2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":\"myValue2\",\"myName1\":\"myValue1\"}, null, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":\"myValue1\",\"myName2\":\"myValue2\"}, null, null);", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddProperty ("myName2", null);
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":null,\"myName1\":null}, null, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":null,\"myName2\":null}, null, null);", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddEvent ("myName2", "myHandler2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, {\"myName2\":myHandler2,\"myName1\":myHandler1}, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, null, {\"myName1\":myHandler1,\"myName2\":myHandler2}, null);", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddScriptProperty ("myName2", "myScript2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":myScript2,\"myName1\":myScript1}, null, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":myScript1,\"myName2\":myScript2}, null, null);", script);
-#endif
}
[Test]
scd.AddComponentProperty ("myName2", "myCompId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, null, {\"myName2\":\"myCompId2\",\"myName1\":\"myCompId1\"}, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, null, null, {\"myName1\":\"myCompId1\",\"myName2\":\"myCompId2\"}, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddElementProperty ("myName2", "myElemId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":$get(\"myElemId2\"),\"myName1\":$get(\"myElemId1\")}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":$get(\"myElemId1\"),\"myName2\":$get(\"myElemId2\")}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddProperty ("myName2", "myValue2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":\"myValue2\",\"myName1\":\"myValue1\"}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":\"myValue1\",\"myName2\":\"myValue2\"}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddProperty ("myName2", null);
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":null,\"myName1\":null}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":null,\"myName2\":null}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddEvent ("myName2", "myHandler2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, {\"myName2\":myHandler2,\"myName1\":myHandler1}, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, null, {\"myName1\":myHandler1,\"myName2\":myHandler2}, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddScriptProperty ("myName2", "myScript2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":myScript2,\"myName1\":myScript1}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":myScript1,\"myName2\":myScript2}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Test]
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
class WSConfig
{
-#if !TARGET_JVM
volatile static WSConfig instance;
-#else
- static WSConfig instance {
- get {
- return (WSConfig)AppDomain.CurrentDomain.GetData("WSConfig.instance");
- }
- set {
- AppDomain.CurrentDomain.SetData("WSConfig.instance", value);
- }
- }
-
-#endif
WSProtocol protocols;
string wsdlHelpPage;
string filePath;
namespace System.Web.Services.Description {
public sealed class ServiceDescriptionCollection : ServiceDescriptionBaseCollection {
-#if !TARGET_JVM //code generation is not supported
ServiceDescriptionImporter importer;
-#endif
#region Constructors
#endregion // Properties
#region Methods
-#if !TARGET_JVM //code generation is not supported
internal void SetImporter (ServiceDescriptionImporter i)
{
importer = i;
}
-#endif
public int Add (ServiceDescription serviceDescription)
{
Insert (Count, serviceDescription);
}
}
- #if !TARGET_JVM
internal class XmlSerializerContract : System.Xml.Serialization.XmlSerializerImplementation
{
System.Collections.Hashtable readMethods = null;
}
}
- #endif
}
#endif
public abstract class SoapTransportImporter {
#region Fields
-#if !TARGET_JVM
static ArrayList transportImporters;
-#else
- static ArrayList transportImporters {
- get {
- return (ArrayList)AppDomain.CurrentDomain.GetData("SoapTransportImporter.transportImporters");
- }
- set {
- AppDomain.CurrentDomain.SetData("SoapTransportImporter.transportImporters", value);
- }
- }
-#endif
SoapProtocolImporter importContext;
#endregion // Fields
string physPath = Path.Combine (path, help);
-#if !TARGET_JVM
if (!File.Exists (physPath))
throw new InvalidOperationException ("Documentation page '" + physPath + "' not found");
-#endif
_pageHandler = PageParser.GetCompiledPageInstance (vpath, physPath, context);
}
if (key == "wsdl") GenerateWsdlDocument (context, req.QueryString ["wsdl"]);
else if (key == "schema") GenerateSchema (context, req.QueryString ["schema"]);
-#if !TARGET_JVM //code generation is not supported
else if (key == "code") GenerateCode (context, req.QueryString ["code"]);
-#else
- else if (key == "code") throw new Exception("Code generation is not supported.");
-#endif
else if (key == "disco") GenerateDiscoDocument (context);
else throw new Exception ("This should never happen");
}
GetSchemas() [di].Write (xtw);
}
-#if !TARGET_JVM
void GenerateCode (HttpContext context, string langId)
{
context.Response.ContentType = "text/plain; charset=utf-8";
return provider;
}
-#endif
internal ServiceDescriptionCollection GetDescriptions ()
{
public abstract void ProcessMessage (SoapMessage message);
-#if !TARGET_JVM
static ArrayList[] globalExtensions;
-#else
- static ArrayList[] globalExtensions {
- get {
- return (ArrayList[])AppDomain.CurrentDomain.GetData("SoapExtension.globalExtensions");
- }
- set {
- AppDomain.CurrentDomain.SetData("SoapExtension.globalExtensions", value);
- }
- }
-#endif
internal static SoapExtension[] CreateExtensionChain (SoapExtensionRuntimeConfig[] extensionConfigs)
{
//
internal class TypeStubManager
{
-#if !TARGET_JVM
static Hashtable type_to_manager;
-#else
- const string type_to_manager_key = "TypeStubManager.type_to_manager";
- static Hashtable type_to_manager {
- get {
- Hashtable hash = (Hashtable)AppDomain.CurrentDomain.GetData(type_to_manager_key);
-
- if (hash != null)
- return hash;
-
- lock(type_to_manager_key) {
- AppDomain.CurrentDomain.SetData(type_to_manager_key, new Hashtable());
- }
-
- return (Hashtable)AppDomain.CurrentDomain.GetData(type_to_manager_key);
- }
- set {
- //do nothing: we manage our type_to_manager per domain
- }
- }
-#endif
static TypeStubManager ()
{
//
WebRequest current_request;
-#if !TARGET_JVM
static HybridDictionary cache;
-#else
- static HybridDictionary cache {
- get {
- return (HybridDictionary)AppDomain.CurrentDomain.GetData("WebClientProtocol.cache");
- }
- set {
- AppDomain.CurrentDomain.SetData("WebClientProtocol.cache", value);
- }
- }
-#endif
#endregion
#region Constructors
#endif
Type type;
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
type = BuildManager.GetCompiledType (url);
#else
type = WebServiceParser.GetCompiledType (fp, context);
#if !NET_4_0
[assembly: AssemblyTrademark("")]
#endif
-#if TARGET_JVM
-[assembly: CLSCompliant(false)]
-#else
[assembly: CLSCompliant(true)]
-#endif
[assembly: ComVisible(false)]
[assembly: AssemblyDefaultAlias("System.Web.dll")]
[assembly: AssemblyInformationalVersion("0.0.0.1")]
[assembly: AllowPartiallyTrustedCallers()]
[assembly: TagPrefix("System.Web.UI.WebControls", "asp")]
-#if !(TARGET_JVM || TARGET_DOTNET)
+#if !(TARGET_DOTNET)
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile("../msfinal.pub")]
ConfigurationPropertyOptions.None);
assemblyPostProcessorTypeProp = new ConfigurationProperty ("assemblyPostProcessorType", typeof (string), "");
batchProp = new ConfigurationProperty ("batch", typeof (bool), true);
-#if !TARGET_JVM
buildProvidersProp = new ConfigurationProperty ("buildProviders", typeof (BuildProviderCollection), null,
null, PropertyHelper.DefaultValidator,
ConfigurationPropertyOptions.None);
-#endif
batchTimeoutProp = new ConfigurationProperty ("batchTimeout", typeof (TimeSpan), new TimeSpan (0, 15, 0),
PropertyHelper.TimeSpanSecondsOrInfiniteConverter,
PropertyHelper.PositiveTimeSpanValidator,
properties.Add (assembliesProp);
properties.Add (assemblyPostProcessorTypeProp);
properties.Add (batchProp);
-#if !TARGET_JVM
properties.Add (buildProvidersProp);
-#endif
properties.Add (batchTimeoutProp);
properties.Add (codeSubDirectoriesProp);
properties.Add (compilersProp);
set { base [batchTimeoutProp] = value; }
}
-#if !TARGET_JVM
[ConfigurationProperty ("buildProviders")]
public BuildProviderCollection BuildProviders {
get { return (BuildProviderCollection) base [buildProvidersProp]; }
}
-#endif
[ConfigurationProperty ("codeSubDirectories")]
public CodeSubDirectoriesCollection CodeSubDirectories {
get { return (ClientTargetSection)Sections ["clientTarget"]; }
}
-#if !TARGET_JVM
[ConfigurationProperty ("compilation")]
public CompilationSection Compilation {
get { return (CompilationSection)Sections ["compilation"]; }
}
-#endif
[ConfigurationProperty ("customErrors")]
public CustomErrorsSection CustomErrors {
extra = QueryParamSeparator + "n=" + (notifyScriptLoaded ? "t" : "f");
#endif
-#if TARGET_JVM
- atime = QueryParamSeparator + "t=" + assemblyName.GetHashCode ();
-#else
if (includeTimeStamp) {
if (!String.IsNullOrEmpty (assemblyPath) && File.Exists (assemblyPath))
atime = QueryParamSeparator + "t=" + File.GetLastWriteTimeUtc (assemblyPath).Ticks;
else
atime = QueryParamSeparator + "t=" + DateTime.UtcNow.Ticks;
}
-#endif
string d = HttpUtility.UrlEncode (assemblyNameHash + "_" + resourceNameHash + (debug ? "_t" : "_f"));
string href = HandlerFileName + "?d=" + d + atime + extra;
HttpContext ctx = HttpContext.Current;
//
// http://www.west-wind.com/presentations/aspnetruntime/aspnetruntime.asp
//
-#if TARGET_JVM
- [MonoNotSupported ("")]
-#endif
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public static object CreateApplicationHost (Type hostType, string virtualDir, string physicalDir)
{
void ChangeToSSLSocket ()
{
-#if TARGET_JVM
- java.lang.Class c = vmw.common.TypeUtils.ToClass (smtp.Stream);
- java.lang.reflect.Method m = c.getMethod ("ChangeToSSLSocket", null);
- m.invoke (smtp.Stream, new object[]{});
-#else
// Load Mono.Security.dll
Assembly a;
try {
if (objSslClientStream != null)
smtp = new SmtpStream ((Stream)objSslClientStream);
-#endif
}
void ReadFields (MailMessageWrapper msg)
}
}
-#if TARGET_JVM
- static AnonymousIdentificationSection Config
- {
- get
- {
- AnonymousIdentificationSection config = (AnonymousIdentificationSection) AppDomain.CurrentDomain.GetData ("Anonymous.Config");
- if (config == null) {
- lock (typeof (AnonymousIdentificationModule)) {
- config = (AnonymousIdentificationSection) AppDomain.CurrentDomain.GetData ("Anonymous.Config");
- if (config == null)
- config = (AnonymousIdentificationSection) WebConfigurationManager.GetSection ("system.web/anonymousIdentification");
- AppDomain.CurrentDomain.SetData ("Anonymous.Config", config);
- }
- }
- return config;
- }
- }
-#else
static AnonymousIdentificationSection Config = (AnonymousIdentificationSection) WebConfigurationManager.GetSection ("system.web/anonymousIdentification");
-#endif
}
}
#endif
{
[ToolboxItem (false)]
[DesignerAttribute ("System.Web.UI.Design.WebControls.ContentDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
-#if !TARGET_JVM
[ControlBuilder(typeof(ContentBuilderInternal))]
-#endif
public class Content: Control, INamingContainer, INonBindingContainer
{
[ThemeableAttribute (false)]
public void ToggleExpandState ()
{
-#if TARGET_JVM //No support for Nullable<bool>.GetValueOrDefault() yet
- bool? value = Expanded;
- Expanded = value.HasValue ? !value.Value : true;
-#else
Expanded = !Expanded.GetValueOrDefault(false);
-#endif
}
void IStateManager.LoadViewState (object savedState)
protected virtual void AddAttribute (string name, string value, HtmlTextWriterAttribute key)
{
NextAttrStack ();
-#if TARGET_JVM
- if (attrs [attrs_pos] == null)
- attrs [attrs_pos] = new AddedAttr ();
-#endif
attrs [attrs_pos].name = name;
attrs [attrs_pos].value = value;
attrs [attrs_pos].key = key;
protected virtual void AddStyleAttribute (string name, string value, HtmlTextWriterStyle key)
{
NextStyleStack ();
-#if TARGET_JVM
- if (styles [styles_pos] == null)
- styles [styles_pos] = new AddedStyle ();
-#endif
styles [styles_pos].name = name;
value = HttpUtility.HtmlAttributeEncode (value);
styles [styles_pos].value = value;
return tagstack [tagstack_pos].key;
}
set {
-#if TARGET_JVM
- if (tagstack [tagstack_pos] == null)
- tagstack [tagstack_pos] = new AddedTag ();
-#endif
tagstack [tagstack_pos].key = value;
tagstack [tagstack_pos].name = GetTagName (value);
}
return tagstack [tagstack_pos].name;
}
set {
-#if TARGET_JVM
- if (tagstack [tagstack_pos] == null)
- tagstack [tagstack_pos] = new AddedTag ();
-#endif
tagstack [tagstack_pos].name = value;
tagstack [tagstack_pos].key = GetTagKey (value);
if (tagstack [tagstack_pos].key != HtmlTextWriterTag.Unknown)
int styles_pos = -1, attrs_pos = -1, tagstack_pos = -1;
-#if TARGET_JVM
- class
-#else
struct
-#endif
AddedTag {
public string name;
public HtmlTextWriterTag key;
public bool ignore;
}
-#if TARGET_JVM
- class
-#else
struct
-#endif
AddedStyle {
public string name;
public HtmlTextWriterStyle key;
public string value;
}
-#if TARGET_JVM
- class
-#else
struct
-#endif
AddedAttr {
public string name;
public HtmlTextWriterAttribute key;
namespace System.Web.UI
{
-#if (TARGET_JVM || TARGET_DOTNET)
+#if (TARGET_DOTNET)
public
#endif
interface IScriptManager
var req = context.Request;
if (req != null)
masterPageFile = HostingEnvironment.VirtualPathProvider.CombineVirtualPaths (req.CurrentExecutionFilePath, masterPageFile);
-#if TARGET_JVM
- MasterPage masterPage = MasterPageParser.GetCompiledMasterInstance (masterPageFile,
- owner.Page.MapPath (masterPageFile),
- context);
-#else
MasterPage masterPage = BuildManager.CreateInstanceFromVirtualPath (masterPageFile, typeof (MasterPage)) as MasterPage;
-#endif
if (masterPage == null)
throw new HttpException ("Failed to create MasterPage instance for '" + masterPageFile + "'.");
if (ps != null)
_styleSheetTheme = ps.StyleSheetTheme;
}
-#if TARGET_JVM
- if (_styleSheetTheme != null && _styleSheetTheme != "")
- _styleSheetPageTheme = ThemeDirectoryCompiler.GetCompiledInstance (_styleSheetTheme, Context);
-#else
+
if (!String.IsNullOrEmpty (_styleSheetTheme)) {
string virtualPath = "~/App_Themes/" + _styleSheetTheme;
_styleSheetPageTheme = BuildManager.CreateInstanceFromVirtualPath (virtualPath, typeof (PageTheme)) as PageTheme;
}
-#endif
}
void InitializeTheme ()
if (ps != null)
_theme = ps.Theme;
}
-#if TARGET_JVM
- if (_theme != null && _theme != "") {
- _pageTheme = ThemeDirectoryCompiler.GetCompiledInstance (_theme, Context);
- _pageTheme.SetPage (this);
- }
-#else
+
if (!String.IsNullOrEmpty (_theme)) {
string virtualPath = "~/App_Themes/" + _theme;
_pageTheme = BuildManager.CreateInstanceFromVirtualPath (virtualPath, typeof (PageTheme)) as PageTheme;
if (_pageTheme != null)
_pageTheme.SetPage (this);
}
-#endif
}
#if NET_4_0
public Control AutoPostBackControl {
OnError (EventArgs.Empty);
if (_context.HasError (e)) {
_context.ClearError (e);
-#if TARGET_JVM
- vmw.common.TypeUtils.Throw (e);
-#else
throw new HttpUnhandledException (null, e);
-#endif
}
}
}
if (asyncResults.Count > 0) {
-#if TARGET_JVM
- TimeSpan timeout = AsyncTimeout;
- long t1 = DateTime.Now.Ticks;
- bool signalled = true;
- for (int i = 0; i < asyncResults.Count; i++) {
- if (asyncResults [i].IsCompleted)
- continue;
-
- if (signalled)
- signalled = asyncResults [i].AsyncWaitHandle.WaitOne (timeout, false);
-
- if (signalled) {
- long t2 = DateTime.Now.Ticks;
- timeout = AsyncTimeout - TimeSpan.FromTicks (t2 - t1);
- if (timeout.Ticks <= 0)
- signalled = false;
- } else
- localParallelTasks [i].TimeoutHandler (asyncResults [i]);
- }
-#else
WaitHandle [] waitArray = new WaitHandle [asyncResults.Count];
int i = 0;
for (i = 0; i < asyncResults.Count; i++) {
}
}
}
-#endif
}
DateTime endWait = DateTime.Now;
TimeSpan elapsed = endWait - startExecution;
public override string Get (string name)
{
if (!_loaded) {
-#if TARGET_JVM
- return InternalGet (name);
-#else
string s = InternalGet (name);
if (s != null && s.Length > 0)
return s;
LoadInfo ();
-#endif
}
return base.Get (name);
BrowserData parent;
string text;
string pattern;
-#if TARGET_JVM
- java.util.regex.Pattern regex;
-#else
Regex regex;
-#endif
ListDictionary data;
public BrowserData (string pattern)
lock (this_lock) {
if (regex == null)
-#if TARGET_JVM
- regex = java.util.regex.Pattern.compile (pattern);
-#else
regex = new Regex (pattern);
-#endif
}
-#if TARGET_JVM
- return regex.matcher ((java.lang.CharSequence) (object) expression).matches ();
-#else
return regex.Match (expression).Success;
-#endif
}
}
static Hashtable defaultCaps;
static readonly object lockobj = new object ();
-#if TARGET_JVM
- static bool loaded {
- get {
- return alldata != null;
- }
- set {
- if (alldata == null)
- alldata = new ArrayList ();
- }
- }
-
- const string alldataKey = "System.Web.CapabilitiesLoader.alldata";
- static ICollection alldata {
- get {
- return (ICollection) AppDomain.CurrentDomain.GetData (alldataKey);
- }
- set {
- AppDomain.CurrentDomain.SetData (alldataKey, value);
- }
- }
-
- const string userAgentsCacheKey = "System.Web.CapabilitiesLoader.userAgentsCache";
- static Hashtable userAgentsCache {
- get {
- lock (typeof (CapabilitiesLoader)) {
- Hashtable agentsCache = (Hashtable) AppDomain.CurrentDomain.GetData (userAgentsCacheKey);
- if (agentsCache == null) {
- agentsCache = Hashtable.Synchronized (new Hashtable (userAgentsCacheSize + 10));
- AppDomain.CurrentDomain.SetData (userAgentsCacheKey, agentsCache);
- }
-
- return agentsCache;
- }
- }
- }
-#else
static volatile bool loaded;
static ICollection alldata;
static Hashtable userAgentsCache = Hashtable.Synchronized(new Hashtable(userAgentsCacheSize+10));
-#endif
CapabilitiesLoader () {}
context.Handler = handler;
context.PushHandler (handler);
} catch (FileNotFoundException fnf){
-#if TARGET_JVM
- Console.WriteLine ("$$$$$$$$$$:Sys.Web Pipeline");
- Console.WriteLine (fnf.ToString ());
-#endif
if (context.Request.IsLocal)
ProcessError (HttpException.NewWithCode (404,
String.Format ("File not found {0}", fnf.FileName),
th.CurrentUICulture = new_app_culture;
}
-#if !TARGET_JVM
prev_user = Thread.CurrentPrincipal;
-#endif
}
void PostDone ()
}
Thread th = Thread.CurrentThread;
-#if !TARGET_JVM
if (Thread.CurrentPrincipal != prev_user)
Thread.CurrentPrincipal = prev_user;
-#endif
if (prev_appui_culture != null && prev_appui_culture != th.CurrentUICulture)
th.CurrentUICulture = prev_appui_culture;
if (prev_app_culture != null && prev_app_culture != th.CurrentCulture)
cultures [0] = Thread.CurrentThread.CurrentCulture;
cultures [1] = Thread.CurrentThread.CurrentUICulture;
-#if TARGET_JVM
- if (true)
-#else
if (Thread.CurrentThread.IsThreadPoolThread)
-#endif
Start (null);
else
ThreadPool.QueueUserWorkItem (x => {
if (type != null)
return type;
-#if !TARGET_JVM
Assembly [] assemblies = AppDomain.CurrentDomain.GetAssemblies ();
foreach (Assembly ass in assemblies) {
type = ass.GetType (typeName, false);
if (type != null)
return type;
-#endif
if (throwOnMissing)
throw new TypeLoadException (String.Format ("Type '{0}' cannot be found", typeName), loadException);
[ThreadStatic]
static Dictionary <string, IResourceProvider> resource_providers;
-#if TARGET_JVM
- const string app_global_res_key = "HttpContext.app_global_res_key";
- internal static Assembly AppGlobalResourcesAssembly {
- get { return (Assembly) AppDomain.CurrentDomain.GetData (app_global_res_key); }
- set { AppDomain.CurrentDomain.SetData (app_global_res_key, value); }
- }
-#else
internal static Assembly AppGlobalResourcesAssembly;
-#endif
ProfileBase profile = null;
LinkedList<IHttpHandler> handlers;
// The "Current" property is set just after we have constructed it with
// the 'HttpContext (HttpWorkerRequest)' constructor.
//
-#if !TARGET_JVM // No remoting CallContext support in Grasshopper
public static HttpContext Current {
get {
return (HttpContext) CallContext.GetData ("c");
CallContext.SetData ("c", value);
}
}
-#endif
public Exception Error {
get {
return (cfg.Mode == CustomErrorMode.RemoteOnly) && !Request.IsLocal;
}
}
-#if !TARGET_JVM
public bool IsDebuggingEnabled {
get { return RuntimeHelpers.DebuggingEnabled; }
}
-#endif
public IDictionary Items {
get {
if (items == null)
}
}
-#if !TARGET_JVM
public WindowsIdentity LogonUserIdentity {
get { throw new NotImplementedException (); }
}
-#endif
string anonymous_id;
public string AnonymousID {
// GetSubStream returns a 'copy' of the InputStream with Position set to 0.
static Stream GetSubStream (Stream stream)
{
-#if !TARGET_JVM
if (stream is IntPtrStream)
return new IntPtrStream (stream);
-#endif
if (stream is MemoryStream) {
MemoryStream other = (MemoryStream) stream;
input_stream = new MemoryStream (ms.GetBuffer (), 0, (int) ms.Length, false, true);
}
-#if !TARGET_JVM
const int INPUT_BUFFER_SIZE = 32*1024;
TempFileStream GetTempStream ()
if (total < content_length)
throw HttpException.NewWithCode (411, "The request body is incomplete.", WebEventCodes.WebErrorOtherError);
}
-#endif
internal void ReleaseResources ()
{
if (!isAppVirtualPath && !virtualPath.StartsWith (appVirtualPath, RuntimeHelpers.StringComparison))
throw new InvalidOperationException (String.Format ("Failed to map path '{0}'", virtualPath));
-#if TARGET_JVM
- return worker_request.MapPath (virtualPath);
-#else
string path = worker_request.MapPath (virtualPath);
if (virtualPath [virtualPath.Length - 1] != '/' && path [path.Length - 1] == System.IO.Path.DirectorySeparatorChar)
path = path.TrimEnd (System.IO.Path.DirectorySeparatorChar);
return path;
-#endif
}
public void SaveAs (string filename, bool includeHeaders)
Flush ();
}
-#if TARGET_JVM
- public void WriteFile (IntPtr fileHandle, long offset, long size) {
- throw new PlatformNotSupportedException("IntPtr not supported");
- }
-#else
public void WriteFile (IntPtr fileHandle, long offset, long size)
{
if (offset < 0)
output_stream.ApplyFilter (false);
Flush ();
}
-#endif
public void WriteFile (string filename, long offset, long size)
{
filter = value;
}
}
-#if TARGET_JVM
-
- class BlockManager {
- const int PreferredLength = 16 * 1024;
- static readonly byte[] EmptyBuffer = new byte[0];
-
- byte[] buffer = EmptyBuffer;
- int position;
-
- public BlockManager () {
- }
-
- public int Position {
- get { return position; }
- }
-
- void EnsureCapacity (int capacity) {
- if (buffer.Length >= capacity)
- return;
-
- capacity += PreferredLength;
- capacity = (capacity / PreferredLength) * PreferredLength;
- byte[] temp = new byte[capacity];
- Array.Copy(buffer, 0, temp, 0, buffer.Length);
- buffer = temp;
- }
-
- public void Write (byte [] buffer, int offset, int count) {
- if (count == 0)
- return;
-
- EnsureCapacity (position + count);
- Array.Copy(buffer, offset, this.buffer, position, count);
- position += count;
- }
-
- public void Send (HttpWorkerRequest wr, int start, int end) {
- int length = end - start;
- if (length <= 0)
- return;
-
- if (length > buffer.Length - start)
- length = buffer.Length - start;
-
- if (start > 0) {
- byte[] temp = new byte[length];
- Array.Copy(buffer, start, temp, 0, length);
- buffer = temp;
- }
- wr.SendResponseFromMemory(buffer, length);
- }
-
- public void Send (Stream stream, int start, int end) {
- int length = end - start;
- if (length <= 0)
- return;
-
- if (length > buffer.Length - start)
- length = buffer.Length - start;
-
- stream.Write(buffer, start, length);
- }
-
- public void Dispose () {
- buffer = null;
- }
- }
-
-#else // TARGET_JVM
unsafe sealed class BlockManager {
const int PreferredLength = 128 * 1024;
byte *data;
}
}
-#endif
abstract class Bucket {
public Bucket Next;
public abstract int Length { get; }
}
-#if !TARGET_JVM
unsafe
-#endif
class ByteBucket : Bucket {
int start;
int length;
}
}
-#if TARGET_JVM
- void UnsafeWrite (HttpWorkerRequest wr, byte [] buffer, int offset, int count)
- {
- if (count <= 0)
- return;
-
- byte[] copy = new byte[count];
- Array.Copy(buffer, offset, copy, 0, count);
- wr.SendResponseFromMemory (copy, count);
- }
-#else
unsafe void UnsafeWrite (HttpWorkerRequest wr, byte [] buffer, int offset, int count)
{
fixed (byte *ptr = buffer) {
wr.SendResponseFromMemory ((IntPtr) (ptr + offset), count);
}
}
-#endif
void AppendBuffer (byte [] buffer, int offset, int count)
{
if (!(cur_bucket is ByteBucket))
}
#endif
-#if TARGET_JVM
- [MonoNotSupported ("UnloadAppDomain is not supported")]
- public static void UnloadAppDomain ()
- {
- throw new NotImplementedException ("UnloadAppDomain is not supported");
- }
-#else
//
// Called when we are shutting down or we need to reload an application
// that has been modified (touch global.asax)
}
});
}
-#endif
//
// Shuts down the AppDomain
//
// apparently does nothing in MS.NET
}
-#if !TARGET_JVM
public virtual void SendResponseFromMemory (IntPtr data, int length)
{
if (data != IntPtr.Zero) {
SendResponseFromMemory (copy, length);
}
}
-#endif
public virtual void SetEndOfSendNotification (HttpWorkerRequest.EndOfSendNotification callback, object extraData)
{
{
if (buffer == null || index < 0 || count < 0 || (buffer.Length - index) < count)
throw new ArgumentOutOfRangeException ();
-#if TARGET_JVM
- output_stream.Write (buffer, index, count);
-#else
int length = encoding.GetMaxByteCount (count);
byte [] bytebuffer = GetByteBuffer (length);
int realLength = encoding.GetBytes (buffer, index, count, bytebuffer, 0);
output_stream.Write (bytebuffer, 0, realLength);
-#endif
if (response.buffer)
return;
if (index < 0 || count < 0 || ((index + count > s.Length)))
throw new ArgumentOutOfRangeException ();
-#if TARGET_JVM
- output_stream.Write (s, index, count);
-#else
int length = encoding.GetMaxByteCount (count);
byte [] bytebuffer = GetByteBuffer (length);
int realLength = encoding.GetBytes (s, index, count, bytebuffer, 0);
output_stream.Write (bytebuffer, 0, realLength);
-#endif
if (response.buffer)
return;
}
}
-#if TARGET_JVM
- const string SiteMap_provider = "SiteMap_provider";
- const string SiteMap_providers = "SiteMap_providers";
- static SiteMapProvider provider
- {
- get { return (SiteMapProvider) AppDomain.CurrentDomain.GetData (SiteMap_provider); }
- set { AppDomain.CurrentDomain.SetData (SiteMap_provider, value); }
- }
- static SiteMapProviderCollection providers
- {
- get { return (SiteMapProviderCollection) AppDomain.CurrentDomain.GetData (SiteMap_providers); }
- set { AppDomain.CurrentDomain.SetData (SiteMap_providers, value); }
- }
-#else
static SiteMapProvider provider;
static SiteMapProviderCollection providers;
-#endif
static object locker = new object ();
}
}
public class SiteMapNodeCollection : IList, IHierarchicalEnumerable
{
ArrayList list;
-#if TARGET_JVM
- const string _siteMapNodeCollection_EmptyList = "SiteMapNodeCollection.EmptyList";
- internal static SiteMapNodeCollection EmptyList
- {
- get { return (SiteMapNodeCollection) AppDomain.CurrentDomain.GetData (_siteMapNodeCollection_EmptyList); }
- set { AppDomain.CurrentDomain.SetData (_siteMapNodeCollection_EmptyList, value); }
- }
-#else
internal static SiteMapNodeCollection EmptyList;
-#endif
static SiteMapNodeCollection ()
{
if (strHeader != null) {
DateTime dtIfModifiedSince = DateTime.ParseExact (strHeader, "r", null);
DateTime ftime;
-#if TARGET_JVM
- try
- {
- ftime = fi.LastWriteTime.ToUniversalTime ();
- }
- catch (NotSupportedException)
- {
- // The file is in a WAR, it might be modified with last redeploy.
- try {
- ftime = (DateTime) AppDomain.CurrentDomain.GetData (".appStartTime");
- }
- catch {
- ftime = DateTime.MaxValue;
- }
- }
-#else
ftime = fi.LastWriteTime.ToUniversalTime ();
-#endif
if (ftime <= dtIfModifiedSince) {
response.ContentType = MimeTypes.GetMimeType (fileName);
response.StatusCode = 304;
[Test]
[NUnit.Framework.Category ("NunitWeb")]
-#if !TARGET_JVM
[NUnit.Framework.Category ("NotWorking")]
-#endif
public void ReadOnlyPropertyBindTest ()
{
new WebTest ("ReadOnlyPropertyBind.aspx").Run ();
[Test]
[ExpectedException(typeof(SerializationException))]
-#if TARGET_JVM //System.Security.Policy.Evidence not implemented
- [Category ("NotWorking")]
-#endif
public void Constructor_PlainType ()
{
ApplicationHost.CreateApplicationHost (typeof (ApplicationHostTest), "/app", Environment.CurrentDirectory);
}
}
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
public void SetContext ()
{
SetContext (Context);
}
#if NET_2_0
-#if !TARGET_DOTNET && !TARGET_JVM
+#if !TARGET_DOTNET
[Test]
public void ActionStringWithQuery ()
{
[Test]
[Category ("NunitWeb")]
-#if TARGET_JVM
- [Ignore ("TD #7024")]
-#endif
public void ActiveStepIndex () {
new WebTest (PageInvoker.CreateOnLoad (ActiveStepIndex_Load)).Run ();
}
[Test]
[Category ("NunitWeb")]
-#if TARGET_JVM
- [Ignore ("TD #6665")]
-#endif
public void DataBoundControl_DataBindFlow2 () {
new WebTest (PageInvoker.CreateOnLoad (DataBoundControl_DataBindFlow2_Load)).Run ();
}
[Test]
[Category ("NunitWeb")]
-//#if TARGET_JVM //BUG #6518
-// [Category ("NotWorking")]
-//#endif
public void FormView_RenderSimpleTemplate()
{
string renderedPageHtml = new WebTest ("FormViewTest1.aspx").Run ();
[Test]
[Category ("NunitWeb")]
-//#if TARGET_JVM //BUG #6518
-// [Category ("NotWorking")]
-//#endif
public void FormView_RenderFooterAndPager()
{
string renderedPageHtml = new WebTest ("FormViewTest1_2.aspx").Run ();
[Test]
[Category ("NunitWeb")]
-//#if TARGET_JVM //BUG #6518
-// [Category ("NotWorking")]
-//#endif
public void FormView_RenderWithHeader()
{
string renderedPageHtml = new WebTest ("FormViewTest1_4.aspx").Run ();
[Test]
[Category ("NunitWeb")]
-//#if TARGET_JVM //BUG #6518
-// [Category ("NotWorking")]
-//#endif
public void FormView_Render ()
{
string RenderedPageHtml = new WebTest ("FormViewTest1_3.aspx").Run ();
[Test]
[Category("NunitWeb")]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public void SessionParameter_Evaluate()
{
SessionParameterPoker sessionParam = new SessionParameterPoker("employee",TypeCode.String ,"id") ;
+++ /dev/null
-//
-// Tests for System.Web.UI.WebControls.SqlDataSource
-// This test uses Derby, java embedded database.
-//
-// Author:
-// Vladimir Krasnov (vladimirk@mainsoft.com)
-//
-
-//
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0 && TARGET_JVM
-
-using NUnit.Framework;
-using System;
-using System.Configuration;
-using System.Data;
-using System.Data.OleDb;
-using System.Data.Common;
-using System.IO;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-using System.Collections.Specialized;
-
-namespace MonoTests.System.Web.UI.WebControls
-{
- [TestFixture]
- public class SqlDataSourceDerbyTest {
- [TestFixtureSetUp]
- public void setup ()
- {
- if (Directory.Exists (_dataDir))
- Directory.Delete (_dataDir, true);
-
- string initSql = @"CREATE TABLE Table1 (
- UserId int NOT NULL PRIMARY KEY,
- UserName varchar(256) NOT NULL,
- Description varchar(256)
- )";
-
- OleDbConnection connection = new OleDbConnection (_connectionString);
- try {
- connection.Open ();
- DbCommand cmd = connection.CreateCommand ();
- cmd.CommandText = initSql;
- cmd.CommandType = CommandType.Text;
- cmd.ExecuteNonQuery ();
- }
- catch (Exception) {
- }
- finally {
- connection.Close ();
- }
- }
-
- [Test]
- public void SelectTest1 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1";
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
-
- Assert.AreEqual (10, dataView.Count);
- }
-
- [Test]
- public void SelectTest2 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1";
- ds.FilterExpression = "UserId > 5";
-
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
- Assert.AreEqual (4, dataView.Count);
- }
-
- [Test]
- public void SelectTest3 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1";
-
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ("Description"));
- Assert.AreEqual ("Description", dataView.Sort);
- }
-
- [Test]
- public void SelectTest4 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1";
- try {
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments (1, 2));
- }
- catch (NotSupportedException) {
- Assert.AreEqual (true, true);
- }
- }
-
- [Test]
- public void SelectTest5 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1 WHERE UserId = ?";
- ds.SelectParameters.Add (new Parameter ("UserId", TypeCode.Int32, "5"));
-
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
- Assert.AreEqual (1, dataView.Count);
- }
-
- [Test]
- public void UpdateTest1 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1 WHERE UserName = ?";
- ds.SelectParameters.Add (new Parameter ("UserName", TypeCode.String, "superuser"));
-
- ds.UpdateCommand = "UPDATE Table1 SET UserName = ? WHERE UserId = ?";
- ds.UpdateParameters.Add (new Parameter ("UserName", TypeCode.String, "superuser"));
- ds.UpdateParameters.Add (new Parameter ("UserId", TypeCode.Int32, "5"));
-
- int records = ds.Update ();
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
- Assert.AreEqual (1, dataView.Count);
- Assert.AreEqual (1, records);
-
- }
-
- [Test]
- public void UpdateTest2 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1 WHERE UserName = ?";
- ds.SelectParameters.Add (new Parameter ("UserName", TypeCode.String, "SimpleUser"));
-
- ds.UpdateCommand = "UPDATE Table1 SET UserName = ? WHERE UserId = ?";
- ds.UpdateParameters.Add (new Parameter ("UserName", TypeCode.String, "superuser"));
- ds.UpdateParameters.Add (new Parameter ("UserId", TypeCode.Int32, "5"));
- ds.OldValuesParameterFormatString = "original_{0}";
-
- SqlDataSourceView view = (SqlDataSourceView) ((IDataSource) ds).GetView ("");
-
- OrderedDictionary keys = new OrderedDictionary ();
- keys.Add ("UserId", 7);
-
- OrderedDictionary values = new OrderedDictionary ();
- values.Add ("UserName", "SimpleUser");
-
- OrderedDictionary oldvalues = new OrderedDictionary ();
- oldvalues.Add ("UserName", "user7");
-
- int records = view.Update (keys, values, oldvalues);
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
- Assert.AreEqual (1, dataView.Count);
- Assert.AreEqual (1, records);
-
- }
-
- [Test]
- public void InsertTest1 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1 WHERE UserName = ?";
- ds.SelectParameters.Add (new Parameter ("UserName", TypeCode.String, "newuser"));
-
- ds.InsertCommand = "INSERT INTO Table1 (UserId, UserName, Description) VALUES (?, ?, ?)";
- ds.InsertParameters.Add (new Parameter ("UserId", TypeCode.Int32, "15"));
- ds.InsertParameters.Add (new Parameter ("UserName", TypeCode.String, "newuser"));
- ds.InsertParameters.Add (new Parameter ("Description", TypeCode.String, "newuser"));
-
- int records = ds.Insert ();
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
- Assert.AreEqual (1, dataView.Count);
- Assert.AreEqual (1, records);
-
- }
-
- [Test]
- public void InsertTest2 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1 WHERE UserName = ?";
- ds.SelectParameters.Add (new Parameter ("UserName", TypeCode.String, "newuser2"));
-
- ds.InsertCommand = "INSERT INTO Table1 (UserId, UserName, Description) VALUES (?, ?, ?)";
- ds.InsertParameters.Add (new Parameter ("UserId", TypeCode.Int32, "5"));
- ds.InsertParameters.Add (new Parameter ("UserName", TypeCode.String, "newuser"));
- ds.InsertParameters.Add (new Parameter ("Description", TypeCode.String, "newuser"));
-
- SqlDataSourceView view = (SqlDataSourceView) ((IDataSource) ds).GetView ("");
-
- OrderedDictionary values = new OrderedDictionary ();
- values.Add ("UserId", "17");
- values.Add ("UserName", "newuser2");
- values.Add ("Description", "newuser2");
-
- int records = view.Insert (values);
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
- Assert.AreEqual (1, dataView.Count);
- Assert.AreEqual (1, records);
-
- }
-
-
- const string _dataDir = "DataDir";
- const string _connectionString = "JdbcDriverClassName=org.apache.derby.jdbc.EmbeddedDriver;JdbcURL=jdbc:derby:" + _dataDir + ";create=true";
- private SqlDataSource CreateDataSource ()
- {
- SqlDataSource ds = new SqlDataSource ();
- ds.ConnectionString = _connectionString;
- ds.ProviderName = "System.Data.OleDb";
- ds.DataSourceMode = SqlDataSourceMode.DataSet;
- return ds;
- }
-
- [SetUp]
- public void RestoreData ()
- {
- string insertSql = @"INSERT INTO Table1 VALUES ({0}, '{1}', '{2}')";
- string deleteSql = @"DELETE FROM Table1";
-
- OleDbConnection connection = new OleDbConnection (_connectionString);
- connection.Open ();
- try {
- DbCommand dc = connection.CreateCommand ();
- dc.CommandText = deleteSql;
- dc.CommandType = CommandType.Text;
- dc.ExecuteNonQuery ();
-
- for (int i = 0; i < 10; i++) {
- DbCommand ic = connection.CreateCommand ();
- ic.CommandText = string.Format (insertSql, i.ToString (), "user" + i.ToString (), (9 - i).ToString ());
- ic.CommandType = CommandType.Text;
- ic.ExecuteNonQuery ();
- }
- }
- catch (Exception) {
- }
- finally {
- connection.Close ();
- }
- }
- }
-
-}
-
-#endif
namespace MonoTests.System.Web.UI.WebControls {
-#if TARGET_JVM
- [vmw.common.ChangeInterfaceMethodNames]
-#endif
public interface ITableRowTest {
// testing
[Test]
[Category ("NunitWeb")]
-#if TARGET_JVM
- [Category ("NotWorking")] // File watcher is not supported
-#endif
public void Save ()
{
string origin = @"<div>
public static void ResolveUrl_Load (Page p)
{
-#if TARGET_JVM
- string appPath = "/MainsoftWebApp20";
-#else
string appPath = "/NunitWeb";
-#endif
Control ctrl = new Control ();
p.Controls.Add (ctrl);
Assert.AreEqual (appPath + "/MyPage.aspx", ctrl.ResolveUrl ("~/MyPage.aspx"), "ResolveClientUrl Failed");
public static void ResolveUrl2_Load (Page p)
{
-#if TARGET_JVM
- string appPath = "/MainsoftWebApp20";
-#else
string appPath = "/NunitWeb";
-#endif
Control uc = p.FindControl ("WebUserControl1");
Control ctrl = uc.FindControl ("Label");
[Test]
[Category ("NunitWeb")]
-#if !TARGET_JVM
[Category ("NotWorking")] // Mono PageParser does not handle @Page Async=true
-#endif
public void AddOnPreRenderCompleteAsync ()
{
WebTest t = new WebTest ("AsyncPage.aspx");
}
[Test]
-#if !TARGET_JVM
[Category ("NotWorking")] // Mono PageParser does not handle @Page Async=true
-#endif
[Category ("NunitWeb")]
public void ExecuteRegisteredAsyncTasks ()
{
[Test]
[Category ("NunitWeb")]
-#if !TARGET_JVM
[Category ("NotWorking")] // Mono PageParser does not handle @Page Async=true
-#endif
[ExpectedException (typeof (Exception))]
public void AddOnPreRenderCompleteAsyncBeginThrows ()
{
[Test]
[Category ("NunitWeb")]
-#if !TARGET_JVM
[Category ("NotWorking")] // Mono PageParser does not handle @Page Async=true
-#endif
[ExpectedException (typeof (Exception))]
public void AddOnPreRenderCompleteAsyncEndThrows ()
{
Assert.AreEqual (true, t.DoSupportAutoEvents, "SupportAutoEvents");
}
-#if TARGET_JVM
- [Test]
- public void TemplateControl_DefaultPropertyNotWorking ()
- {
- PokerTemplateControl t = new PokerTemplateControl ();
- Assert.AreEqual (null, t.AppRelativeVirtualPath, "AppRelativeVirtualPath");
- }
-#endif
[Test]
[Category ("NunitWeb")]
}
-#if TARGET_JVM
- [Test]
- [ExpectedException(typeof(ArgumentNullException))]
- public void TemplateControl_AppRelativeVirtualPathException1 ()
- {
- PokerTemplateControl t = new PokerTemplateControl ();
- t.AppRelativeVirtualPath = null;
- }
-
- [Test]
- [ExpectedException (typeof (ArgumentException))]
- public void TemplateControl_AppRelativeVirtualPathException2 ()
- {
- PokerTemplateControl t = new PokerTemplateControl ();
- t.AppRelativeVirtualPath = "fake";
- }
-#endif
[TestFixtureTearDown]
public void TearDown ()
{
}
}
}
-#endif
\ No newline at end of file
+#endif
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")] // char output stream in gh make this test fail
-#endif
public void Test_Response ()
{
FakeHttpWorkerRequest2 f;
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")] // char output stream in gh make this test fail
-#endif
public void TestResponse_Chunked ()
{
FakeHttpWorkerRequest2 f;
[Test]
[Category ("NotDotNet")]
-#if TARGET_JVM
- [Ignore ("TD #6954")]
-#endif
public void HtmlEncode_XSS ()
{
string problem = "\xff1cscript\xff1e"; // unicode looks alike <script>
[Test]
[Category ("NotDotNet")]
-#if TARGET_JVM
- [Ignore ("TD #6954")]
-#endif
public void HtmlEncode_XSS ()
{
string problem = "\xff1cscript\xff1e"; // unicode looks alike <script>
}
#endif
[Test]
-#if !TARGET_JVM
[Category ("NotWorking")]
-#endif
public void HtmlEncode ()
{
for (char c = char.MinValue; c < char.MaxValue; c++) {
}
[Test]
-#if TARGET_JVM
- [Ignore ("TD #6956")]
-#endif
public void UrlEncodeUnicodeTest ()
{
string str = "sch" + (char) 0xf6 + "n";
[Test]
-#if TARGET_JVM
- [Ignore ("TD #6956")]
-#endif
public void ParseQueryString ()
{
ParseQueryString_Helper (HttpUtility.ParseQueryString ("name=value"), "#1",
}
-#if TARGET_JVM //BUG #6499
- [Category ("NotWorking")]
-#endif
[Test] public void TestDefaults ()
{
FakeHttpWorkerRequest f = new FakeHttpWorkerRequest ();
[TestFixture]
public class VirtualPathUtilityTest {
-#if TARGET_JVM
- const string NunitWebAppName = "MainsoftWebApp20";
-#else
const string NunitWebAppName = "NunitWeb";
-#endif
[Test]
public void AppendTrailingSlash ()
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
-#if !(TARGET_JVM || TARGET_DOTNET)
+#if !(TARGET_DOTNET)
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../winfx.pub")]
#endif
using System.Xml.Xsl;
using Microsoft.Win32;
-#if !TARGET_JVM
namespace HtmlAgilityPack
{
/// <summary>
}
}
}
-#endif
\ No newline at end of file
File.Copy(source, target, true);
}
}
-#if TARGET_JVM1
- internal struct HtmlLibrary
- {
- [Conditional("DEBUG")]
- internal static void GetVersion(out string version)
- {
- System.Diagnostics.StackFrame sf = new System.Diagnostics.StackFrame(1, true);
- version = sf.GetMethod().DeclaringType.Assembly.GetName().Version.ToString();
- }
-
- [Conditional("DEBUG")]
- [Conditional("TRACE")]
- internal static void Trace(object Value)
- {
- // category is the method
- string name = null;
- GetCurrentMethodName(2, out name);
- System.Diagnostics.Trace.WriteLine(Value, name);
- }
-
- [Conditional("DEBUG")]
- [Conditional("TRACE")]
- internal static void TraceStackFrame(int steps)
- {
- string name = null;
- GetCurrentMethodName(2, out name);
- string trace = "";
- for(int i=1;i<steps;i++)
- {
- System.Diagnostics.StackFrame sf = new System.Diagnostics.StackFrame(i, true);
- trace += sf.ToString();
- }
- System.Diagnostics.Trace.WriteLine(trace, name);
- System.Diagnostics.Trace.WriteLine("");
- }
-
- [Conditional("DEBUG")]
- internal static void GetCurrentMethodName(out string name)
- {
- name = null;
- GetCurrentMethodName(2, out name);
- }
-
- [Conditional("DEBUG")]
- internal static void GetCurrentMethodName(int skipframe, out string name)
- {
- StackFrame sf = new StackFrame(skipframe, true);
- name = sf.GetMethod().DeclaringType.Name + "." + sf.GetMethod().Name;
- }
-
- }
-#endif
internal class HtmlCmdLine
{
headers.Add (INVOKER_HEADER, Serialize (t.Invoker));
headers.Add (USER_HEADER, Serialize (t.UserData));
WebRequest wr = t.Request.CreateWebRequest (
-#if TARGET_JVM
- new Uri ("http://localhost:8080/MainsoftWebApp20/"),
-#else
new Uri ("http://localhost:59598/NunitWebTest/"),
-#endif
headers);
-#if TARGET_JVM
-#define BUG_78521_FIXED
-#endif
-
using System;
using System.Web.UI;
_page = (Page) parameters[0];
#if NET_2_0
-#if BUG_78521_FIXED
- _page.PreInit += OnPreInit;
-#else
OnPreInit (null, null);
-#endif
+
_page.LoadComplete += OnLoadComplete;
_page.PreLoad += OnPreLoad;
_page.PreRenderComplete += OnPreRenderComplete;
-#if TARGET_JVM
-#define BUG_78521_FIXED
-#endif
-
using System;
using System.Web.UI;
using MonoTests.SystemWeb.Framework;
public partial class MyPage : System.Web.UI.Page
{
//FIXME: mono defines its own constructor here
-#if BUG_78521_FIXED
- public MyPage ()
-#else
protected override void OnPreInit (EventArgs e)
-#endif
{
WebTest t = WebTest.CurrentTest;
if (t != null)
-#if TARGET_JVM_FOR_WEBTEST
-#define TARGET_JVM
-#endif
-
using System;
using System.Reflection;
using System.IO;
/// </summary>
public static void CleanApp ()
{
-#if !TARGET_JVM
if (host != null) {
lock (_appUnloadedSync) {
EventHandler handler = new EventHandler(PulseAppUnloadedSync);
baseDir = null;
binDir = null;
}
-#endif
}
private static object _appUnloadedSync = new object();
{
if (type == null)
throw new ArgumentNullException ("type");
-#if !TARGET_JVM
using (Stream source = type.Assembly.GetManifestResourceStream (resourceName)) {
if (source == null)
throw new ArgumentException ("resource not found: " + resourceName, "resourceName");
source.Read (array, 0, array.Length);
CopyBinary (array, targetUrl);
}
-#endif
}
public static void CopyPrefixedResources (Type type, string namePrefix, string targetDir)
/// <example><code>CopyBinary (System.Text.Encoding.UTF8.GetBytes ("Hello"), "App_Data/Greeting.txt");</code></example>
public static string CopyBinary (byte[] sourceArray, string targetUrl)
{
-#if TARGET_JVM
- return null;
-#else
EnsureWorkingDirectories ();
EnsureDirectoryExists (Path.Combine (baseDir, Path.GetDirectoryName (targetUrl)));
string targetFile = Path.Combine (baseDir, targetUrl);
}
return targetFile;
-#endif
}
static WebTestResourcesSetupAttribute.SetupHandler CheckResourcesSetupHandler ()
{
if (host != null)
return;
-#if TARGET_JVM
- host = new MyHost ();
- return;
-#else
host = AppDomain.CurrentDomain.GetData (HOST_INSTANCE_NAME) as MyHost;
if (host == null)
SetupHosting ();
-#endif
}
public static void SetupHosting ()
public static void SetupHosting (WebTestResourcesSetupAttribute.SetupHandler resHandler)
{
-#if !TARGET_JVM
if (host == null)
host = AppDomain.CurrentDomain.GetData (HOST_INSTANCE_NAME) as MyHost;
-#endif
if (host != null)
CleanApp ();
-#if TARGET_JVM
- host = new MyHost ();
- return;
-#else
if (resHandler == null)
resHandler = CheckResourcesSetupHandler ();
if (resHandler == null)
AppDomain.CurrentDomain.SetData (HOST_INSTANCE_NAME, host);
host.AppDomain.SetData (HOST_INSTANCE_NAME, host);
host.AppDomain.DomainUnload += new EventHandler (_unloadHandler.OnUnload);
-#endif
}
private static UnloadHandler _unloadHandler = new UnloadHandler();
public void OnUnload (object o, EventArgs args)
{
-#if !TARGET_JVM
// Block new requests from starting
lock (_syncUnloading) {
// Wait for pending requests to finish
if (handler != null)
handler(this, null);
}
-#endif
}
}
public static string TestBaseDir {
get {
-#if !TARGET_JVM
return baseDir;
-#else
- return String.Empty;
-#endif
}
}
-#if !TARGET_JVM
const string VIRTUAL_BASE_DIR = "/NunitWeb";
private static string baseDir;
private static string binDir;
}
static partial void CopyResourcesLocal ();
-#endif
}
}
[assembly: ComVisible (false)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
#if NET_2_1
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
#endif
-#endif
#if NET_2_1
[assembly: InternalsVisibleTo ("System.Runtime.Serialization, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
public object Compile (XPathNavigator node)
{
-#if TARGET_JVM || MOBILE
+#if MOBILE
throw new NotImplementedException ();
#else
string suffix = "";
#if NET_2_0
using System;
-#if !TARGET_JVM
using System.Xml.Serialization.Advanced;
-#endif
namespace System.Xml.Serialization
{
static Hashtable primitiveArrayTypes;
static Hashtable nullableTypes;
-#if TARGET_JVM
- static readonly object AppDomain_TypeTranslatorCacheLock = new object ();
- const string AppDomain_nameCacheName = "System.Xml.Serialization.TypeTranslator.nameCache";
- const string AppDomain_nullableTypesName = "System.Xml.Serialization.TypeTranslator.nullableTypes";
-
- static Hashtable AppDomain_nameCache {
- get { return GetAppDomainCache (AppDomain_nameCacheName); }
- }
-
- static Hashtable AppDomain_nullableTypes {
- get { return GetAppDomainCache (AppDomain_nullableTypesName); }
- }
-
- static Hashtable GetAppDomainCache(string name) {
- Hashtable res = (Hashtable) AppDomain.CurrentDomain.GetData (name);
-
- if (res == null) {
- lock (AppDomain_TypeTranslatorCacheLock) {
- res = (Hashtable) AppDomain.CurrentDomain.GetData (name);
- if (res == null) {
- res = Hashtable.Synchronized (new Hashtable ());
- AppDomain.CurrentDomain.SetData (name, res);
- }
- }
- }
-
- return res;
- }
-#endif
static TypeTranslator ()
{
nameCache = new Hashtable ();
primitiveArrayTypes = Hashtable.Synchronized (new Hashtable ());
-#if !TARGET_JVM
nameCache = Hashtable.Synchronized (nameCache);
-#endif
// XSD Types with direct map to CLR types
nameCache.Add (typeof (bool), new TypeData (typeof (bool), "boolean", true));
TypeData pt = GetTypeData (type); // beware this recursive call btw ...
if (pt != null) {
TypeData tt = (TypeData) nullableTypes [pt.XmlType];
-#if TARGET_JVM
- if (tt == null)
- tt = (TypeData) AppDomain_nullableTypes [pt.XmlType];
-#endif
if (tt == null) {
tt = new TypeData (type, pt.XmlType, false);
tt.IsNullable = true;
-#if TARGET_JVM
- AppDomain_nullableTypes [pt.XmlType] = tt;
-#else
nullableTypes [pt.XmlType] = tt;
-#endif
}
return tt;
}
TypeData typeData = nameCache[runtimeType] as TypeData;
if (typeData != null) return typeData;
-#if TARGET_JVM
- Hashtable dynamicCache = AppDomain_nameCache;
- typeData = dynamicCache[runtimeType] as TypeData;
- if (typeData != null) return typeData;
-#endif
string name;
if (type.IsArray) {
typeData = new TypeData (type, name, false);
if (nullableOverride)
typeData.IsNullable = true;
-#if TARGET_JVM
- dynamicCache[runtimeType] = typeData;
-#else
nameCache[runtimeType] = typeData;
-#endif
return typeData;
}
{
get { return _mapMember.Name; }
}
-#if !TARGET_JVM && !NET_2_1
+#if !NET_2_1
public string GenerateTypeName (System.CodeDom.Compiler.CodeDomProvider codeProvider)
{
string ret = codeProvider.CreateValidIdentifier (_mapMember.TypeData.FullTypeName);
// Read all Fields via reflection.
ArrayList fieldList = new ArrayList();
FieldInfo[] tfields = type.GetFields (BindingFlags.Instance | BindingFlags.Public);
-#if TARGET_JVM
- // This statement ensures fields are ordered starting from the base type.
- for (int ti=0; ti<typeList.Count; ti++) {
- for (int i=0; i<tfields.Length; i++) {
- FieldInfo field = tfields[i];
- if (field.DeclaringType == typeList[ti])
- fieldList.Add (field);
- }
- }
-#else
currentType = null;
int currentIndex = 0;
foreach (FieldInfo field in tfields)
}
fieldList.Insert(currentIndex++, field);
}
-#endif
// Read all Properties via reflection.
ArrayList propList = new ArrayList();
PropertyInfo[] tprops = type.GetProperties (BindingFlags.Instance | BindingFlags.Public);
-#if TARGET_JVM
- // This statement ensures properties are ordered starting from the base type.
- for (int ti=0; ti<typeList.Count; ti++) {
- for (int i=0; i<tprops.Length; i++) {
- PropertyInfo prop = tprops[i];
- if (!prop.CanRead) continue;
- if (prop.GetIndexParameters().Length > 0) continue;
- if (prop.DeclaringType == typeList[ti])
- propList.Add (prop);
- }
- }
-#else
currentType = null;
currentIndex = 0;
foreach (PropertyInfo prop in tprops)
if (prop.GetIndexParameters().Length > 0) continue;
propList.Insert(currentIndex++, prop);
}
-#endif
var members = new List<XmlReflectionMember>();
int fieldIndex=0;
int propIndex=0;
//
using System.Xml;
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
using System.CodeDom.Compiler;
#endif
using System.Xml.Schema;
this.typeIdentifiers = typeIdentifiers;
}
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
[MonoTODO]
public XmlSchemaImporter (XmlSchemas schemas, CodeGenerationOptions options, CodeDomProvider codeProvider, ImportContext context)
{
using System.Xml;
using System.Xml.Schema;
using System.Text;
-#if !TARGET_JVM && !NET_2_1
+#if !NET_2_1
using System.CodeDom;
using System.CodeDom.Compiler;
using Microsoft.CSharp;
// debugging pourposes by adding the "nofallback" option.
// For example: MONO_XMLSERIALIZER_THS=0,nofallback
-#if TARGET_JVM || NET_2_1
+#if NET_2_1
string db = null;
string th = null;
generationThreshold = -1;
throw new NotImplementedException ();
}
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
public static Assembly GenerateSerializer (Type[] types, XmlMapping[] mappings)
{
return GenerateSerializer (types, mappings, null);
return new XmlSerializationReaderInterpreter (typeMapping);
}
-#if TARGET_JVM || NET_2_1
+#if NET_2_1
void CheckGeneratedTypes (XmlMapping typeMapping)
{
throw new NotImplementedException();
bool enable_debug;
object debugger;
CompiledStylesheet s;
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
// TempFileCollection temporary_files;
#endif
XmlWriterSettings output_settings = new XmlWriterSettings ();
get { return output_settings; }
}
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
[MonoTODO]
public TempFileCollection TemporaryFiles {
get { return null; /*temporary_files;*/ }
}
#if NET_2_0 // actually NET_3_5
-#if !TARGET_JVM
public static DateTimeOffset ToDateTimeOffset (string s)
{
{
return value.ToString (format, CultureInfo.InvariantCulture);
}
-#endif
// it is used only from 2.1 System.Xml.Serialization.dll from
// MS Silverlight SDK. We don't use it so far.
}
}
}
-#if TARGET_JVM
- else {
- if (bufLength >= 10 && Encoding.Unicode.GetString (buffer, 2, 8) == "?xml")
- enc = Encoding.Unicode;
- }
-#endif
bufPos = 0;
break;
default:
{
[Test]
[NUnit.Framework.Category("NotDotNet")] // FDBK50639
-#if TARGET_JVM
- [Ignore ("JVM returns fields in different order")]
-#endif
public void WriteLiteral ()
{
Test data = BuildTestObject ();
}
[Test]
-#if TARGET_JVM
- [Ignore ("JVM returns fields in different order")]
-#endif
public void TestSerializeGroup ()
{
Group myGroup = new Group ();
ser.Deserialize (new XmlTextReader (xml, XmlNodeType.Document, null));
}
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
[Test]
public void GenerateSerializerGenerics ()
{
Assert.IsNull (xsltException.SourceUri, "#4");
Assert.IsNull (xsltException.InnerException, "#5");
Assert.IsNull (xsltException.Source, "#6");
-#if !TARGET_JVM
Assert.IsNull (xsltException.StackTrace, "#7");
Assert.IsNull (xsltException.TargetSite, "#8");
-#endif
}
[Test]
Assert.IsNull (xsltException.SourceUri, "#4");
Assert.IsNull (xsltException.InnerException, "#5");
Assert.IsNull (xsltException.Source, "#6");
-#if !TARGET_JVM
Assert.IsNull (xsltException.StackTrace, "#7");
Assert.IsNull (xsltException.TargetSite, "#8");
-#endif
}
#endif
Assert.IsNull (xsltException.SourceUri, "#A4");
Assert.AreSame (cause, xsltException.InnerException, "#A5");
Assert.IsNull (xsltException.Source, "#A6");
-#if !TARGET_JVM
Assert.IsNull (xsltException.StackTrace, "#A7");
Assert.IsNull (xsltException.TargetSite, "#A8");
-#endif
xsltException = new XsltException ((string) null, cause);
Assert.AreEqual (0, xsltException.LineNumber, "#B1");
Assert.AreEqual (0, xsltException.LinePosition, "#B2");
Assert.IsNull (xsltException.SourceUri, "#B5");
Assert.AreSame (cause, xsltException.InnerException, "#B6");
Assert.IsNull (xsltException.Source, "#B7");
-#if !TARGET_JVM
Assert.IsNull (xsltException.StackTrace, "#B8");
Assert.IsNull (xsltException.TargetSite, "#B9");
-#endif
xsltException = new XsltException (msg, (Exception) null);
Assert.AreEqual (0, xsltException.LineNumber, "#C1");
Assert.AreEqual (0, xsltException.LinePosition, "#C2");
Assert.IsNull (xsltException.SourceUri, "#C4");
Assert.IsNull (xsltException.InnerException, "#C5");
Assert.IsNull (xsltException.Source, "#C6");
-#if !TARGET_JVM
Assert.IsNull (xsltException.StackTrace, "#C7");
Assert.IsNull (xsltException.TargetSite, "#C8");
-#endif
xsltException = new XsltException ((string) null, (Exception) null);
Assert.AreEqual (0, xsltException.LineNumber, "#D1");
Assert.AreEqual (0, xsltException.LinePosition, "#D2");
Assert.IsNull (xsltException.SourceUri, "#D4");
Assert.IsNull (xsltException.InnerException, "#D5");
Assert.IsNull (xsltException.Source, "#D6");
-#if !TARGET_JVM
Assert.IsNull (xsltException.StackTrace, "#D7");
Assert.IsNull (xsltException.TargetSite, "#D8");
-#endif
}
}
}
string exceptionsFilename = Path.Combine (EnvOptions.OutputDir, "res-exceptions.lst");
Helpers.ReadStrings (skipTargets, "ignore.lst");
-#if TARGET_JVM
- Helpers.ReadStrings (knownFailures, "knownFailures.jvm.lst");
-#else
Helpers.ReadStrings (knownFailures, "knownFailures.lst");
-#endif
Helpers.ReadStrings (fixmeList, "fixme.lst");
ArrayList exceptionsArray = new ArrayList();
Helpers.ReadStrings (exceptionsArray, exceptionsFilename);
return attribute.value == null ? (DateTime?) null : XUtil.ToDateTime (attribute.value);
}
-#if !TARGET_JVM // Same as for System.Xml.XmlConvert.ToDateTimeOffset
[CLSCompliant (false)]
public static explicit operator DateTimeOffset (XAttribute attribute)
return attribute.value == null ? (DateTimeOffset?) null : XmlConvert.ToDateTimeOffset (attribute.value);
}
-#endif
[CLSCompliant (false)]
public static explicit operator decimal (XAttribute attribute)
return element.Value == null ? (DateTime?) null : XUtil.ToDateTime (element.Value);
}
-#if !TARGET_JVM // Same as for System.Xml.XmlConvert.ToDateTimeOffset
[CLSCompliant (false)]
public static explicit operator DateTimeOffset (XElement element)
return element.Value == null ? (DateTimeOffset?) null : XmlConvert.ToDateTimeOffset (element.Value);
}
-#endif
[CLSCompliant (false)]
public static explicit operator decimal (XElement element)
uint version;
#if ONE_MEMBER_CACHE
-#if TARGET_JVM
- static readonly LocalDataStoreSlot _cachedPathStore = System.Threading.Thread.AllocateDataSlot ();
-
- static List<Node> cached_path {
- get { return (List<Node>) System.Threading.Thread.GetData (_cachedPathStore); }
- set { System.Threading.Thread.SetData (_cachedPathStore, value); }
- }
-#else
[ThreadStatic]
static List<Node> cached_path;
-#endif
static List<Node> alloc_path ()
{
Dispose (false);
}
-#if TARGET_JVM
- public virtual void Dispose ()
- {
- Dispose (true);
- }
-#else
public void Dispose ()
{
Dispose (true);
GC.SuppressFinalize (this);
}
-#endif
// <summary>
// Controls disposal of resources used by this.
// Set fields to null
}
-#if !TARGET_JVM
~MarshalByValueComponent ()
{
Dispose (false);
}
-#endif
public virtual object GetService (Type service)
{
properties.Clear ();
}
-#if !TARGET_JVM // DUAL_IFACE_CONFLICT
void IList.Clear ()
{
Clear ();
{
Clear ();
}
-#endif
public bool Contains (PropertyDescriptor value)
{
return properties.Contains (value);
}
-#if TARGET_JVM // DUAL_IFACE_CONFLICT
- public bool Contains (object value)
- {
- return Contains ((PropertyDescriptor) value);
- }
-#else
bool IList.Contains (object value)
{
{
return Contains ((PropertyDescriptor) value);
}
-#endif
public void CopyTo (Array array, int index)
{
properties.Remove (value);
}
-#if TARGET_JVM// DUAL_IFACE_CONFLICT
- public void Remove (object value)
- {
- Remove ((PropertyDescriptor) value);
- }
-#else
void IDictionary.Remove (object value)
{
Remove ((PropertyDescriptor) value);
{
Remove ((PropertyDescriptor) value);
}
-#endif
public void RemoveAt (int index)
{
if (readOnly) {
return new PropertyDescriptorCollection (descriptors, true);
}
-#if TARGET_JVM //DUAL_IFACE_CONFLICT
- public bool IsFixedSize
-#else
bool IDictionary.IsFixedSize
{
get {return ((IList)this).IsFixedSize;}
}
bool IList.IsFixedSize
-#endif
{
get
{
return readOnly;
}
}
-#if TARGET_JVM //DUAL_IFACE_CONFLICT
- public bool IsReadOnly
-#else
bool IDictionary.IsReadOnly
{
get {return ((IList)this).IsReadOnly;}
}
bool IList.IsReadOnly
-#endif
{
get
{
editor = CreateEditor (editorType, componentType);
if (editorType == null || editor == null) {
-#if !TARGET_JVM
// Make sure the editorBaseType's static constructor has been called,
// since that's where we're putting the initialization of its editor table.
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (editorBaseType.TypeHandle);
-#endif
if (editors != null)
editor = FindEditorInTable (componentType, editorBaseType, editors [editorBaseType] as Hashtable);
}
private int native_error_code;
// [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
-#if TARGET_JVM
- [MonoNotSupported("")]
-#endif
public Win32Exception ()
: base (W32ErrorMessage (Marshal.GetLastWin32Error ()))
{
native_error_code = error;
}
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
-#if TARGET_JVM
- [MonoNotSupported ("")]
-#endif
public Win32Exception (string message)
: base (message)
{
native_error_code = Marshal.GetLastWin32Error ();
}
-#if TARGET_JVM
- [MonoNotSupported ("")]
-#endif
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public Win32Exception (string message, Exception innerException)
: base (message, innerException)
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if CONFIGURATION_DEP && !TARGET_JVM
+#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif
// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
//
-#if CONFIGURATION_DEP && !TARGET_JVM
+#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if CONFIGURATION_DEP && !TARGET_JVM
+#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif
using System.Xml;
using System.Xml.XPath;
#endif
-#if TARGET_JVM
-using vmw.common;
-using vmw.@internal.io;
-#endif
namespace System.Configuration
{
public sealed class ConfigurationSettings
{
-#if !TARGET_JVM
static IConfigurationSystem config = DefaultConfig.GetInstance ();
-#else
- static IConfigurationSystem config {
- get {
- IConfigurationSystem conf = (IConfigurationSystem) AppDomain.CurrentDomain.GetData ("ConfigurationSettings.Config");
- if (conf == null) {
- conf = DefaultConfig.GetInstance ();
- AppDomain.CurrentDomain.SetData ("ConfigurationSettings.Config", conf);
- }
- return conf;
- }
- set {
- AppDomain.CurrentDomain.SetData ("ConfigurationSettings.Config", value);
- }
- }
-#endif
static object lockobj = new object ();
private ConfigurationSettings ()
{
//
class DefaultConfig : IConfigurationSystem
{
-#if !TARGET_JVM
static readonly DefaultConfig instance = new DefaultConfig ();
-#else
- static DefaultConfig instance {
- get {
- DefaultConfig conf = (DefaultConfig) AppDomain.CurrentDomain.GetData ("DefaultConfig.instance");
- if (conf == null) {
- conf = new DefaultConfig ();
- AppDomain.CurrentDomain.SetData ("DefaultConfig.instance", conf);
- }
- return conf;
- }
- set {
- AppDomain.CurrentDomain.SetData ("DefaultConfig.instance", value);
- }
- }
-#endif
ConfigurationData config;
private DefaultConfig ()
config = data;
}
}
-#if TARGET_JVM
- internal static string GetBundledMachineConfig ()
- {
- return null;
- }
- internal static string GetMachineConfigPath ()
- {
- return System.Runtime.InteropServices.RuntimeEnvironment.SystemConfigurationFile;
- }
-#else
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern private static string get_bundled_machine_config ();
internal static string GetBundledMachineConfig ()
{
return get_machine_config_path ();
}
-#endif
private static string GetAppConfigPath ()
{
AppDomainSetup currentInfo = AppDomain.CurrentDomain.SetupInformation;
#if (XML_DEP)
this.fileName = fileName;
if (fileName == null
-#if !TARGET_JVM
|| !File.Exists (fileName)
-#endif
)
return false;
XmlTextReader reader = null;
try {
-#if !TARGET_JVM
FileStream fs = new FileStream (fileName, FileMode.Open, FileAccess.Read);
-#else
- Stream fs = (Stream) vmw.common.IOUtils.getStream (fileName);
-
- //patch for machine.config
- if (fs == null && fileName.EndsWith ("machine.config")) {
- fs = (Stream) IOUtils.getStreamForGHConfigs (fileName);
- }
-
- if (fs == null) {
- return false;
- }
-#endif
reader = new XmlTextReader (fs);
if (InitRead (reader))
ReadConfigFile (reader);
#if CONFIGURATION_DEP
-#if !TARGET_JVM
extern alias PrebuiltSystem;
-#endif
using System;
using System.Collections;
using System.Text;
using System.Xml;
-#if TARGET_JVM
-using NameValueCollection = System.Collections.Specialized.NameValueCollection;
-#else
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
-#endif
namespace System.Configuration
{
return attrs [0].Company;
}
-#if !TARGET_JVM
MethodInfo entryPoint = assembly.EntryPoint;
Type entryType = entryPoint != null ? entryPoint.DeclaringType : null;
if (entryType != null && !String.IsNullOrEmpty (entryType.Namespace)) {
return end < 0 ? entryType.Namespace : entryType.Namespace.Substring (0, end);
}
return "Program";
-#else
- return assembly.GetName ().Name;
-#endif
}
private static string GetProductName ()
if (assembly == null)
assembly = Assembly.GetCallingAssembly ();
-#if !TARGET_JVM
byte [] pkt = assembly.GetName ().GetPublicKeyToken ();
return String.Format ("{0}_{1}_{2}",
AppDomain.CurrentDomain.FriendlyName,
pkt != null && pkt.Length > 0 ? "StrongName" : "Url",
GetEvidenceHash());
-#else // AssemblyProductAttribute-based code
- AssemblyProductAttribute [] attrs = (AssemblyProductAttribute[]) assembly.GetCustomAttributes (typeof (AssemblyProductAttribute), true);
-
- if ((attrs != null) && attrs.Length > 0) {
- return attrs [0].Product;
- }
- return assembly.GetName ().Name;
-#endif
}
// Note: Changed from base64() to hex output to avoid unexpected chars like '\' or '/' with filesystem meaning.
ProductVersion = GetProductVersion ().Split('.');
// C:\Documents and Settings\(user)\Application Data
-#if !TARGET_JVM
if (userRoamingBasePath == "")
userRoamingPath = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);
else
-#endif
userRoamingPath = userRoamingBasePath;
// C:\Documents and Settings\(user)\Local Settings\Application Data (on Windows)
-#if !TARGET_JVM
if (userLocalBasePath == "")
userLocalPath = Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData);
else
-#endif
userLocalPath = userLocalBasePath;
if (isCompany) {
Assembly assembly = Assembly.GetEntryAssembly ();
if (assembly == null)
assembly = Assembly.GetCallingAssembly ();
-#if !TARGET_JVM
byte [] pkt = assembly.GetName ().GetPublicKeyToken ();
ProductName = String.Format ("{0}_{1}_{2}",
ProductName,
pkt != null ? "StrongName" : "Url",
GetEvidenceHash());
-#endif
}
userRoamingPath = Path.Combine (userRoamingPath, ProductName);
userLocalPath = Path.Combine (userLocalPath, ProductName);
//
#if CONFIGURATION_DEP
-#if CONFIGURATION_DEP && !TARGET_JVM
+#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif
public override SettingsPropertyValueCollection GetPropertyValues (SettingsContext context,
SettingsPropertyCollection properties)
{
-#if TARGET_JVM
- SettingsPropertyValueCollection pv = new SettingsPropertyValueCollection ();
- foreach (SettingsProperty prop in properties)
- pv.Add (new SettingsPropertyValue (prop));
- return pv;
-#else
return impl.GetPropertyValues (context, properties);
-#endif
}
#if CONFIGURATION_DEP
OnWin32 = (Path.DirectorySeparatorChar == '\\');
if (!OnWin32) {
-#if TARGET_JVM
- string trace = java.lang.System.getProperty("MONO_TRACE");
-#else
// If we're running on Unix, we don't have OutputDebugString.
// Instead, send output to...wherever the MONO_TRACE_LISTENER environment
// variables says to.
String trace = Environment.GetEnvironmentVariable("MONO_TRACE_LISTENER");
-#endif
#if MOBILE
if (trace == null)
Abort
}
-#if TARGET_JVM
- private void WriteDebugString (string message)
- {
-#else
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static void WriteWindowsDebugString (string message);
if (OnWin32)
WriteWindowsDebugString (message);
else
-#endif
WriteMonoTrace (message);
}
// them
private void AddSwitchesNode (IDictionary d, XmlNode node)
{
-#if !TARGET_JVM
// There are no attributes on <switch/>
ValidateInvalidAttributes (node.Attributes, node);
}
d [node.Name] = newNodes;
-#endif
}
private static object GetSwitchValue (string name, string value)
// for add, "name" is required; initializeData is optional; "type" is required in 1.x, optional in 2.0.
private void AddTraceListeners (IDictionary d, XmlNode listenersNode, TraceListenerCollection listeners)
{
-#if !TARGET_JVM
// There are no attributes on <listeners/>
ValidateInvalidAttributes (listenersNode.Attributes, listenersNode);
else
ThrowUnrecognizedNode (child);
}
-#endif
}
private void AddTraceListener (IDictionary d, XmlNode child, XmlAttributeCollection attributes, TraceListenerCollection listeners)
public abstract class TraceListener : MarshalByRefObject, IDisposable {
-#if TARGET_JVM
- readonly LocalDataStoreSlot _indentLevelStore = System.Threading.Thread.AllocateDataSlot ();
- readonly LocalDataStoreSlot _indentSizeStore = System.Threading.Thread.AllocateDataSlot ();
- readonly LocalDataStoreSlot _attributesStore = System.Threading.Thread.AllocateDataSlot ();
- readonly LocalDataStoreSlot _filterStore = System.Threading.Thread.AllocateDataSlot ();
- readonly LocalDataStoreSlot _optionsStore = System.Threading.Thread.AllocateDataSlot ();
-
- private int indentLevel {
- get {
- object o = System.Threading.Thread.GetData (_indentLevelStore);
- if (o == null)
- return 0;
- return (int) o;
- }
- set { System.Threading.Thread.SetData (_indentLevelStore, value); }
- }
-
- private int indentSize {
- get {
- object o = System.Threading.Thread.GetData (_indentSizeStore);
- if (o == null)
- return 4;
- return (int) o;
- }
- set { System.Threading.Thread.SetData (_indentSizeStore, value); }
- }
-
- private StringDictionary attributes {
- get { return (StringDictionary) System.Threading.Thread.GetData (_attributesStore); }
- set { System.Threading.Thread.SetData (_attributesStore, value); }
- }
-
-#if !MOBILE
- private TraceFilter filter {
- get { return (TraceFilter) System.Threading.Thread.GetData (_filterStore); }
- set { System.Threading.Thread.SetData (_filterStore, value); }
- }
-#endif
-
- private TraceOptions options {
- get {
- object o = System.Threading.Thread.GetData (_optionsStore);
- if (o == null)
- return TraceOptions.None;
- return (TraceOptions) o;
- }
- set { System.Threading.Thread.SetData (_optionsStore, value); }
- }
-#else
[ThreadStatic]
private int indentLevel = 0;
#endif
[ThreadStatic]
private TraceOptions options;
-#endif
private string name;
private bool needIndent = true;
if (is_open)
throw new InvalidOperationException ("Port is already open");
-#if !TARGET_JVM
if (IsWindows) // Use windows kernel32 backend
stream = new WinSerialStream (port_name, baud_rate, data_bits, parity, stop_bits, dtr_enable,
rts_enable, handshake, read_timeout, write_timeout, readBufferSize, writeBufferSize);
else // Use standard unix backend
-#endif
stream = new SerialPortStream (port_name, baud_rate, data_bits, parity, stop_bits, dtr_enable,
rts_enable, handshake, read_timeout, write_timeout, readBufferSize, writeBufferSize);
throw new NotSupportedException();
}
-#if !TARGET_JVM
[DllImport("kernel32", SetLastError = true)]
static extern unsafe bool ReadFile (int handle, byte* buffer, int bytes_to_read,
out int bytes_read, IntPtr overlapped);
[DllImport("kernel32", SetLastError = true)]
static extern unsafe bool GetOverlappedResult (int handle, IntPtr overlapped,
ref int bytes_transfered, bool wait);
-#endif
public override int Read ([In, Out] byte [] buffer, int offset, int count)
{
return bytes_read;
}
-#if !TARGET_JVM
[DllImport("kernel32", SetLastError = true)]
static extern unsafe bool WriteFile (int handle, byte* buffer, int bytes_to_write,
out int bytes_written, IntPtr overlapped);
-#endif
public override void Write (byte [] buffer, int offset, int count)
{
sfre.Add (new SmtpFailedRecipientException (status.StatusCode, message.Bcc [i].Address));
}
-#if TARGET_JVM // List<T>.ToArray () is not supported
- if (sfre.Count > 0) {
- SmtpFailedRecipientException[] xs = new SmtpFailedRecipientException[sfre.Count];
- sfre.CopyTo (xs);
- throw new SmtpFailedRecipientsException ("failed recipients", xs);
- }
-#else
if (sfre.Count >0)
throw new SmtpFailedRecipientsException ("failed recipients", sfre.ToArray ());
-#endif
// DATA
status = SendCommand ("DATA");
case TransferEncoding.Base64:
byte [] content = new byte [av.ContentStream.Length];
av.ContentStream.Read (content, 0, content.Length);
-#if TARGET_JVM
- SendData (Convert.ToBase64String (content));
-#else
SendData (Convert.ToBase64String (content, Base64FormattingOptions.InsertLineBreaks));
-#endif
break;
case TransferEncoding.QuotedPrintable:
byte [] bytes = new byte [av.ContentStream.Length];
case TransferEncoding.Base64:
byte [] content = new byte [lr.ContentStream.Length];
lr.ContentStream.Read (content, 0, content.Length);
-#if TARGET_JVM
- SendData (Convert.ToBase64String (content));
-#else
SendData (Convert.ToBase64String (content, Base64FormattingOptions.InsertLineBreaks));
-#endif
break;
case TransferEncoding.QuotedPrintable:
byte [] bytes = new byte [lr.ContentStream.Length];
att.ContentStream.Read (content, 0, content.Length);
switch (att.TransferEncoding) {
case TransferEncoding.Base64:
-#if TARGET_JVM
- SendData (Convert.ToBase64String (content));
-#else
SendData (Convert.ToBase64String (content, Base64FormattingOptions.InsertLineBreaks));
-#endif
break;
case TransferEncoding.QuotedPrintable:
SendData (ToQuotedPrintable (content));
throw new SmtpException (SmtpStatusCode.GeneralFailure, "Server does not support secure connections.");
}
-#if TARGET_JVM
- ((NetworkStream) stream).ChangeToSSLSocket ();
-#elif SECURITY_DEP
+#if SECURITY_DEP
SslStream sslStream = new SslStream (stream, false, callback, null);
CheckCancellation ();
sslStream.AuthenticateAsClient (Host, this.ClientCertificates, SslProtocols.Default, false);
base.GetObjectData (info, context);
info.AddValue ("Status", statusCode, typeof (int));
}
-#if !TARGET_JVM //remove private implementation
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
{
GetObjectData (info, context);
}
-#endif
}
}
base.GetObjectData (serializationInfo, streamingContext);
serializationInfo.AddValue ("failedRecipient", failedRecipient);
}
-#if !TARGET_JVM //remove private implementation
void ISerializable.GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
{
GetObjectData (serializationInfo, streamingContext);
}
-#endif
#endregion // Methods
}
info.AddValue ("innerExceptions", innerExceptions);
}
-#if !TARGET_JVM //remove private implementation
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
{
GetObjectData (info, context);
}
-#endif
#endregion // Methods
}
}
#if !NET_2_1 || MOBILE
-#if TARGET_JVM
- [MonoNotSupported ("Not supported since Socket.ReceiveTimeout is not supported")]
-#endif
public override int ReadTimeout
{
get {
}
#if !NET_2_1 || MOBILE
-#if TARGET_JVM
- [MonoNotSupported ("Not supported since Socket.SendTimeout is not supported")]
-#endif
public override int WriteTimeout
{
get {
throw new ObjectDisposedException (GetType().FullName);
}
-#if TARGET_JVM
- public void ChangeToSSLSocket()
- {
- socket.ChangeToSSL();
- }
-#endif
}
}
sockets.Add (null);
}
-#if !TARGET_JVM
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static void Select_internal (ref Socket [] sockets,
int microSeconds,
out int error);
-#endif
public static void Select (IList checkRead, IList checkWrite, IList checkError, int microSeconds)
{
var list = new List<Socket> ();
}
#endif
-#if !TARGET_JVM
// Returns the amount of data waiting to be read on socket
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static int Available_internal(IntPtr socket, out int error);
-#endif
public int Available {
get {
}
}
-#if !TARGET_JVM
// Returns the local endpoint details in addr and port
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static SocketAddress LocalEndPoint_internal(IntPtr socket, int family, out int error);
-#endif
// Wish: support non-IP endpoints.
public EndPoint LocalEndPoint {
[Serializable]
public class SocketException : Win32Exception
{
-#if TARGET_JVM
- public SocketException ()
- : base (-2147467259)
-#else
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private static extern int WSAGetLastError_internal ();
public SocketException ()
: base (WSAGetLastError_internal ())
-#endif
{
}
}
}
-#if !TARGET_JVM
// Creates a new system socket, returning the handle
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern IntPtr Socket_internal(AddressFamily family,
SocketType type,
ProtocolType proto,
out int error);
-#endif
public Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
{
get { return address_family; }
}
-#if !TARGET_JVM
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static void Blocking_internal(IntPtr socket,
bool block,
out int error);
-#endif
public bool Blocking {
get {
get { return client.Connected; }
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.ExclusiveAddressUse is not supported")]
-#endif
public bool ExclusiveAddressUse {
get {
return(client.ExclusiveAddressUse);
client.EndConnect (asyncResult);
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.BeginConnect is not supported")]
-#endif
public IAsyncResult BeginConnect (IPAddress address, int port, AsyncCallback requestCallback, object state)
{
return client.BeginConnect (address, port, requestCallback, state);
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.BeginConnect is not supported")]
-#endif
public IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback requestCallback, object state)
{
return client.BeginConnect (addresses, port, requestCallback, state);
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.BeginConnect is not supported")]
-#endif
public IAsyncResult BeginConnect (string host, int port, AsyncCallback requestCallback, object state)
{
return client.BeginConnect (host, port, requestCallback, state);
/// Specifies whether the TcpListener allows only one
/// underlying socket to listen to a specific port
/// </summary>
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.ExclusiveAddressUse is not supported")]
-#endif
public bool ExclusiveAddressUse
{
get {
}
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.DontFragment is not supported")]
-#endif
public bool DontFragment
{
get {
}
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.EnableBroadcast is not supported")]
-#endif
public bool EnableBroadcast
{
get {
}
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.ExclusiveAddressUse is not supported")]
-#endif
public bool ExclusiveAddressUse
{
get {
}
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.MulticastLoopback is not supported")]
-#endif
public bool MulticastLoopback
{
get {
}
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.Ttl is not supported")]
-#endif
public short Ttl
{
get {
{ \r
}\r
\r
-#if !TARGET_JVM\r
// Methods\r
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)\r
{\r
base.GetObjectData (info, context);\r
}\r
-#endif\r
\r
public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
{\r
}
-#if !TARGET_JVM
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static bool GetHostByName_internal(string host, out string h_name, out string[] h_aliases, out string[] h_addr_list);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static bool GetHostName_internal(out string h_name);
-#endif
static void Error_11001 (string hostName)
{
string h_name;
string[] h_aliases, h_addrlist;
-#if TARGET_JVM
- h_name = null;
- h_aliases = null;
- h_addrlist = null;
- try {
- java.net.InetAddress[] iaArr =
- java.net.InetAddress.getAllByName(address);
- if (iaArr != null && iaArr.Length > 0)
- h_name = iaArr[0].getHostName();
- if (iaArr != null && iaArr.Length > 0)
- {
- h_addrlist = new String[iaArr.Length];
- for (int i = 0; i < h_addrlist.Length; i++)
- h_addrlist[i] = iaArr[i].getHostAddress();
- }
- } catch (java.net.UnknownHostException jUHE) {
- throw new SocketException((int)SocketError.HostNotFound, jUHE.Message);
- }
-#else
bool ret = GetHostByAddr_internal(address, out h_name, out h_aliases, out h_addrlist);
if (!ret)
Error_11001 (address);
-#endif
return (hostent_to_IPHostEntry (address, h_name, h_aliases, h_addrlist));
}
{
if (hostName == null)
throw new ArgumentNullException ("hostName");
-#if TARGET_JVM
- if (hostName.Length == 0)
- hostName = "localhost";
- try {
- java.net.InetAddress[] iaArr = java.net.InetAddress.getAllByName(hostName);
- IPHostEntry host = new IPHostEntry();
- if (iaArr != null && iaArr.Length > 0)
- {
- host.HostName = iaArr[0].getHostName();
- IPAddress[] ipArr = new IPAddress[iaArr.Length];
- for (int i = 0; i < iaArr.Length; i++)
- ipArr[i] = IPAddress.Parse(iaArr[i].getHostAddress());
-
- host.AddressList = ipArr;
- }
- return host;
- } catch (java.net.UnknownHostException jUHE) {
- throw new SocketException((int)SocketError.HostNotFound, jUHE.Message);
- }
-#else
string h_name;
string[] h_aliases, h_addrlist;
Error_11001 (hostName);
return(hostent_to_IPHostEntry(hostName, h_name, h_aliases, h_addrlist));
-#endif
}
public static string GetHostName ()
{
-#if TARGET_JVM
- return java.net.InetAddress.getLocalHost ().getHostName ();
-#else
string hostName;
bool ret = GetHostName_internal(out hostName);
Error_11001 (hostName);
return hostName;
-#endif
}
[Obsolete ("Use GetHostEntry instead")]
((IDisposable) this).Dispose ();\r
}\r
\r
-#if TARGET_JVM //enable overrides for extenders\r
- public override void Dispose()\r
-#else\r
void IDisposable.Dispose()\r
-#endif\r
{\r
Dispose (true);\r
\r
#endif
internal bool ChangeToSSLSocket (ref Stream stream) {
-#if TARGET_JVM
- stream.ChangeToSSLSocket ();
- return true;
-#elif SECURITY_DEP
+#if SECURITY_DEP
SslStream sslStream = new SslStream (stream, true, callback, null);
//sslStream.AuthenticateAsClient (Host, this.ClientCertificates, SslProtocols.Default, false);
//TODO: client certificates
// MS starts encoding with &# from 160 and stops at 255.
// We don't do that. One reason is the 65308/65310 unicode
// characters that look like '<' and '>'.
-#if TARGET_JVM
- if (c > 159 && c < 256) {
-#else
if (c > 159) {
-#endif
output.Append ("&#");
if (char.IsSurrogate (c))
output.Append (char.ConvertToUtf32 (s, i++));
}\r
\r
// Methods\r
-#if !TARGET_JVM\r
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)\r
{\r
base.GetObjectData (info, context);\r
}\r
-#endif\r
\r
public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
{\r
protocolVersion = version;
}
-#if !TARGET_JVM
internal EventHandler SendRequest (HttpWebRequest request, string groupName)
{
WebConnection cnc;
return cnc.SendRequest (request);
}
-#endif
public bool CloseConnectionGroup (string connectionGroupName)
{
lock (this) {
private static bool _checkCRL = false;
private static SecurityProtocolType _securityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
-#if TARGET_JVM
- static bool expectContinue = false;
-#else
static bool expectContinue = true;
-#endif
static bool useNagle;
static RemoteCertificateValidationCallback server_cert_cb;
static bool tcp_keepalive;
if (e == null) { // At least we now where it comes from
try {
-#if TARGET_JVM
- throw new Exception ();
-#else
throw new Exception (new System.Diagnostics.StackTrace ().ToString ());
-#endif
} catch (Exception e2) {
e = e2;
}
}\r
\r
// Methods\r
-#if !TARGET_JVM\r
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)\r
{\r
base.GetObjectData (info, context);\r
}\r
-#endif \r
\r
public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
{\r
return sb.Append("\r\n").ToString();
}
-#if !TARGET_JVM
void ISerializable.GetObjectData (SerializationInfo serializationInfo,
StreamingContext streamingContext)
{
GetObjectData (serializationInfo, streamingContext);
}
-#endif
public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
{
int count = base.Count;
{\r
throw new NotSupportedException ();\r
}\r
-#if TARGET_JVM //enable overrides for extenders\r
- public virtual void Dispose()\r
-#elif NET_4_0\r
+#if NET_4_0\r
public void Dispose ()\r
#else\r
void IDisposable.Dispose()\r
}
internal static Group Fail = new Group ();
-#if !TARGET_JVM
public CaptureCollection Captures {
get { return captures; }
}
-#endif
public bool Success {
get { return success; }
}
this.machine = machine;
this.text_length = text_length;
}
-#if !TARGET_JVM
internal Match (Regex regex, IMachine machine, string text, int text_length, int n_groups,
int index, int length, int n_caps) :
base (text, index, length, n_caps)
this.groups = new GroupCollection (n_groups, regex.Gap);
groups.SetValue (this, 0);
}
-#endif
internal Regex Regex {
get { return regex; }
}
[Serializable]
public partial class Regex : ISerializable {
-#if !TARGET_JVM && !FULL_AOT_RUNTIME
+#if !FULL_AOT_RUNTIME
[MonoTODO]
public static void CompileToAssembly (RegexCompilationInfo [] regexes, AssemblyName aname)
{
throw new ArgumentOutOfRangeException ("options");
}
-#if !TARGET_JVM
private void Init ()
{
this.machineFactory = cache.Lookup (this.pattern, this.roptions);
this.group_names = this.machineFactory.NamesMapping;
}
}
-#endif
private void InitNewRegex ()
{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void DeserializeTest ()
{
MemoryStream ms = new MemoryStream ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif // TARGET_JVM
public void DeserializeTest ()
{
MemoryStream ms = new MemoryStream ();
numbers, (Type) null);
Assert.Fail ("#1");
} catch (ArgumentNullException ex) {
-#if !TARGET_JVM
Assert.AreEqual ("destinationType", ex.ParamName, "#2");
-#endif
}
}
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category("NotWorking")]
-#endif
public void ConvertFrom_String_Flags ()
{
EnumConverter converter = new EnumConverter (typeof (E2));
}
[Test]
-#if TARGET_JVM
- [Ignore ("TD BUG ID: 7229")]
-#endif
public void Empty ()
{
PropertyDescriptorCollection descriptors = PropertyDescriptorCollection.Empty;
{
#if !MOBILE
[Test]
-#if TARGET_JVM
- [Ignore ("TD BUG ID: 7215, 7216")]
-#endif
public void DefaultType ()
{
ToolboxItemAttribute attr = new ToolboxItemAttribute (true);
}
[Test]
-#if TARGET_JVM
- [Ignore ("TD BUG ID: 7229")]
-#endif
public void GetProperties ()
{
PropertyDescriptorCollection properties = null;
// This test will fail when there are newer versions
// of the test assemblies - so conditionalize it in
// such cases.
-#if TARGET_JVM
- string expected = "MonoTests.System.Configuration.ProviderPoker, System.Test, Version=0.0.0.0";
-#elif NET_4_5
+#if NET_4_5
string expected = "MonoTests.System.Configuration.ProviderPoker, System_test_net_4_5, Version=0.0.0.0";
#elif NET_4_0
string expected = "MonoTests.System.Configuration.ProviderPoker, System_test_net_4_0, Version=0.0.0.0";
[TestFixture]
public class SettingsBaseTest
{
-#if TARGET_JVM
- class CustomerException : Exception { }
-#endif
class MySettings : SettingsBase
{
[UserScopedSetting] // ignored in non-ApplicationSettingsBase
try {
Assert.AreEqual (100, s.Foo, "#1");
Assert.Fail ("#2");
-#if !TARGET_JVM
} catch (Win32Exception) {
-#else
- } catch (CustomerException) {
-#endif
}
}
{
public override SettingsPropertyValueCollection GetPropertyValues (SettingsContext context, SettingsPropertyCollection props)
{
-#if !TARGET_JVM
throw new Win32Exception (); // unlikely thrown otherwise.
-#else
- throw new CustomerException (); // unlikely thrown otherwise.
-#endif
}
}
Assert.AreEqual (CFAConnected, false, "ConnectFail");
}
-#if !TARGET_JVM
[Test]
#if !NET_2_0
[ExpectedException (typeof (ArgumentException))]
sock.Close ();
}
}
-#endif
[Test]
public void TestSelect1 ()
{
using NUnit.Framework;
namespace MonoTests.System.Net.Sockets {
-#if TARGET_JVM
- [Ignore("UdpClient is not supported - since UDP sockets are not supported")]
-#endif
[TestFixture]
public class UdpClientTest {
[Test] // .ctor ()
\r
[Test]\r
[ExpectedException (typeof (SocketException))]\r
-#if TARGET_JVM\r
- [Ignore ("Ignore failures in Sys.Net")]\r
-#endif\r
public void GetHostByAddressString2 ()\r
{\r
Dns.GetHostByAddress ("123.255.23");\r
using NUnit.Framework;
-#if TARGET_JVM
-using System.Globalization;
-using System.Reflection;
-#endif
namespace MonoTests.System.Net
{
#else
Assert.AreEqual ("value", ex.Message, "#4");
#endif
-#if !TARGET_JVM
#if NET_2_0
Assert.IsNotNull (ex.ParamName, "#5");
Assert.AreEqual ("value", ex.ParamName, "#6");
#else
Assert.IsNull (ex.ParamName, "#5");
-#endif
#endif
Assert.IsNull (ex.InnerException, "#7");
}
} catch (WebException ex) {
Assert.AreEqual (typeof (WebException), ex.GetType (), "#1");
Assert.IsNotNull (ex.Message, "#2");
-#if !TARGET_JVM
Assert.IsTrue (ex.Message.IndexOf ("FileWebRequestTest.tmp") != -1, "#3");
Assert.IsNull (ex.Response, "#4");
Assert.IsNotNull (ex.InnerException, "#5");
-#endif
#if ONLY_1_1
FileNotFoundException fnf = ex.InnerException as FileNotFoundException;
} catch (ArgumentException ex) {
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNotNull (ex.Message, "#3");
-#if !TARGET_JVM
#if NET_2_0
Assert.AreEqual ("value", ex.ParamName, "#4");
#else
Assert.IsNull (ex.ParamName, "#4");
-#endif
#endif
Assert.IsNull (ex.InnerException, "#5");
}
} catch (ArgumentException ex) {
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNotNull (ex.Message, "#3");
-#if !TARGET_JVM
#if NET_2_0
Assert.AreEqual ("value", ex.ParamName, "#4");
#else
Assert.IsNull (ex.ParamName, "#4");
-#endif
#endif
Assert.IsNull (ex.InnerException, "#5");
}
} catch (ArgumentOutOfRangeException ex) {
Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#3");
Assert.IsNotNull (ex.Message, "#4");
-#if !TARGET_JVM
Assert.IsNotNull (ex.ParamName, "#5");
#if NET_2_0
Assert.IsFalse (ex.ParamName == "value", "#6");
#else
Assert.AreEqual ("value", ex.ParamName, "#6");
-#endif
#endif
Assert.IsNull (ex.InnerException, "#7");
}
}
[Test]
-#if TARGET_JVM
- //FIXME: include Java serialization compliant tests
- [Ignore ("The MS compliant binary serialization is not supported")]
-#endif
public void GetObjectData ()
{
FileWebRequest fwr = (FileWebRequest) WebRequest.Create ("file:///test.txt");
}
[Test]
-#if TARGET_JVM
- [Ignore ("The MS compliant binary serialization is not supported")]
-#endif
public void Deserialize ()
{
MemoryStream ms = new MemoryStream ();
return new Uri ("file:///" + tempFile);
}
-#if TARGET_JVM
-
- private bool RunningOnUnix {
- get {
- Type t = Type.GetType("java.lang.System");
- MethodInfo mi = t.GetMethod("getProperty", new Type[] { typeof(string) });
- string osName = (string) mi.Invoke(null, new object[] { "os.name" });
-
- if(osName == null) {
- return false;
- }
-
- return !osName.StartsWith("win", true, CultureInfo.InvariantCulture);
- }
- }
-
-#else
private bool RunningOnUnix {
get {
// check for Unix platforms - see FAQ for more details
return ((platform == 4) || (platform == 128) || (platform == 6));
}
}
-#endif
private static readonly byte [] _serialized = new byte [] {
#if NET_2_0
using NUnit.Framework;
-#if TARGET_JVM
-using System.Globalization;
-using System.Reflection;
-#endif
namespace MonoTests.System.Net
}
return new Uri ("file:///" + tempFile);
}
-#if TARGET_JVM
-
- private bool RunningOnUnix {
- get {
- Type t = Type.GetType("java.lang.System");
- MethodInfo mi = t.GetMethod("getProperty", new Type[] { typeof(string) });
- string osName = (string) mi.Invoke(null, new object[] { "os.name" });
-
- if(osName == null) {
- return false;
- }
-
- return !osName.StartsWith("win", true, CultureInfo.InvariantCulture);
- }
- }
-
-#else
private bool RunningOnUnix {
get {
// check for Unix platforms - see FAQ for more details
return ((platform == 4) || (platform == 128));
}
}
-#endif
}
}
namespace MonoTests.System.Net {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class HttpListener is not supported")]
-#endif
public class HttpListener2Test {
private HttpListener _listener = null;
namespace MonoTests.System.Net {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class HttpListenerBasicIdentity - is not supported")]
-#endif
public class HttpListenerBasicIdentityTest {
[Test]
[ExpectedException (typeof (ArgumentNullException))]
namespace MonoTests.System.Net {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class System.Net.HttpListenerPrefixCollection - is not supported")]
-#endif
public class HttpListenerPrefixCollectionTest {
-#if !TARGET_JVM
// NL -> Not listening -> tests when listener.IsListening == false
[Test]
public void NL_DefaultProperties ()
}
Assert.AreEqual (items, 1);
}
-#endif
}
}
#endif
namespace MonoTests.System.Net
{
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class HttpListener is not supported")]
-#endif
public class HttpListenerRequestTest
{
[Test]
namespace MonoTests.System.Net {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class HttpListener is not implemented")]
-#endif
public class HttpListenerTest {
-#if !TARGET_JVM
[Test]
public void DefaultProperties ()
{
Event.Close ();
}
}
-#endif
}
}
#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Ignore failures in Sys.Net")]
-#endif
public void Proxy_Null ()
{
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
[Test]
[Category("InetAccess")]
-#if TARGET_JVM
- [Ignore ("NMA - wrong cookies number returned")]
-#endif
public void Sync ()
{
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
}
}
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
[Test]
[Ignore ("Fails on MS.NET")]
public void SslClientBlock ()
}
#endif
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Missing_ContentEncoding ()
{
ServicePointManager.CertificatePolicy = new AcceptAllPolicy ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void BadServer_ChunkedClose ()
{
// The server will send a chunked response without a 'last-chunked' mark
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
[Ignore ("This does not timeout any more. That's how MS works when reading small responses")]
public void ReadTimeout ()
{
}
[Test] // bug #324300
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void AllowAutoRedirect ()
{
IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8765);
}
}
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
class SslHttpServer : HttpServer {
X509Certificate _certificate;
}
[Test] // bug #324182
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void CanTimeout ()
{
IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9128);
#if NET_2_0
[Test] // bug #324182
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void CanTimeout ()
{
IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
}
[Test]
-#if TARGET_JVM
- [Ignore ("TD BUG ID: 7213")]
-#endif
public void Constructor0_Address_Invalid ()
{
try {
}
[Test]
-#if TARGET_JVM
- [Ignore ("TD BUG ID: 7213")]
-#endif
public void Constructor1_Address_4Byte ()
{
byte [] bytes = new byte [4] { 192, 202, 112, 37 };
\r
[Test, ExpectedException (typeof (InvalidOperationException))]\r
[Category ("InetAccess")]\r
-#if TARGET_JVM\r
- [Ignore ("Unsupported property - ServicePointManager.MaxServicePoints")]\r
-#endif\r
public void MaxServicePointManagers ()\r
{\r
Assert.AreEqual (0, ServicePointManager.MaxServicePoints, "#1");\r
\r
[Test]\r
[Category ("InetAccess")]\r
-#if TARGET_JVM\r
- [Ignore ("Unsupported - ServicePointManager.FindServicePoint")]\r
-#endif\r
public void All ()\r
{\r
ServicePoint p = ServicePointManager.FindServicePoint (new Uri ("mailto:xx@yyy.com"));\r
\r
[Test]\r
[Category ("InetAccess")]\r
-#if TARGET_JVM\r
- [Ignore ("The System.Net.ServicePointManager.FindServicePoint(Uri) is not supported")]\r
-#endif \r
public void ConnectionLimit ()\r
{ \r
// the default is already 2, just in case it isn't..\r
#if NET_2_0\r
[Test]\r
[Category ("InetAccess")]\r
-#if TARGET_JVM\r
- [Ignore ("The System.Net.ServicePointManager.FindServicePoint(Uri) is not supported")]\r
-#endif \r
public void EndPointBind ()\r
{\r
Uri uri = new Uri ("http://www.go-mono.com/");\r
HttpWebRequest req = (HttpWebRequest) WebRequest.Create (uri);\r
\r
bool called = false;\r
-#if !TARGET_JVM\r
sp.BindIPEndPointDelegate = delegate {\r
Assert.IsTrue (!called);\r
called = true;\r
return null;\r
};\r
-#endif\r
req.GetResponse ().Close ();\r
\r
Assert.IsTrue (called);\r
\r
req = (HttpWebRequest) WebRequest.Create (uri);\r
called = false;\r
-#if !TARGET_JVM\r
sp.BindIPEndPointDelegate = delegate(ServicePoint point, IPEndPoint remote, int times) {\r
Assert.IsTrue (times < 5);\r
called = true;\r
return new IPEndPoint(IPAddress.Parse("0.0.0.0"), 12345 + times);\r
};\r
-#endif\r
req.GetResponse ().Close ();\r
\r
Assert.IsTrue (called);\r
}
[Test]
-#if TARGET_JVM
- //FIXME: include Java serialization compliant tests - the order of object
- // in SerializationInfo should stay same to MS format...
- [Ignore ("The MS compliant binary serialization is not supported")]
-#endif
public void GetObjectData ()
{
SerializationInfo si = new SerializationInfo (typeof (WebHeaderCollection),
}
[Test]
-#if TARGET_JVM
- //FIXME: include Java serialization compliant tests
- [Ignore ("The MS compliant binary serialization is not supported")]
-#endif
public void Serialize ()
{
WebHeaderCollection headers = new WebHeaderCollection ();
}
[Test]
-#if TARGET_JVM
- //FIXME: include Java serialization compliant tests
- [Ignore ("The MS compliant binary serialization format is not supported")]
-#endif
public void Deserialize ()
{
MemoryStream ms = new MemoryStream ();
}
[Test]
-#if TARGET_JVM
- [Ignore ("TD BUG ID: 7213")]
-#endif
public void IsByPassed_Host_Null ()
{
WebProxy p = new WebProxy ("http://proxy.contoso.com", true);
}
[Test]
-#if TARGET_JVM
- [Ignore ("The MS compliant binary serialization is not supported")]
-#endif
public void GetObjectData ()
{
SerializationInfo si = new SerializationInfo (typeof (WebHeaderCollection),
[Test]
[Category ("NotDotNet")]
-#if TARGET_JVM
- [Ignore ("TD #6954")]
-#endif
public void HtmlEncode_XSS ()
{
string problem = "\xff1cscript\xff1e"; // unicode looks alike <script>
namespace MonoTests.System.Security.Cryptography {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class System.Security.Cryptography.AsnEncodedData - is not supported")]
-#endif
public class AsnEncodedDataTest {
-#if !TARGET_JVM
static byte[] asnNullBytes = { 0x05, 0x00 };
static string asnNullString = "05 00";
static byte[] asnLongBytes = { 0x30,0x5C,0x02,0x55,0x2D,0x58,0xE9,0xBF,0xF0,0x31,0xCD,0x79,0x06,0x50,0x5A,0xD5,0x9E,0x0E,0x2C,0xE6,0xC2,0xF7,0xF9,0xD2,0xCE,0x55,0x64,0x85,0xB1,0x90,0x9A,0x92,0xB3,0x36,0xC1,0xBC,0xEA,0xC8,0x23,0xB7,0xAB,0x3A,0xA7,0x64,0x63,0x77,0x5F,0x84,0x22,0x8E,0xE5,0xB6,0x45,0xDD,0x46,0xAE,0x0A,0xDD,0x00,0xC2,0x1F,0xBA,0xD9,0xAD,0xC0,0x75,0x62,0xF8,0x95,0x82,0xA2,0x80,0xB1,0x82,0x69,0xFA,0xE1,0xAF,0x7F,0xBC,0x7D,0xE2,0x7C,0x76,0xD5,0xBC,0x2A,0x80,0xFB,0x02,0x03,0x01,0x00,0x01 };
Assert.AreEqual ("Subject Alternative Name", aed.Oid.FriendlyName, "FriendlyName");
// anyway the answer is most probably CryptoAPI
}
-#endif
}
}
namespace MonoTests.System.Security.Cryptography {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class System.Security.Cryptography.OidCollection - is not supported")]
-#endif
public class OidCollectionTest {
-#if !TARGET_JVM
[Test]
public void Constructor ()
Oid[] array = null;
oc.CopyTo (array, 0);
}
-#endif
}
}
namespace MonoTests.System.Security.Cryptography {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class System.Security.Cryptography.OidEnumerator - is not supported")]
-#endif
public class OidEnumeratorTest {
-#if !TARGET_JVM
private OidEnumerator GetEnumerator ()
{
OidCollection oc = new OidCollection ();
enumerator.Reset ();
Assert.IsNotNull (enumerator.Current, "Current after reset");
}
-#endif
}
}
-#endif
\ No newline at end of file
+#endif
namespace MonoTests.System.Security.Cryptography {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class System.Security.Cryptography.Oid - is not supported")]
-#endif
public class OidTest {
-#if !TARGET_JVM
static string invalidOid = "1.0";
static string invalidName = "friendlyName";
// TODO: add other well known oid as we find them
}
-#endif
}
}
Assert.AreEqual ("/", uri.AbsolutePath, "#7e");
Assert.AreEqual ("/", uri.PathAndQuery, "#7f");
Assert.AreEqual ("file://one_file.txt/", uri.GetLeftPart (UriPartial.Path), "#7g");
-#if !TARGET_JVM
if (isWin32)
Assert.AreEqual ("\\\\one_file.txt\\", uri.LocalPath, "#7b");
else
Assert.AreEqual ("/", uri.LocalPath, "#7b");
-#endif
Assert.AreEqual ("file", uri.Scheme, "#7c");
Assert.AreEqual ("one_file.txt", uri.Host, "#7d");
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// NumberFormatter is shared with Grasshopper and hence the #if TARGET_JVM for
-// marking the use of unsafe code that is not supported in Grasshopper.
-#if !TARGET_JVM
-#define UNSAFE_TABLES
-#endif
-
using System.Globalization;
using System.Text;
using System.Threading;
const double MinRoundtripVal = -1.79769313486231E+308;
const double MaxRoundtripVal = 1.79769313486231E+308;
-#if UNSAFE_TABLES
// The below arrays are taken from mono/metatdata/number-formatter.h
private static readonly unsafe ulong* MantissaBitsTable;
out DigitLowerTable, out DigitUpperTable, out TenPowersList, out DecHexDigits);
}
- unsafe
-#endif
- static long GetTenPowerOf(int i)
+ unsafe static long GetTenPowerOf(int i)
{
return TenPowersList [i];
}
// Helper to translate an int in the range 0 .. 9999 to its
// Hexadecimal digits representation.
-#if UNSAFE_TABLES
- unsafe
-#endif
- private static uint FastToDecHex (int val)
+ unsafe private static uint FastToDecHex (int val)
{
if (val < 100)
return (uint)DecHexDigits [val];
_decPointPos = _digitsLen = DecHexLen ();
}
-#if UNSAFE_TABLES // No unsafe code under TARGET_JVM
- unsafe
-#endif
- private void Init (string format, double value, int defPrecision)
+ unsafe private void Init (string format, double value, int defPrecision)
{
Init (format);
return new string (_cbuf, 0, _ind);
}
-#if UNSAFE_TABLES // No unsafe code under TARGET_JVM
- unsafe
-#endif
- private string FormatHexadecimal (int precision)
+ unsafe private string FormatHexadecimal (int precision)
{
int size = Math.Max (precision, _decPointPos);
-#if UNSAFE_TABLES
char* digits = _specifierIsUpper ? DigitUpperTable : DigitLowerTable;
-#else
- char[] digits = _specifierIsUpper ? DigitUpperTable : DigitLowerTable;
-#endif
+
ResetCharBuf (size);
_ind = size;
ulong val = _val1 | ((ulong)_val2 << 32);
_cbuf [_ind++] = (char)('0' | v & 0xf);
}
-#if UNSAFE_TABLES // No unsafe code under TARGET_JVM
- unsafe
-#endif
- private void FastAppendDigits (int val, bool force)
+ unsafe private void FastAppendDigits (int val, bool force)
{
int i = _ind;
int digits;
}
[Test]
- [Category ("TargetJvmNotWorking")] // BUGBUG Very very slow on TARGET_JVM.
public void SerializationTest()
{
for (int i = 0; i < 50; i++)
#if !NET_4_0 // FIXME: the blob contains the 2.0 mscorlib version
[Test]
- [Category ("TargetJvmNotWorking")]
public void SerializeTest ()
{
List <int> list = new List <int> ();
list.Add (0);
list.Add (7);
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
MemoryStream ms = new MemoryStream ();
bf.Serialize (ms, list);
#endif
[Test]
- [Category ("TargetJvmNotWorking")]
public void DeserializeTest ()
{
MemoryStream ms = new MemoryStream ();
ms.Write (_serializedList, 0, _serializedList.Length);
ms.Position = 0;
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
List<int> list = (List<int>) bf.Deserialize (ms);
Assert.AreEqual (3, list.Count, "#1");
Assert.AreEqual (5, list [0], "#2");
[Test]
public void Deserialize ()
{
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
MemoryStream ms = new MemoryStream (serialized_en_us);
CaseInsensitiveHashCodeProvider enus = (CaseInsensitiveHashCodeProvider) bf.Deserialize (ms);
h['b'] = 2;\r
DictionaryEntry[] o = new DictionaryEntry[2];\r
h.CopyTo(o,0);\r
-#if TARGET_JVM // Hashtable is not an ordered collection!\r
- if (o[0].Key.Equals('b')) {\r
- DictionaryEntry v = o[0];\r
- o[0] = o[1];\r
- o[1] = v;\r
- }\r
-#endif // TARGET_JVM\r
Assert.AreEqual ('a', o[0].Key, "first copy fine.");\r
Assert.AreEqual (1, o[0].Value, "first copy fine.");\r
Assert.AreEqual ('b', o[1].Key, "second copy fine.");\r
}\r
\r
[Test]\r
- [Category ("TargetJvmNotWorking")]\r
public void TestSerialization2 () {\r
// Test from bug #70570\r
MemoryStream stream = new MemoryStream();\r
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void SerializeTest ()
{
SortedList sl1 = new SortedList ();
sl1.Add (0, "B");
sl1.Add (7, "C");
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
bf.AssemblyFormat = FormatterAssemblyStyle.Full;
MemoryStream ms = new MemoryStream ();
bf.Serialize (ms, sl1);
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void Keys_Serialize ()
{
SortedList sl = new SortedList ();
sl.Add (7, "C");
IList keys1 = (IList) sl.Keys;
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
bf.AssemblyFormat = FormatterAssemblyStyle.Full;
MemoryStream ms = new MemoryStream ();
bf.Serialize (ms, keys1);
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void Values_Serialize ()
{
SortedList sl = new SortedList ();
sl.Add (7, "C");
IList values1 = (IList) sl.Values;
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
bf.AssemblyFormat = FormatterAssemblyStyle.Full;
MemoryStream ms = new MemoryStream ();
bf.Serialize (ms, values1);
[Category ("NotWorking")]
public void Values_Deserialize ()
{
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
MemoryStream ms = new MemoryStream ();
ms.Write (_serializedValues, 0, _serializedValues.Length);
}
[Test]
- [Category ("TargetJvmNotWorking")] //OptionalCalendars not yet supported for TARGET_JVM.
// make sure that all CultureInfo holds non-null calendars.
public void OptionalCalendars ()
{
Assert.AreEqual ("dddd, d' ta\\' 'MMMM yyyy", culture.DateTimeFormat.LongDatePattern);
}
-#if !TARGET_JVM
[Test]
public void Bug78569 ()
{
DateTime dt2 = DateTime.Parse (s, ci);
Assert.AreEqual (dt.Month, dt2.Month);
}
-#endif
}
}
public void DeserializeKnownValue ()
{
MemoryStream ms = new MemoryStream (serialized_daylighttime);
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
DaylightTime dt = (DaylightTime) bf.Deserialize (ms);
Assert.AreEqual (DateTime.MinValue, dt.Start, "Start");
Assert.AreEqual (DateTime.MaxValue, dt.End, "End");
}
[Test]
- [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM
public void LastAccessTime ()
{
DirectoryInfo info = new DirectoryInfo (TempFolder);
}
[Test]
- [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM
public void LastAccessTimeUtc ()
{
DirectoryInfo info = new DirectoryInfo (TempFolder);
}
[Test]
- [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM
public void CreationTime ()
{
DirectoryInfo info = new DirectoryInfo (TempFolder);
}
[Test]
- [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM
public void CreationTimeUtc ()
{
DirectoryInfo info = new DirectoryInfo (TempFolder);
Assert.IsFalse (Directory.Exists (null as string));\r
}\r
\r
-#if !TARGET_JVM && !MOBILE // We don't support yet the Process class.\r
+#if !MOBILE // We don't support yet the Process class.\r
[Test] // bug #78239\r
public void ExistsAccessDenied ()\r
{\r
#endif\r
\r
[Test]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
[ExpectedException(typeof(ArgumentNullException))]\r
public void GetCreationTimeException1 ()\r
{\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeException2 ()\r
{\r
Directory.GetCreationTime (string.Empty);\r
#if !NET_2_0\r
[ExpectedException(typeof(IOException))]\r
#endif\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeException_NonExistingPath ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.GetCreationTime.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeException4 ()\r
{\r
Directory.GetCreationTime (" ");\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeException5 ()\r
{\r
Directory.GetCreationTime (Path.InvalidPathChars [0].ToString ());\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtcException1 ()\r
{\r
Directory.GetCreationTimeUtc (null as string);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtcException2 ()\r
{\r
Directory.GetCreationTimeUtc (string.Empty);\r
#if !NET_2_0\r
[ExpectedException (typeof (IOException))]\r
#endif\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtc_NonExistingPath ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.GetCreationTimeUtc.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtcException4 ()\r
{\r
Directory.GetCreationTimeUtc (" ");\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtcException5 ()\r
{\r
Directory.GetCreationTime (Path.InvalidPathChars [0].ToString ());\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTime_Null ()\r
{\r
Directory.GetLastAccessTime (null as string);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeException2 ()\r
{\r
Directory.GetLastAccessTime (string.Empty);\r
#if !NET_2_0\r
[ExpectedException (typeof (IOException))]\r
#endif\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTime_NonExistingPath ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.GetLastAccessTime.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeException4 ()\r
{\r
Directory.GetLastAccessTime (" ");\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeException5 ()\r
{\r
Directory.GetLastAccessTime (Path.InvalidPathChars [0].ToString ());\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtc_Null ()\r
{\r
Directory.GetLastAccessTimeUtc (null as string);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtcException2 ()\r
{\r
Directory.GetLastAccessTimeUtc (string.Empty);\r
#if !NET_2_0\r
[ExpectedException (typeof (IOException))]\r
#endif\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtc_NonExistingPath ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.GetLastAccessTimeUtc.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtcException4 ()\r
{\r
Directory.GetLastAccessTimeUtc (" ");\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtcException5 ()\r
{\r
Directory.GetLastAccessTimeUtc (Path.InvalidPathChars [0].ToString ());\r
}\r
\r
[Test]\r
- [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM\r
public void CreationTime ()\r
{\r
if (RunningOnUnix)\r
}\r
\r
[Test]\r
- [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM\r
public void LastAccessTime ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.AccessTime.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException1 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException2 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(FileNotFoundException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException3 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException4 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException5 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException1 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException2 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(FileNotFoundException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException3 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException4 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException5 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException1 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException2 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(FileNotFoundException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException3 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException4 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException5 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException1 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException2 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(FileNotFoundException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException3 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException4 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException5 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
}
[Test]
- [Category("TargetJvmNotSupported")] // File sharing not supported for TARGET_JVM
public void OpenRead_FileLock ()
{
string path = TempFolder + DSC + "FIT.OpenReadIOException.Test";
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]
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]
Assert.IsNotNull (fnf.Message, "#4"); // File or assembly name (null), or ...
#endif
Assert.IsNull (fnf.FusionLog, "#5");
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
Assert.AreEqual (fnf.GetType ().FullName + ": ",
fnf.ToString (), "#6");
#else
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]
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]
#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");
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]
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]
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);
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]
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]
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");
}
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
}
}
-#if !TARGET_JVM // No support IntPtr file handles under TARGET_JVM
[Test, ExpectedException (typeof (IOException))]
public void CtorIOException2 ()
{
stream.Close ();
}
}
-#endif // TARGET_JVM
- [Category("TargetJvmNotSupported")] // File sharing not supported for TARGET_JVM
[Test, ExpectedException (typeof (IOException))]
public void CtorIOException ()
{
}
[Test]
- [Category("TargetJvmNotSupported")] // File sharing not supported for TARGET_JVM
[ExpectedException (typeof (IOException))]
public void CtorAccess1Read2Write ()
{
}
[Test]
- [Category("TargetJvmNotSupported")] // File sharing not supported for TARGET_JVM
[ExpectedException (typeof (IOException))]
public void CtorAccess1Write2Write ()
{
DeleteFile (path);
}
- [Category("TargetJvmNotSupported")] // File locking not supported for TARGET_JVM
public void TestLock ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "TestLock";
}
}
-#if !TARGET_JVM // No support IntPtr file handles under TARGET_JVM
// Check that the stream is flushed even when it doesn't own the
// handle
[Test]
Assert.AreEqual ((int) '1', s.ReadByte ());
s.Close ();
}
-#endif // TARGET_JVM
private void DeleteFile (string path)
{
}
}
-#if !TARGET_JVM // No support IntPtr file handles under TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Constructor_InvalidFileHandle ()
{
new FileStream ((IntPtr) (-1L), FileAccess.Read);
}
-#endif // TARGET_JVM
[Test]
public void PositionAfterSetLength ()
}
[Test]
- [Category("TargetJvmNotSupported")] // Async IO not supported for TARGET_JVM
[ExpectedException (typeof (ObjectDisposedException))]
public void BeginRead_Disposed ()
{
}
[Test]
- [Category("TargetJvmNotSupported")] // Async IO not supported for TARGET_JVM
[ExpectedException (typeof (ObjectDisposedException))]
public void BeginWrite_Disposed ()
{
}
[Test]
- [Category("TargetJvmNotSupported")] // File locking not supported for TARGET_JVM
[ExpectedException (typeof (ObjectDisposedException))]
public void Lock_Disposed ()
{
}
[Test]
- [Category("TargetJvmNotSupported")] // File locking not supported for TARGET_JVM
[ExpectedException (typeof (ObjectDisposedException))]
public void Unlock_Disposed ()
{
}
}
- [Category("TargetJvmNotSupported")] // FileOptions.DeleteOnClose not supported for TARGET_JVM
[Test]
public void DeleteOnClose ()
{
}
[Test]
- [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM
public void CreationTimeFile ()
{
if (Unix)
}
[Test]
- [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM
public void CreationTimeDirectory ()
{
if (Unix)
}
[Test]
- [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM
public void CreationTimeNoFileOrDirectory ()
{
string path = TempFolder + DSC + "FSIT.CreationTimeNoFile.Test";
}
[Test]
- [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM
public void DefaultLastAccessTime ()
{
string path = TempFolder + DSC + "FSIT.DefaultLastAccessTime.Test";
}
[Test]
- [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM
public void LastAccessTime ()
{
string path = TempFolder + DSC + "FSIT.LastAccessTime.Test";
}
[Test]
- [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM
public void DefaultLastWriteTime ()
{
string path = TempFolder + DSC + "FSIT.DefaultLastWriteTime.Test";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void TestGetCreationTime ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "baz";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void CreationTime ()
{
if (RunningOnUnix)
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void LastAccessTime ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "lastAccessTime";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTime_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTime_Path_Empty ()
{
try {
}
[Test]
- //[Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTime_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "GetCreationTimeException3";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTime_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTime_Path_InvalidPathChars ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeUtc_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeUtc_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeUtc_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "GetCreationTimeUtcException3";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeUtc_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeUtc_Path_InvalidPathChars ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTime_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTime_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTime_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "GetLastAccessTimeException3";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTime_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTime_Path_InvalidPathChars ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeUtc_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeUtc_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeUtc_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "GetLastAccessTimeUtcException3";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeUtc_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeUtc_Path_InvalidPathChars ()
{
try {
// SetCreationTime and SetCreationTimeUtc exceptions
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTime_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTime_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTime_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTime_Path_InvalidPathChars ()
{
// On Unix there are no invalid path chars.
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTime_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetCreationTimeFileNotFoundException1";
// }
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTime_FileLock ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "CreationTimeIOException1";
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTimeUtc_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTimeUtc_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTimeUtc_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTimeUtc_Path_InvalidPathChars ()
{
// On Unix there are no invalid path chars.
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTimeUtc_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetCreationTimeUtcFileNotFoundException1";
// }
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTimeUtc_FileLock ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetCreationTimeUtcIOException1";
// SetLastAccessTime and SetLastAccessTimeUtc exceptions
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTime_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTime_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTime_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTime_Path_InvalidPathChars ()
{
// On Unix there are no invalid path chars.
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTime_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetLastAccessTimeFileNotFoundException1";
// }
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTime_FileLock ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "LastAccessIOException1";
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTimeUtc_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetCLastAccessTimeUtc_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTimeUtc_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTimeUtc_Path_InvalidPathChars ()
{
// On Unix there are no invalid path chars.
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTimeUtc_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetLastAccessTimeUtcFileNotFoundException1";
// }
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTimeUtc_FileLock ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetLastAccessTimeUtcIOException1";
{
if (Windows) {
Assert.AreEqual (@"Z:\", Path.GetFullPath ("Z:"), "GetFullPath w#01");
-#if !TARGET_JVM // Java full (canonical) path always starts with caps drive letter
Assert.AreEqual (@"c:\abc\def", Path.GetFullPath (@"c:\abc\def"), "GetFullPath w#02");
-#endif
Assert.IsTrue (Path.GetFullPath (@"\").EndsWith (@"\"), "GetFullPath w#03");
// "\\\\" is not allowed
Assert.IsTrue (Path.GetFullPath ("/").EndsWith (@"\"), "GetFullPath w#05");
string curdir = Directory.GetCurrentDirectory ();
try {
-#if TARGET_JVM
- string system = "C:\\WINDOWS\\system32\\";
-#else
string system = Environment.SystemDirectory;
-#endif
Directory.SetCurrentDirectory (system);
string drive = system.Substring (0, 2);
Assert.AreEqual (system, Path.GetFullPath (drive), "current dir");
string curdir = Directory.GetCurrentDirectory ();
try {
-#if TARGET_JVM
- string system = "C:\\WINDOWS\\system32\\";
-#else
string system = Environment.SystemDirectory;
-#endif
Directory.SetCurrentDirectory (system);
// e.g. C:dir (no backslash) will return CurrentDirectory + dir
string dir = system.Substring (0, 2) + "dir";
}
#endif
[Test]
-#if TARGET_JVM
- [Ignore("Java full (canonical) path always returns windows dir in caps")]
-#endif
public void WindowsDriveC14N_77058 ()
{
// check for Unix platforms - see FAQ for more details
// Copyright (C) 2004, 2009 Novell (http://www.novell.com)
//
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using System;
using System.Collections;
using System.IO;
using System.Configuration.Assemblies;
using System.IO;
using System.Reflection;
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
using System.Reflection.Emit;
#endif
using System.Runtime.Serialization;
private string tempDir = Path.Combine (Path.GetTempPath (), "MonoTests.System.Reflection.AssemblyNameTest");
-#if !TARGET_JVM // Thread.GetDomain is not supported for TARGET_JVM.
private AppDomain domain;
-#endif // TARGET_JVM
// created with "sn -o test.snk test.txt"
static byte[] keyPair = {
Directory.CreateDirectory (tempDir);
-#if !TARGET_JVM // Thread.GetDomain is not supported for TARGET_JVM.
domain = Thread.GetDomain ();
-#endif // TARGET_JVM
}
[TearDown]
return assemblyName;
}
-#if !TARGET_JVM && !MOBILE // Reflection.Emit is not supported for TARGET_JVM.
+#if !MOBILE
private Assembly GenerateAssembly (AssemblyName name)
{
AssemblyBuilder ab = domain.DefineDynamicAssembly (
ab = GenerateDynamicAssembly (name);
Assert.AreEqual ("1.2.0.0", ab.GetName ().Version.ToString (), "1.2.0.0 dynamic");
}
-#endif // TARGET_JVM
+#endif
[Test]
public void HashAlgorithm ()
Assert.AreEqual (an.GetPublicKeyToken (), dsAssemblyName.GetPublicKeyToken (), "PublicToken");
}
-#if !TARGET_JVM // Assemblyname.GetObjectData not implemented yet for TARGET_JVM
[Test]
public void GetObjectData_Info_Null ()
{
Assert.AreEqual ("info", ex.ParamName, "#6");
}
}
-#endif // TARGET_JVM
[Test]
public void Clone_Corlib ()
}
[Test] // ctor (String)
- [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM.
public void Constructor1_Full ()
{
const string assemblyName = "TestAssembly";
}
[Test] // ctor (String)
- [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM.
public void Constructor1_Version ()
{
const string assemblyName = "TestAssembly";
using System.Globalization;
using System.IO;
using System.Reflection;
-#if !TARGET_JVM && !MONOTOUCH
+#if !MONOTOUCH
using System.Reflection.Emit;
#endif
using System.Threading;
string fname = AppDomain.CurrentDomain.FriendlyName;
if (fname.EndsWith (".dll")) { // nunit-console
Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
-#if NET_2_0 && !TARGET_JVM // IsDefaultAppDomain not supported for TARGET_JVM
+#if NET_2_0
Assert.IsFalse (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
#endif
} else { // gnunit
Assert.IsNotNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
-#if NET_2_0 && !TARGET_JVM // IsDefaultAppDomain not supported for TARGET_JVM
+#if NET_2_0
Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
#endif
}
}
-#if !TARGET_JVM && !MONOTOUCH // Reflection.Emit is not supported.
+#if !MONOTOUCH // Reflection.Emit is not supported.
[Test]
public void GetModules_MissingFile ()
{
}
#endif
-#if !TARGET_JVM // ManifestModule not supported under TARGET_JVM.
[Category ("NotWorking")]
[Test]
public void Corlib ()
Assert.IsNotNull (corlib_test.ManifestModule, "ManifestModule");
Assert.IsFalse (corlib_test.ReflectionOnly, "ReflectionOnly");
}
-#endif
[Test]
public void GetAssembly ()
}
[Test]
- [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM
public void GetFile_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM
public void GetFile_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM
public void GetFiles_False ()
{
Assembly corlib = typeof (int).Assembly;
}
[Test]
- [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM
public void GetFiles_True ()
{
Assembly corlib = typeof (int).Assembly;
Assert.Fail ("Was not able to load any corlib test");
}
-#if !TARGET_JVM // GetObjectData currently not implemented for Assembly.
[Test]
public void GetObjectData_Info_Null ()
{
Assert.AreEqual ("info", ex.ParamName, "#6");
}
}
-#endif // TARGET_JVM
[Test]
public void GetReferencedAssemblies ()
}
}
-#if !TARGET_JVM && !MONOTOUCH // Reflection.Emit is not supported.
+#if !MONOTOUCH // Reflection.Emit is not supported.
[Test]
public void Location_Empty() {
string assemblyFileName = Path.Combine (
Directory.Delete (outdir, true);
}
-#endif // TARGET_JVM
+#endif
[Test]
public void ManifestModule ()
using System;
using System.Threading;
using System.Reflection;
-#if !TARGET_JVM && !MONOTOUCH
+#if !MONOTOUCH
using System.Reflection.Emit;
-#endif // TARGET_JVM
+#endif
using System.Runtime.InteropServices;
using NUnit.Framework;
typeof (Foo).GetField ("static_field").GetValue (typeof (int));
}
-#if !TARGET_JVM // ReflectionOnlyLoad not supported for TARGET_JVM
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void GetValueOnRefOnlyAssembly ()
FieldInfo f = t.GetField ("RefOnlyField", BindingFlags.Static | BindingFlags.NonPublic);
f.SetValue (null, 8);
}
-#endif // TARGET_JVM
const int literal = 42;
Assert.AreEqual (null, fi2.GetValue (t));
}
-#if !TARGET_JVM // TypeBuilder not supported for TARGET_JVM
[Test]
public void NonPublicTests ()
{
fi = t.GetField ("protectedField", BindingFlags.NonPublic | BindingFlags.Instance);
Assert.IsNotNull (fi);
}
-#endif // TARGET_JVM
[Test]
public void GetRawDefaultValue ()
[TestFixture]
public class MethodInfoTest
{
-#if !TARGET_JVM
[DllImport ("libfoo", EntryPoint="foo", CharSet=CharSet.Unicode, ExactSpelling=false, PreserveSig=true, SetLastError=true, BestFitMapping=true, ThrowOnUnmappableChar=true)]
public static extern void dllImportMethod ();
-#endif
[MethodImplAttribute(MethodImplOptions.PreserveSig)]
public void preserveSigMethod ()
{
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ReturnTypePseudoCustomAttributes ()
{
MethodInfo mi = typeof (MethodInfoTest).GetMethod ("ReturnTypeMarshalAs");
}
#if NET_2_0
-#if !TARGET_JVM // MethodBody is not supported for TARGET_JVM
[Test]
public void GetMethodBody_Abstract ()
{
else
Assert.AreEqual (false, locals [1].IsPinned, "#6");
}
-#endif // TARGET_JVM
public int return_parameter_test ()
{
//Assert.IsTrue (pi.IsRetval, "#3");
}
-#if !TARGET_JVM // ReflectionOnly is not supported yet on TARGET_JVM
[Test]
public void InvokeOnRefOnlyAssembly ()
{
Assert.IsNotNull (ex.Message, "#4");
}
}
-#endif // TARGET_JVM
[Test]
[ExpectedException (typeof (TargetInvocationException))]
{
}
-#if !TARGET_JVM // No support for extern methods in TARGET_JVM
[DllImport ("foo")]
public extern static void marshalAsMethod (
[MarshalAs(UnmanagedType.Bool)]int p0,
[MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr)] string [] p1,
[MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof (Marshal1), MarshalCookie = "5")] object p2);
-#endif
[Test]
public void DefaultValueEnum () {
ParameterInfo[] info = typeof (ParameterInfoTest).GetMethod ("paramMethod").GetParameters ();
Assert.AreEqual (1, info[3].GetCustomAttributes (typeof (OptionalAttribute), true).Length, "#A4");
Assert.AreEqual (2, info[4].GetCustomAttributes (true).Length, "#A5");
-#if !TARGET_JVM // No support for extern methods in TARGET_JVM
ParameterInfo[] pi = typeof (ParameterInfoTest).GetMethod ("marshalAsMethod").GetParameters ();
MarshalAsAttribute attr;
Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#D1");
Assert.AreEqual ("5", attr.MarshalCookie, "#D2");
Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#D3");
-#endif
}
[Test] // bug #342536
using System;
using System.Threading;
using System.Reflection;
-#if !TARGET_JVM && !MONOTOUCH
+#if !MONOTOUCH
using System.Reflection.Emit;
-#endif // TARGET_JVM
+#endif
using NUnit.Framework;
//
// Copyright (C) 2004-2007 Novell, Inc (http://www.novell.com)
//
-#if !TARGET_JVM
using NUnit.Framework;
using System;
using System.IO;
}
#endif
}
-#endif
public void DeserializeKnownValue ()
{
MemoryStream ms = new MemoryStream (serialized_sync_attr);
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
SynchronizationAttribute sa = (SynchronizationAttribute) bf.Deserialize (ms);
Assert.IsTrue (sa.IsReEntrant, "IsReEntrant");
Assert.IsFalse (sa.Locked, "Locked");
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
// Copyright 2011 Xamarin Inc (http://www.xamarin.com).
//
-#if !TARGET_JVM
using NUnit.Framework;
using System;
}
}
}
-#endif
CreateFromName ("http://www.w3.org/2000/09/xmldsig#hmac-sha1", null);
// URL used in DigestMethod element
CreateFromName ("http://www.w3.org/2000/09/xmldsig#sha1", "System.Security.Cryptography.SHA1CryptoServiceProvider");
-#if !TARGET_JVM //TargetJvmNotWorking - algorithms from System.Security assembly
// URL used in Canonicalization or Transform elements
CreateFromName ("http://www.w3.org/TR/2001/REC-xml-c14n-20010315", "System.Security.Cryptography.Xml.XmlDsigC14NTransform");
CreateFromName ("http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments", "System.Security.Cryptography.Xml.XmlDsigC14NWithCommentsTransform");
CreateFromName ("http://www.w3.org/2001/04/xmldsig-more#hmac-sha384", "System.Security.Cryptography.HMACSHA384");
CreateFromName ("http://www.w3.org/2001/04/xmldsig-more#hmac-sha512", "System.Security.Cryptography.HMACSHA512");
CreateFromName ("http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160", "System.Security.Cryptography.HMACRIPEMD160");
-#endif
#endif
}
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void ConstructorCspParameters ()
{
CspParameters csp = new CspParameters (13, null, "Mono1024");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void ConstructorKeySizeCspParameters ()
{
CspParameters csp = new CspParameters (13, null, "Mono512");
// http://msdn.microsoft.com/library/en-us/cpguide/html/cpcongeneratingkeysforencryptiondecryption.asp
[Test]
- [Category ("TargetJvmNotSupported")]
public void Persistence_PersistKeyInCsp_False ()
{
CspParameters csp = new CspParameters (3, null, "Persistence_PersistKeyInCsp_False");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void Persistence_PersistKeyInCsp_True ()
{
CspParameters csp = new CspParameters (3, null, "Persistence_PersistKeyInCsp_True");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void Persistence_Delete ()
{
CspParameters csp = new CspParameters (3, null, "Persistence_Delete");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void UseMachineKeyStore ()
{
// note only applicable when CspParameters isn't used - which don't
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void ConstructorCspParameters ()
{
CspParameters csp = new CspParameters (1, null, "Mono1024");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void ConstructorKeySizeCspParameters ()
{
int keySize = 512;
// http://msdn.microsoft.com/library/en-us/cpguide/html/cpcongeneratingkeysforencryptiondecryption.asp
[Test]
- [Category ("TargetJvmNotSupported")]
public void Persistence_PersistKeyInCsp_False ()
{
CspParameters csp = new CspParameters (1, null, "Persistence_PersistKeyInCsp_False");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void Persistence_PersistKeyInCsp_True ()
{
CspParameters csp = new CspParameters (1, null, "Persistence_PersistKeyInCsp_True");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void Persistence_Delete ()
{
CspParameters csp = new CspParameters (1, null, "Persistence_Delete");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void UseMachineKeyStore ()
{
// note only applicable when CspParameters isn't used - which don't
using NUnit.Framework;
namespace MonoTests.System.Security.Permissions {
-#if !TARGET_JVM
public class FilePathUtil {
[DllImport("kernel32.dll")]
private static extern uint GetLongPathName (string shortPath,
return null;
}
}
-#endif
[TestFixture]
public class FileIOPermissionTest {
pathsInPermission = read.Split(';');
Assert.IsTrue(pathsInPermission.Length == 2, "Path list should have 2 for Read");
}
-#if !TARGET_JVM
[Test]
[Ignore("should compatibility go that far ?")]
public void ShortToLong ()
// note: this will fail on Linux as kernel32.dll isn't available
Assert.AreEqual (FilePathUtil.GetLongPathName (filename), files [0], "GetLongPathName(GetTempFileName)==GetPathList[0]");
}
-#endif
[Test]
[ExpectedException (typeof (ArgumentException))]
public void FileUrl ()
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using NUnit.Framework;
using System;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using NUnit.Framework;
using System;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using NUnit.Framework;
using System;
try {
SecureStringTest unit = new SecureStringTest ();
unit.DefaultConstructor ();
-#if !TARGET_JVM
unit.UnsafeConstructor ();
-#endif
unit.ReadOnly ();
unit.Disposed ();
}
Assert.Ignore (NotSupported);
}
}
-#if !TARGET_JVM
[Test]
public unsafe void UnsafeConstructor ()
{
SecureString ss = GetMaxLength ();
ss.AppendChar ('a');
}
-#endif
[Test]
public void Copy_Empty ()
{
SecureString ss = new SecureString ();
ss.RemoveAt (1);
}
-#if !TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentOutOfRangeException))]
public void InsertAt_BiggerThanMax ()
SecureString ss = GetMaxLength ();
ss.InsertAt (ss.Length, 'a');
}
-#endif
private SecureString GetReadOnly ()
{
SecureString ss = new SecureString ();
readonly object obj_1 = "obj_1";
readonly object obj_2 = "obj_2";
readonly object obj_3 = "obj_3";
-#if !TARGET_JVM // No support for exchanging two IntPtrs
readonly IntPtr iptr_1 = (IntPtr)int32_1;
readonly IntPtr iptr_2 = (IntPtr)int32_2;
readonly IntPtr iptr_3 = (IntPtr)int32_3;
-#endif // TARGET_JVM
[Test]
public void TestExchange_Int32 ()
Assert.AreEqual(dbl_2, dbl);
}
-#if !TARGET_JVM // No support for exchanging two IntPtrs
[Test]
public void TestExchange_Iptr ()
{
Assert.AreEqual(iptr_1, Interlocked.Exchange(ref iptr, iptr_2));
Assert.AreEqual(iptr_2, iptr);
}
-#endif // TARGET_JVM
#endif
[Test]
Assert.AreEqual(dbl_2, dbl);
}
-#if !TARGET_JVM // No support for compare exchanging two IntPtrs
[Test]
public void TestCompareExchange_Iptr ()
{
Assert.AreEqual(iptr_1, Interlocked.CompareExchange(ref iptr, iptr_2, iptr_1));
Assert.AreEqual(iptr_2, iptr);
}
-#endif // TARGET_JVM
#endif
[Test]
Assert.AreEqual(dbl_1, dbl);
}
-#if !TARGET_JVM // No support for compare exchanging two IntPtrs
[Test]
public void TestCompareExchange_Failed_Iptr ()
{
Assert.AreEqual(iptr_1, Interlocked.CompareExchange(ref iptr, iptr_2, iptr_3));
Assert.AreEqual(iptr_1, iptr);
}
-#endif // TARGET_JVM
#endif
[Test]
}\r
\r
[Test]\r
- [Category("TargetJvmNotSupported")] // IntPtr native handles are not supported for TARGET_JVM.\r
public void TestHandle()\r
{\r
Mutex Sem = new Mutex();\r
{
public static void NoPrincipal ()
{
-#if !TARGET_JVM // AppDomain.SetPrincipalPolicy not supported for TARGET_JVM
AppDomain.CurrentDomain.SetPrincipalPolicy (PrincipalPolicy.NoPrincipal);
-#endif
IPrincipal p = Thread.CurrentPrincipal;
Assert.IsNull (p, "#1");
// in this case we can return to null
}
-#if !TARGET_JVM // AppDomain.SetPrincipalPolicy not supported for TARGET_JVM
public static void UnauthenticatedPrincipal ()
{
AppDomain.CurrentDomain.SetPrincipalPolicy (PrincipalPolicy.UnauthenticatedPrincipal);
Assert.IsNotNull (Thread.CurrentPrincipal, "#7");
// in this case we can't return to null
}
-#endif // TARGET_JVM
public static void CopyOnNewThread ()
{
}
}
-#if !TARGET_JVM // AppDomain.SetPrincipalPolicy not supported for TARGET_JVM
[Test]
[Ignore ("see comment below.")]
public void CurrentPrincipal_PrincipalPolicy_UnauthenticatedPrincipal ()
t.Abort ();
}
}
-#endif // TARGET_JVM
[Test]
public void IPrincipal_CopyOnNewThread ()
using System.Globalization;
using System.IO;
using System.Reflection;
-#if !TARGET_JVM && !MONOTOUCH // Reflection.Emit not supported for TARGET_JVM
+#if !MONOTOUCH
using System.Reflection.Emit;
#endif
using System.Runtime.InteropServices;
Assert.AreEqual (7, objCOMTest.Id, "#A05");
}
-#if !TARGET_JVM && !MONOTOUCH // Reflection.Emit not supported for TARGET_JVM
+#if !MONOTOUCH
[Test]
[ExpectedException (typeof (MissingMethodException))]
public void CreateInstance_TypeBuilder ()
{
Activator.CreateInstance (typeof (ArgIterator), null);
}
-#endif // TARGET_JVM
+#endif
[Test]
[ExpectedException (typeof (NotSupportedException))]
Activator.CreateInstance (typeof (void), null);
}
-#if !TARGET_JVM // RuntimeArgumentHandle not supported for TARGET_JVM
[Test]
[ExpectedException (typeof (NotSupportedException))]
public void CreateInstance_RuntimeArgumentHandle ()
{
Activator.CreateInstance (typeof (RuntimeArgumentHandle), null);
}
-#endif // TARGET_JVM
[Test]
[ExpectedException (typeof (NotSupportedException))]
[Test]
[ExpectedException(typeof(MissingMethodException))]
- [Category ("TargetJvmNotWorking")]
public void CreateInstanceAbstract2 ()
{
Activator.CreateInstance (typeof (Type), true);
[Test]
[ExpectedException (typeof (MissingMethodException))]
- [Category ("TargetJvmNotWorking")]
public void CreateInstanceAbstract5 ()
{
Activator.CreateInstance (typeof (Type), BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, null, CultureInfo.InvariantCulture, null);
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void CreateInstance_Nullable ()
{
Assert.AreEqual (5, Activator.CreateInstance (typeof (Nullable<int>), new object [] { 5 }));
#if !MOBILE
[Test]
[ExpectedException (typeof (ArgumentNullException))]
- [Category ("TargetJvmNotWorking")]
public void GetObject_UrlNull ()
{
Activator.GetObject (typeof (COMTest), null);
}
[Test]
- [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
public void Unification_FromFx10 ()
{
Unification (String.Format (CorlibPermissionPattern, fx10version));
}
[Test]
- [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
public void Unification_FromFx11 ()
{
Unification (String.Format (CorlibPermissionPattern, fx11version));
}
[Test]
- [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
public void Unification_FromFx20 ()
{
Unification (String.Format (CorlibPermissionPattern, fx20version));
}
[Test]
- [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
public void Unification_FromFx99_Corlib ()
{
Unification (String.Format (CorlibPermissionPattern, "9.99.999.9999"));
}
[Test]
- [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
[Category ("NotWorking")]
public void Unification_FromFx99_System ()
{
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ConfigurationFile_Relative_ApplicationBase ()
{
string fileName = "blar.config";
[Test]
[ExpectedException (typeof (MemberAccessException))] // The ApplicationBase must be set before retrieving this property
- [Category ("TargetJvmNotWorking")]
public void ConfigurationFile_Relative_NoApplicationBase ()
{
AppDomainSetup setup = new AppDomainSetup();
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ApplicationBase1 ()
{
string expected_path = tmpPath.Replace(@"\", @"/");
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ApplicationBase2 ()
{
AppDomainSetup setup = new AppDomainSetup ();
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ApplicationBase3 ()
{
AppDomainSetup setup = new AppDomainSetup ();
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ApplicationBase4 ()
{
AppDomainSetup setup = new AppDomainSetup ();
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ApplicationBase5 ()
{
// This is failing because of (probably) a windows-ism, so don't worry
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ApplicationBase6 ()
{
AppDomainSetup setup = new AppDomainSetup ();
} catch (ArgumentException) {
errorThrown = true;
}
-#if TARGET_JVM // This is really implementation dependent behaviour.
- catch (RankException) {
- errorThrown = true;
- }
-#endif // TARGET_JVM
Assert.IsTrue (errorThrown, "#E62");
}
{
}
Assert.IsTrue (errorThrown, "#F03b");
}
-#if !TARGET_JVM // Arrays lower bounds are not supported for TARGET_JVM
{
bool errorThrown = false;
try {
}
Assert.IsTrue (errorThrown, "#F04");
}
-#endif // TARGET_JVM
{
bool errorThrown = false;
try {
}
Assert.IsTrue (errorThrown, "#F05");
}
-#if !TARGET_JVM // CreateInstance with lower bounds not supported for TARGET_JVM
{
bool errorThrown = false;
try {
Type szarrayType = new int [10].GetType ();
Assert.IsTrue (szarrayType == (Array.CreateInstance (typeof (int), new int[] {1}, new int[] {0})).GetType ());
Assert.IsTrue (szarrayType != (Array.CreateInstance (typeof (int), new int[] {1}, new int[] {1})).GetType ());
-#endif // TARGET_JVM
}
[Test]
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestGetEnumeratorNonZeroLowerBounds() {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestIList_Add () {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestIList_Insert () {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestIList_Remove () {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestIList_RemoveAt () {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestIList_Contains () {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestIList_IndexOf () {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
public int i, j;
}
-#if !TARGET_JVM // BugBUG: T[] is not yet ICollection<T> under TARGET_JVM
[Test]
// From bug #80563
public void ICollectionNull ()
Assert.AreEqual (-1, test.IndexOf (null), "array with test");
}
-#endif // TARGET_JVM
#region Bug 80299
Assert.IsNotNull (bif.Message, "#4");
Assert.AreEqual ("message", bif.Message, "#5");
Assert.IsNull (bif.FusionLog, "#6");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName + ": message"), "#7");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": message",
bif.ToString (), "#7");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#4");
Assert.AreEqual (string.Empty, bif.Message, "#5");
Assert.IsNull (bif.FusionLog, "#6");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": "), "#7");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": ",
bif.ToString (), "#7");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#5");
Assert.AreEqual ("message", bif.Message, "#6");
Assert.IsNull (bif.FusionLog, "#7");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().IndexOf (ame.GetType ().FullName + ": something") != -1, "#8");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": message ---> "
+ ame.GetType ().FullName + ": something", bif.ToString (), "#8");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#5");
Assert.AreEqual (string.Empty, bif.Message, "#6");
Assert.IsNull (bif.FusionLog, "#7");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().IndexOf (ame.GetType ().FullName + ": something") != -1, "#8");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": ---> "
+ ame.GetType ().FullName + ": something", bif.ToString (), "#8");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNull (bif.FusionLog, "#7");
Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName), "#8");
Assert.IsTrue (bif.ToString ().IndexOf ("---> " + ame.GetType ().FullName) != -1, "#9");
-#if !TARGET_JVM // ToString always has a stack trace under TARGET_JVM
Assert.IsFalse (bif.ToString ().IndexOf (Environment.NewLine) != -1, "#10");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#4");
Assert.AreEqual ("message", bif.Message, "#5");
Assert.IsNull (bif.FusionLog, "#6");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": message"), "#7");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": message",
bif.ToString (), "#7");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#5");
Assert.AreEqual ("message", bif.Message, "#6");
Assert.IsNull (bif.FusionLog, "#7");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": message"), "#8");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": message",
bif.ToString (), "#8");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#A4");
Assert.AreEqual ("message", bif.Message, "#A5");
Assert.IsNull (bif.FusionLog, "#A6");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": message"), "#A7");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": message",
bif.ToString (), "#A7");
-#endif // TARGET_JVM
bif = new BadImageFormatException (string.Empty, (string) null);
Assert.IsNotNull (bif.Message, "#B4");
Assert.AreEqual (string.Empty, bif.Message, "#B5");
Assert.IsNull (bif.FusionLog, "#B6");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": "), "#B7");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": ",
bif.ToString (), "#B7");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#5");
Assert.AreEqual (string.Empty, bif.Message, "#6");
Assert.IsNull (bif.FusionLog, "#7");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": "), "#8");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": ", bif.ToString (), "#8");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNull (bif.FusionLog, "#5");
Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName
+ ": "), "#6");
-#if !TARGET_JVM // ToString always has a stack trace under TARGET_JVM
Assert.IsFalse (bif.ToString ().IndexOf (Environment.NewLine) != -1, "#7");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNull (bif.FusionLog, "#B6");
Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName
+ ": "), "#B7");
-#if !TARGET_JVM // ToString always has a stack trace under TARGET_JVM
Assert.IsFalse (bif.ToString ().IndexOf (Environment.NewLine) != -1, "#B8");
-#endif // TARGET_JVM
Assert.IsTrue (bif.ToString ().IndexOf ("''") != -1, "#B9");
}
}
[Test]
[ExpectedException (typeof (FormatException))]
- [Category ("TargetJvmNotWorking")]
public void FromBase64CharArray_Empty ()
{
Convert.FromBase64CharArray (new char[0], 0, 0);
[Test]
[ExpectedException (typeof (FormatException))]
- [Category ("TargetJvmNotWorking")]
public void FormatBase64CharArray_OnlyWhitespace ()
{
Convert.FromBase64CharArray (new char[3] {' ',
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void FromBase64_Empty ()
{
Assert.AreEqual (new byte[0], Convert.FromBase64String (string.Empty));
new ToStringTest ("E", Decimal.MinValue, "-7.922816E+028"),
new ToStringTest ("E3", Decimal.MinValue, "-7.923E+028"),
new ToStringTest ("E28", Decimal.MinValue, "-7.9228162514264337593543950335E+028"),
-#if !TARGET_JVM // TargetJvmNotWorking
new ToStringTest ("E30", Decimal.MinValue, "-7.922816251426433759354395033500E+028"),
-#endif
new ToStringTest ("E0", Decimal.MinValue, "-8E+028"),
new ToStringTest ("N3", Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335.000"),
new ToStringTest ("N0", Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335"),
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void TestPercentPattern ()
{
NumberFormatInfo nfi2 = (NumberFormatInfo) NfiUser.Clone ();
};
[Test]
- [Category ("TargetJvmNotWorking")]
public void TestParse ()
{
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void TryParse ()
{
Decimal r;
}\r
}\r
\r
-#if TARGET_JVM\r
- // Under TARGET_JVm we have a slightly better precision (becuase of\r
- // using Java BigDecimal).\r
- private bool AreNotEqual(Decimal v1, Decimal v2)\r
- {\r
- Decimal delta = v1 - v2;\r
- if (delta < 0m)\r
- delta = -delta;\r
- Decimal absV1 = v1 < 0m ? -v1 : v1;\r
- if (absV1 < 1m)\r
- return delta > 1E-27m;\r
- return delta / absV1 > 1E-27m;\r
- }\r
-#else\r
private bool AreNotEqual(Decimal v1, Decimal v2)\r
{\r
return v1 != v2;\r
}\r
-#endif\r
\r
[Test]\r
\r
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void CoContraVariance ()
{
CoContraVariantDelegate d = (CoContraVariantDelegate)
Assert.AreEqual ("00", TestingEnum4.This.ToString ("x"), "#B1");
Assert.AreEqual ("00", TestingEnum4.This.ToString ("X"), "#B2");
-#if !TARGET_JVM // This appears not to work under .Net
Assert.AreEqual ("ff", TestingEnum4.Test.ToString ("x"), "#B3");
-#endif // TARGET_JVM
Assert.AreEqual ("FF", TestingEnum4.Test.ToString ("X"), "#B4");
Assert.AreEqual ("0000", TestingEnum5.This.ToString ("x"), "#C1");
Assert.AreEqual ("0000", TestingEnum5.This.ToString ("X"), "#C2");
-#if !TARGET_JVM // This appears not to work under .Net
Assert.AreEqual ("7fff", TestingEnum5.Test.ToString ("x"), "#C3");
-#endif // TARGET_JVM
Assert.AreEqual ("7FFF", TestingEnum5.Test.ToString ("X"), "#C4");
Assert.AreEqual ("00000000", TestingEnum6.This.ToString ("x"), "#D1");
Assert.AreEqual ("00000000", TestingEnum6.This.ToString ("X"), "#D2");
-#if !TARGET_JVM // This appears not to work under .Net
Assert.AreEqual ("7fffffff", TestingEnum6.Test.ToString ("x"), "#D3");
-#endif // TARGET_JVM
Assert.AreEqual ("7FFFFFFF", TestingEnum6.Test.ToString ("X"), "#D4");
Assert.AreEqual ("0000000000000000", TestingEnum3.This.ToString ("x"), "#E1");
Assert.AreEqual ("0000000000000000", TestingEnum3.This.ToString ("X"), "#E2");
-#if !TARGET_JVM // This appears not to work under .Net
Assert.AreEqual ("ffffffffffffffff", TestingEnum3.Test.ToString ("x"), "#E3");
-#endif // TARGET_JVM
Assert.AreEqual ("FFFFFFFFFFFFFFFF", TestingEnum3.Test.ToString ("X"), "#E4");
}
Assert.IsFalse (d.IsSynchronized, "IsSynchronized");
}
-#if NET_2_0 && !TARGET_JVM && !NET_2_1
+#if NET_2_0 && !NET_2_1
[Test] // bug #333740
public void GetEnvironmentVariables_NewlySet ()
{
Environment.GetEnvironmentVariables ((EnvironmentVariableTarget)Int32.MinValue);
}
-#if !TARGET_JVM // Environment.SetEnvironmentVariable not supported under TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetEnvironmentVariable_Target_Invalid ()
Environment.SetEnvironmentVariable ("A3", "\0");
Assert.IsNull (Environment.GetEnvironmentVariables ()["A3"]);
}
-#endif // TARGET_JVM
#endif
}
}
public class MathTest
{
private static double double_epsilon =
-#if TARGET_JVM
- 1E-15;
-#else
double.Epsilon;
-#endif
static double x = 0.1234;
static double y = 12.345;
iTest++;
Assert.IsTrue (Double.IsNaN (Math.Pow (1, Double.NaN)),
"Math.Pow(1, NaN) should be NaN");
-#if !TARGET_JVM
iTest++;
Assert.IsTrue (Double.IsNaN (Math.Pow (Double.NaN, 0)),
"Math.Pow(NaN, 0) should be NaN");
-#endif
iTest++;
Assert.IsTrue (1.0 == Math.Pow (-1, Double.MaxValue),
"Math.Pow(-1, MaxValue) should be 1.0");
{
private CultureInfo old_culture;
-#if TARGET_JVM // BinaryFormatter is Java based under TARGET_JVM.
- private BinaryFormatter CreateBinaryFormatter()
- {
- return (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
- }
-#else
private BinaryFormatter CreateBinaryFormatter()
{
return new BinaryFormatter();
}
-#endif // TARGET_JVM
[SetUp]
public void SetUp ()
}
-#if !TARGET_JVM
[Test] // ctor (Char [])
public unsafe void Constructor2 ()
{
Assert.AreEqual (String.Empty, new String (new Char [0]), "#2");
Assert.AreEqual ("A", new String (new Char [1] {'A'}), "#3");
}
-#endif
[Test] // ctor (Char, Int32)
public void Constructor4 ()
}
}
-#if !TARGET_JVM
[Test]
public unsafe void CharPtrConstructor ()
{
Assert.AreEqual (String.Empty, new String ((sbyte*) null, 1, 0, Encoding.Default), "#F");
}
-#endif
[Test]
public void Length ()
{
Assert.AreEqual (-1, s1.LastIndexOf("original", s1.Length-11), "stepped string index #3");
Assert.AreEqual (-1, s1.LastIndexOf("translator", 2), "stepped string index #4");
Assert.AreEqual (0, string.Empty.LastIndexOf(string.Empty, 0), "stepped string index #5");
-#if !TARGET_JVM
Assert.AreEqual (-1, string.Empty.LastIndexOf("A", -1), "stepped string index #6");
-#endif
Assert.AreEqual (10, s1.LastIndexOf("rig", s1.Length-1, 10), "stepped limited string index #1");
Assert.AreEqual (-1, s1.LastIndexOf("rig", s1.Length, 3), "stepped limited string index #2");
Assert.AreEqual (10, s1.LastIndexOf("rig", s1.Length-2, 15), "stepped limited string index #3");
Assert.AreEqual (s2.Replace("..", "."), "..aaaaaaa.bbbbbbbbb,......ccccccc.u..");
// Test replacing null characters (bug #67395)
-#if !TARGET_JVM //bug #7276
Assert.AreEqual ("is this ok ?", "is \0 ok ?".Replace ("\0", "this"), "should not strip content after nullchar");
-#endif
}
[Test]
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void CurrentTimeZone_SerializationRoundtrip ()
{
TimeZone tz = TimeZone.CurrentTimeZone;
Assert.AreEqual (typeof (ICloneable[][]).IsAssignableFrom (typeof (Duper[][])), true, "#12");
// Tests for vectors<->one dimensional arrays */
-#if TARGET_JVM // Lower bounds arrays are not supported for TARGET_JVM.
- Array arr1 = Array.CreateInstance (typeof (int), new int[] {1});
- Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr1.GetType ()), true, "#13");
-#else
Array arr1 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {0});
Array arr2 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {10});
Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr1.GetType ()), true, "#13");
Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr2.GetType ()), false, "#14");
-#endif // TARGET_JVM
// Test that arrays of enums can be cast to their base types
Assert.AreEqual (typeof (int[]).IsAssignableFrom (typeof (TypeCode[])), true, "#15");
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void TestGetPropertyImpl ()
{
// Test getting property that is exact
typeof (long), new Type[0], null), "#2");
}
-#if !TARGET_JVM // StructLayout not supported for TARGET_JVM
[StructLayout(LayoutKind.Explicit, Pack = 4, Size = 64)]
public class Class1
{
Assert.AreEqual (LayoutKind.Explicit, attr3.Value);
Assert.AreEqual (CharSet.Unicode, attr3.CharSet);
}
-#endif // TARGET_JVM
[Test]
public void Namespace ()
Assert.IsNull (i);
}
-#if !TARGET_JVM && !MOBILE // Reflection.Emit is not supported for TARGET_JVM
+#if !MOBILE
[Test]
public void EqualsUnderlyingType ()
{
Assert.IsTrue (typeof (int).Equals (e));
}
-#endif // TARGET_JVM
+#endif
[Test]
public void Equals_Type_Null ()
[assembly: AssemblyProduct("MONO CLI")]
[assembly: AssemblyCopyright("(c) 2003 Various Authors")]
[assembly: AssemblyTrademark("")]
-#if TARGET_JVM
-[assembly: CLSCompliant(false)]
-#else
[assembly: CLSCompliant(true)]
-#endif
[assembly: ComVisible(false)]
[assembly: AssemblyDefaultAlias("mono-service.exe")]
[assembly: AssemblyInformationalVersion("0.0.0.1")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AllowPartiallyTrustedCallers()]
-#if !TARGET_JVM
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("../../class/mono.snk")]
-#endif
using System.Xml.Schema;
using System.Xml.Xsl;
using System.Xml.XPath;
-#if !TARGET_JVM && !MSNET
+#if !MSNET
using Commons.Xml.Nvdl;
using Commons.Xml.Relaxng;
using Commons.Xml.Relaxng.Rnc;
case "--help":
Usage ();
return;
-#if !TARGET_JVM && !MSNET
+#if !MSNET
case "--validate":
ValidateAuto (args);
return;
}
}
-#if !TARGET_JVM && !MSNET
+#if !MSNET
static void ValidateAuto (string [] args)
{
if (args.Length < 1) {