Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
//
// Copyright (c) 2006 Mainsoft Co.
//
// 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.
//
using System;
using System.Data;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleParameter_ctor : GHTBase
{
public static void Main()
{
OracleParameter_ctor tc = new OracleParameter_ctor();
Exception exp = null;
try
{
tc.BeginTest("OracleParameter_ctor");
tc.run();
}
catch(Exception ex){exp = ex;}
finally {tc.EndTest(exp);}
}
[Test]
public void run()
{
Exception exp = null;
OracleParameter param = new OracleParameter();
try
{
BeginCase("ctor");
Compare(param != null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
}
//public TestClass():base(true){}
//Activate this constructor to log Failures to a log file
//public TestClass(System.IO.TextWriter tw):base(tw, false){}
//Activate this constructor to log All to a log file
//public TestClass(System.IO.TextWriter tw):base(tw, true){}
//BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES
}
}

View File

@@ -0,0 +1,95 @@
//
// Copyright (c) 2006 Mainsoft Co.
//
// 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.
//
using System;
using System.Data;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleParameter_ctor_SO : GHTBase
{
public static void Main()
{
OracleParameter_ctor_SO tc = new OracleParameter_ctor_SO();
Exception exp = null;
try
{
tc.BeginTest("OracleParameter_ctor_SO");
tc.run();
}
catch(Exception ex){exp = ex;}
finally {tc.EndTest(exp);}
}
[Test]
public void run()
{
Exception exp = null;
OracleParameter param = new OracleParameter("myParam",10);
try
{
BeginCase("ctor");
Compare(param != null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("name");
Compare(param.ParameterName ,"myParam");
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("value");
Compare(param.Value, 10);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
}
//public TestClass():base(true){}
//Activate this constructor to log Failures to a log file
//public TestClass(System.IO.TextWriter tw):base(tw, false){}
//Activate this constructor to log All to a log file
//public TestClass(System.IO.TextWriter tw):base(tw, true){}
//BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES
}
}

View File

@@ -0,0 +1,151 @@
//
// Copyright (c) 2006 Mainsoft Co.
//
// 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.
//
using System;
using System.Data;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleParameter_ctor_SOIPBBBSDO : GHTBase
{
public static void Main()
{
OracleParameter_ctor_SOIPBBBSDO tc = new OracleParameter_ctor_SOIPBBBSDO();
Exception exp = null;
try
{
tc.BeginTest("OracleParameter_ctor_SOIPBBBSDO");
tc.run();
}
catch(Exception ex){exp = ex;}
finally {tc.EndTest(exp);}
}
[Test]
public void run()
{
Exception exp = null;
OracleParameter param = new OracleParameter("myParam", //param name
OracleType.Double, //type
5, //size
ParameterDirection.Input, //direction
true, //nillbale
1, //precision
1, //scale
"Column1", //source column
DataRowVersion.Current, //datarow version
590.456); //value
try
{
BeginCase("ParameterName");
Compare(param.ParameterName , "myParam");
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("OracleType");
Compare(param.OracleType ,OracleType.Double );
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("Size");
Compare(param.Size , 5);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("ParameterDirection");
Compare(param.Direction , ParameterDirection.Input );
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("IsNullable");
Compare(param.IsNullable , true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("Precision");
Compare(param.Precision , (byte)1);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("Scale");
Compare(param.Scale , (byte)1);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("SourceColumn");
Compare(param.SourceColumn ,"Column1");
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("SourceVersion");
Compare(param.SourceVersion ,DataRowVersion.Current );
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("Value");
Compare(param.Value ,590.456);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
}
//public TestClass():base(true){}
//Activate this constructor to log Failures to a log file
//public TestClass(System.IO.TextWriter tw):base(tw, false){}
//Activate this constructor to log All to a log file
//public TestClass(System.IO.TextWriter tw):base(tw, true){}
//BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES
}
}

View File

@@ -0,0 +1,190 @@
//
// Copyright (c) 2006 Mainsoft Co.
//
// 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.
//
using System;
using System.Data;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
#if DAAB
using Microsoft.ApplicationBlocks;
#endif
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
[Category ("NotWorking")]
public class OracleParameter_ctor_SOtype : ADONetTesterClass
{
private Exception exp;
// transaction use was add for PostgreSQL
OracleTransaction tr;
public static void Main()
{
OracleParameter_ctor_SOtype tc = new OracleParameter_ctor_SOtype();
tc.exp = null;
try
{
tc.BeginTest("OracleParameter_ctor_SOtype on " + ConnectedDataProvider.GetDbType().ToString());
tc.run();
}
catch(Exception ex){tc.exp = ex;}
finally {tc.EndTest(tc.exp);}
}
public void run()
{
Log(string.Format("DB Server={0}.", ConnectedDataProvider.GetDbType()));
AllTypes();
SimpleTypesWithDBNull();
}
[Test]
public void AllTypes()
{
exp = null;
OracleParameter param = null;
foreach (OracleType dbtype in Enum.GetValues(typeof(OracleType)))
{
param = new OracleParameter("myParam",dbtype);
try
{
BeginCase("ctor " + dbtype.ToString());
Compare(param != null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("name " + dbtype.ToString());
Compare(param.ParameterName ,"myParam");
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
}
}
[Test]
//#if !TARGET_JVM
// [Category("NotWorking")]
//#endif
public void SimpleTypesWithDBNull()
{
OracleConnection con=null;
OracleCommand cmd=null;
OracleDataReader rdr=null;
try
{
exp = null;
BeginCase("Test simple types with DBNull");
string connectionString = ConnectedDataProvider.ConnectionString;
con = new OracleConnection(connectionString);
cmd = new OracleCommand();
con.Open();
// transaction use was add for PostgreSQL
tr = con.BeginTransaction();
cmd = new OracleCommand("", con, tr);
cmd.CommandText = "GHSP_TYPES_SIMPLE_1";
cmd.CommandType = CommandType.StoredProcedure;
AddSimpleTypesNullParams(cmd);
cmd.Parameters.Add(new OracleParameter("result",OracleType.Cursor)).Direction = ParameterDirection.Output;
#if !JAVA
if (ConnectedDataProvider.GetDbType(con) == DataBaseServer.PostgreSQL)
{
#if DAAB
rdr = Microsoft.ApplicationBlocks.Data.PostgresOracleHelper.OLEDB4ODBCExecuteReader(cmd,true);
#endif
}
else
#endif
{
rdr = cmd.ExecuteReader();
}
rdr.Read();
for (int i=0; i<rdr.FieldCount; i++)
{
Compare(DBNull.Value, rdr.GetValue(i));
}
rdr.Close();
}
catch (Exception ex)
{
exp = ex;
}
finally
{
EndCase(exp);
if(rdr != null && !rdr.IsClosed)
{
rdr.Close();
}
if (con != null && con.State == ConnectionState.Open)
{
con.Close();
}
exp=null;
}
}
private void AddSimpleTypesNullParams(OracleCommand cmd)
{
OracleParameter tmpParam;
tmpParam = new OracleParameter("T_NUMBER", OracleType.Number);
cmd.Parameters.Add(tmpParam);
tmpParam = new OracleParameter("T_LONG", OracleType.LongVarChar);
cmd.Parameters.Add(tmpParam);
tmpParam = new OracleParameter("T_FLOAT", OracleType.Float);
cmd.Parameters.Add(tmpParam);
tmpParam = new OracleParameter("T_VARCHAR", OracleType.VarChar);
cmd.Parameters.Add(tmpParam);
tmpParam = new OracleParameter("T_NVARCHAR", OracleType.NVarChar);
cmd.Parameters.Add(tmpParam);
tmpParam = new OracleParameter("T_CHAR", OracleType.Char);
cmd.Parameters.Add(tmpParam);
tmpParam = new OracleParameter("T_NCHAR", OracleType.NChar);
cmd.Parameters.Add(tmpParam);
foreach (OracleParameter current in cmd.Parameters)
{
current.Value = DBNull.Value;
}
}
}
}

View File

@@ -0,0 +1,116 @@
//
// Copyright (c) 2006 Mainsoft Co.
//
// 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.
//
using System;
using System.Data;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
[Category ("NotWorking")]
public class OracleParameter_ctor_SOtypeI : GHTBase
{
public static void Main()
{
OracleParameter_ctor_SOtypeI tc = new OracleParameter_ctor_SOtypeI();
Exception exp = null;
try
{
tc.BeginTest("OracleParameter_ctor_SOtypeI");
tc.run();
}
catch(Exception ex){exp = ex;}
finally {tc.EndTest(exp);}
}
[Test]
public void run()
{
Exception exp = null;
OracleParameter param = null;
foreach (OracleType dbtype in Enum.GetValues(typeof(OracleType)))
{
param = new OracleParameter("myParam",dbtype,5);
try
{
BeginCase("ctor " + dbtype.ToString());
Compare(param != null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("name " + dbtype.ToString());
Compare(param.ParameterName ,"myParam");
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("size " + dbtype.ToString());
Compare(param.Size ,5);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
}
try
{
BeginCase("ctor - illegal size ");
try
{
param = new OracleParameter("myParam",OracleType.Int32 ,-5);
}
catch (Exception ex) {exp = ex;}
Compare(exp.GetType().FullName , typeof(ArgumentException).FullName );
exp=null;
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
}
//public TestClass():base(true){}
//Activate this constructor to log Failures to a log file
//public TestClass(System.IO.TextWriter tw):base(tw, false){}
//Activate this constructor to log All to a log file
//public TestClass(System.IO.TextWriter tw):base(tw, true){}
//BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES
}
}

View File

@@ -0,0 +1,106 @@
//
// Copyright (c) 2006 Mainsoft Co.
//
// 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.
//
using System;
using System.Data;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
[Category ("NotWorking")]
public class OracleParameter_ctor_SOtype_IS : GHTBase
{
public static void Main()
{
OracleParameter_ctor_SOtype_IS tc = new OracleParameter_ctor_SOtype_IS();
Exception exp = null;
try
{
tc.BeginTest("OracleParameter_ctor_SOtypeIS");
tc.run();
}
catch(Exception ex){exp = ex;}
finally {tc.EndTest(exp);}
}
[Test]
public void run()
{
Exception exp = null;
OracleParameter param = null;
param = new OracleParameter("myParam",OracleType.Int32 ,5,"myColumn");
try
{
BeginCase("ctor ");
Compare(param != null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("name ");
Compare(param.ParameterName ,"myParam");
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("size ");
Compare(param.Size ,5);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
try
{
BeginCase("size ");
Compare(param.SourceColumn ,"myColumn");
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp); exp = null;}
}
}
//public TestClass():base(true){}
//Activate this constructor to log Failures to a log file
//public TestClass(System.IO.TextWriter tw):base(tw, false){}
//Activate this constructor to log All to a log file
//public TestClass(System.IO.TextWriter tw):base(tw, true){}
//BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES
}