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,27 @@
2008-07-16 Gert Driesen <drieseng@users.sourceforge.net>
* OracleDataAdapter_FillSchema_DsSt.cs: Moved initialization of
connectionString to a setup method, as workaround for NUNit 2.2.0
bug with Assert.Ignore in ctor.
2008-06-27 Gert Driesen <drieseng@users.sourceforge.net>
* OracleDataAdapter_FillSchema_DsSt.cs: Ignore tests when not compiled
for JVM. Fixes buildbot test failure.
* OracleDataAdapter_GetFillParameters.cs: Ignore tests when not
compiled for JVM. Fixes buildbot test failure.
2006-10-19 Leszek Ciesielski <skolima@gmail.com>
* OracleDataAdapter_RowUpdating.cs:
* OracleDataAdapter_Update_Dr.cs:
* OracleDataAdapter_RowUpdated.cs: Removed attribute NotWorking
2006-10-17 Leszek Ciesielski <skolima@gmail.com>
* OracleDataAdapter_RowUpdating.cs:
* OracleDataAdapter_Update_Dr.cs:
* OracleDataAdapter_Update_Dt.cs:
* OracleDataAdapter_RowUpdated.cs:
* OracleDataAdapter_Update_DsStr.cs:
* OracleDataAdapter_Update_Ds.cs: Set attribute NotWorking

View File

@ -0,0 +1,80 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_AcceptChangesDuringFill : ADONetTesterClass
{
public static void Main()
{
OracleDataAdapter_AcceptChangesDuringFill tc = new OracleDataAdapter_AcceptChangesDuringFill();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_AcceptChangesDuringFill");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
public void run()
{
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand("",new OracleConnection());
DataAdapter_AcceptChangesDuringFill((DbDataAdapter)oleDBda);
}
}
}

View File

@ -0,0 +1,80 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_ContinueUpdateOnError : ADONetTesterClass
{
public static void Main()
{
OracleDataAdapter_ContinueUpdateOnError tc = new OracleDataAdapter_ContinueUpdateOnError();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_ContinueUpdateOnError");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
public void run()
{
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand("",new OracleConnection());
base.DataAdapter_ContinueUpdateOnError((DbDataAdapter)oleDBda);
}
}
}

View File

@ -0,0 +1,92 @@
//
// 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 OracleDataAdapter_DeleteCommand : GHTBase
{
public static void Main()
{
OracleDataAdapter_DeleteCommand tc = new OracleDataAdapter_DeleteCommand();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_DeleteCommand");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
public void run()
{
Exception exp = null;
OracleDataAdapter oleDBda = new OracleDataAdapter();
OracleCommand Cmd = new OracleCommand();
oleDBda.DeleteCommand = Cmd;
try
{
BeginCase("DeleteCommand - Get");
Compare(oleDBda.DeleteCommand , Cmd);
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
}
}
}

View File

@ -0,0 +1,225 @@
//
// 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 OracleDataAdapter_Dispose : GHTBase
{
OracleConnection con;
OracleCommand cmdSelect;
OracleCommand cmdDelete;
OracleCommand cmdUpdate;
OracleCommand cmdInsert;
[SetUp]
public void SetUp() {
string sqlSelect = "Select * from Customers where CustomerID = 'ABC'";
con = new OracleConnection(MonoTests.System.Data.Utils.ConnectedDataProvider.ConnectionString);
cmdSelect = new OracleCommand(sqlSelect,con);
cmdDelete = new OracleCommand("",con);
cmdUpdate = new OracleCommand("",con);
cmdInsert = null;
con.Open();
}
[TearDown]
public void TearDown() {
if (con != null && con.State == ConnectionState.Open) con.Close();
}
public static void Main()
{
OracleDataAdapter_Dispose tc = new OracleDataAdapter_Dispose();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_Dispose");
tc.SetUp();
tc.run();
tc.TearDown();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
public void run()
{
Exception exp = null;
DataSet ds = new DataSet();
OracleDataAdapter da = new OracleDataAdapter(cmdSelect);
da.DeleteCommand = cmdDelete;
da.UpdateCommand = cmdUpdate;
da.InsertCommand = new OracleCommand("",con);
cmdInsert = da.InsertCommand;
da.Fill(ds);
try
{
BeginCase("Dispose - check DataAdapter select command");
da.Dispose();
Compare(da.SelectCommand == null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
try
{
BeginCase("Dispose - check DataAdapter insert command");
Compare(da.InsertCommand == null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
try
{
BeginCase("Dispose - check DataAdapter Delete Command");
Compare(da.DeleteCommand == null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
try
{
BeginCase("Dispose - check DataAdapter update command");
Compare(da.UpdateCommand == null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
try
{
BeginCase("Dispose - check select command object");
Compare(cmdSelect != null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
try
{
BeginCase("Dispose - check delete command object");
Compare(cmdDelete != null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
try
{
BeginCase("Dispose - check insert command object");
Compare(cmdInsert != null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
try
{
BeginCase("Dispose - check Update command object");
Compare(cmdUpdate != null, true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
try
{
BeginCase("Dispose - check cmdSelect.connection object");
Compare(cmdSelect.Connection != null ,true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
try
{
BeginCase("Dispose - check cmdDelete.connection object");
Compare(cmdDelete.Connection != null ,true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
try
{
BeginCase("Dispose - check cmdUpdate.connection object");
Compare(cmdUpdate.Connection != null ,true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
try
{
BeginCase("Dispose - check cmdInsert.connection object");
Compare(cmdInsert.Connection != null ,true);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
try
{
BeginCase("Dispose - check command connection state");
da.Dispose();
Compare(cmdSelect.Connection.State ,ConnectionState.Open);
}
catch(Exception ex){exp = ex;}
finally{EndCase(exp);exp = null;}
}
}
}

View File

@ -0,0 +1,81 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_FillError : ADONetTesterClass
{
public static void Main()
{
OracleDataAdapter_FillError tc = new OracleDataAdapter_FillError();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_FillError");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
public void run()
{
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand("",new OracleConnection());
base.DbDataAdapter_FillError((DbDataAdapter)oleDBda);
}
}
}

View File

@ -0,0 +1,85 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_FillSchema_DS : ADONetTesterClass
{
public static void Main()
{
OracleDataAdapter_FillSchema_DS tc = new OracleDataAdapter_FillSchema_DS();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_FillSchema_DS");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
#if JAVA
[Category("NotWorking")]
#endif
public void run()
{
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand("",new OracleConnection());
base.DbDataAdapter_FillSchema_Ds_SchemaType((DbDataAdapter)oleDBda);
}
}
}

View File

@ -0,0 +1,85 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_FillSchema_DSS : ADONetTesterClass
{
public static void Main()
{
OracleDataAdapter_FillSchema_DSS tc = new OracleDataAdapter_FillSchema_DSS();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_FillSchema_DSS");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
#if JAVA
[Category("NotWorking")]
#endif
public void run()
{
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand("",new OracleConnection());
base.DbDataAdapter_FillSchema_Ds_SchemaType_Str((DbDataAdapter)oleDBda);
}
}
}

View File

@ -0,0 +1,114 @@
//
// 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.Text;
using System.Data;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_FillSchema_DsSt : ADONetTesterClass
{
private Exception exp;
private string connectionString;
public static void Main()
{
OracleDataAdapter_FillSchema_DsSt tc = new OracleDataAdapter_FillSchema_DsSt();
Exception l_exp = null;
try {
tc.SetUp ();
// Every Test must begin with BeginTest
tc.BeginTest("OracleDataAdapter_FillSchema_DsSt");
tc.run();
} catch(Exception ex) {
l_exp = ex;
} finally {
// Every Test must End with EndTest
tc.EndTest(l_exp);
}
}
[SetUp]
public void SetUp ()
{
connectionString = ConnectedDataProvider.ConnectionString;
}
public void run()
{
TestLongSqlExpression();
}
//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)");
StringBuilder querySb = new StringBuilder();
querySb.Append("SELECT ");
querySb.Append("c.CustomerID as ci1, c.CustomerID as ci2, c.CustomerID as ci3, c.CustomerID as ci4, ");
querySb.Append("c.CompanyName as cn1, c.CompanyName as cn2, c.CompanyName as cn3, c.CompanyName as cn4, ");
querySb.Append("c.ContactName as cntn1, c.ContactName as cntn2, c.ContactName as cntn3, c.ContactName as cntn4, ");
querySb.Append("c.ContactTitle as ct1, c.ContactTitle as ct2, c.ContactTitle as ct3, c.ContactTitle as ct4, ");
querySb.Append("c.Address as ad1, c.Address as ad2, c.Address as ad3, c.Address as ad4, ");
querySb.Append("c.City as ct1, c.City as ct2, c.City as ct3, c.City as ct4, ");
querySb.Append("c.Region as rg1, c.Region as rg2, c.Region as rg3, c.Region as rg4, ");
querySb.Append("c.PostalCode as pc1, c.PostalCode as pc2, c.PostalCode as pc3, c.PostalCode as pc4, ");
querySb.Append("c.Country as co1, c.Country as co2, c.Country as co3, c.Country as co4, ");
querySb.Append("c.Phone as ph1, c.Phone as ph2, c.Phone as ph3, c.Phone as ph4, ");
querySb.Append("c.Fax as fx1, c.Fax as fx2, c.Fax as fx3, c.Fax as fx4 ");
querySb.Append("FROM Customers c");
OracleDataAdapter adapter = null;
DataSet schemaDs = new DataSet();
try
{
using(adapter = new OracleDataAdapter(querySb.ToString(), this.connectionString))
{
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
adapter.FillSchema(schemaDs, SchemaType.Source);
Compare(schemaDs.Tables.Count, 1);
}
}
catch(Exception ex)
{
exp = ex;
}
finally
{
EndCase(exp);
exp = null;
}
}
}
}

View File

@ -0,0 +1,85 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_FillSchema_DtSch : ADONetTesterClass
{
public static void Main()
{
OracleDataAdapter_FillSchema_DtSch tc = new OracleDataAdapter_FillSchema_DtSch();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_FillSchema_DtSch");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
#if JAVA
[Category("NotWorking")]
#endif
public void run()
{
//Exception exp = null;
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand("",new OracleConnection());
base.DbDataAdapter_FillSchema_Dt_SchemaType((DbDataAdapter)oleDBda);
}
}
}

View File

@ -0,0 +1,197 @@
//
// 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.Text;
using System.Data;
using System.Data.OracleClient ;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_Fill_1: ADONetTesterClass
{
// transaction use was add for PostgreSQL
OracleTransaction tr;
OracleConnection con;
OracleCommand cmd;
[SetUp]
public void SetUp()
{
Exception exp = null;
BeginCase("Setup");
try
{
// prepare data
base.PrepareDataForTesting(MonoTests.System.Data.Utils.ConnectedDataProvider.ConnectionString);
con = new OracleConnection(MonoTests.System.Data.Utils.ConnectedDataProvider.ConnectionString);
con.Open();
// transaction use was add for PostgreSQL
tr = con.BeginTransaction();
cmd = new OracleCommand("", con, tr);
Compare("Setup" ,"Setup");
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
}
[TearDown]
public void TearDown()
{
// transaction use was add for PostgreSQL
if (tr != null)
tr.Commit();
if (con != null)
{
if (con.State == ConnectionState.Open) con.Close();
}
}
public static void Main()
{
OracleDataAdapter_Fill_1 tc = new OracleDataAdapter_Fill_1();
Exception exp = null;
try
{
// Every Test must begin with BeginTest
tc.BeginTest("OracleDataAdapter_Fill_1");
tc.SetUp();
tc.run();
tc.TearDown();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
// Every Test must End with EndTest
tc.EndTest(exp);
}
}
[Test]
public void run()
{
Exception exp = null;
#if !JAVA
if (ConnectedDataProvider.GetDbType(con) == DataBaseServer.Oracle)
{
StringBuilder messageBuilder = new StringBuilder();
messageBuilder.Append("Test \"OracleDataAdapter_Fill_1\" Skipped when running in .NET against Oracle database:\n");
messageBuilder.Append("In .NET there is a bug when calling a SP with multiple REFCURSORS from oracle server, the workaround is to use OracleClient and not Oracle.\n");
messageBuilder.Append("In GH we are not bug complient in this issue, because there is no workaround - We do not support the OracleClient namespace.");
messageBuilder.Append(" (The java run is not skipped).");
Log(messageBuilder.ToString());
return;
}
if (ConnectedDataProvider.GetDbType(con) == DataBaseServer.PostgreSQL)
{
// fail to work on .NET OLEDB
this.Log("Not testing PostgreSQL CommandType.StoredProcedure which return SETOF");
return;
}
#endif
cmd.CommandText = "GH_MULTIRECORDSETS";
cmd.Parameters.Add(new OracleParameter("RCT_Employees", OracleType.Cursor)).Direction = ParameterDirection.Output;
cmd.Parameters.Add(new OracleParameter("RCT_Customers", OracleType.Cursor)).Direction = ParameterDirection.Output;
cmd.Parameters.Add(new OracleParameter("RCT_Orders", OracleType.Cursor)).Direction = ParameterDirection.Output;
cmd.CommandType = CommandType.StoredProcedure;
OracleDataAdapter da = new OracleDataAdapter(cmd);
DataSet ds = new DataSet();
//execute the fill command
da.Fill(ds);
try
{
BeginCase("Check table count");
Compare(ds.Tables.Count ,3);
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
try
{
BeginCase("Check table 0 rows count");
Compare(ds.Tables[0].Rows.Count ,2);
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
try
{
BeginCase("Check table 0 Columns count");
Compare(ds.Tables[0].Columns.Count ,2);
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
try
{
BeginCase("Check table 1 rows count");
Compare(ds.Tables[1].Rows.Count ,2);
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
try
{
BeginCase("Check table 1 Columns count");
Compare(ds.Tables[1].Columns.Count ,3);
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
try
{
BeginCase("Check table 2 rows count");
Compare(ds.Tables[2].Rows.Count ,0);
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
try
{
BeginCase("Check table 2 Columns count");
Compare(ds.Tables[2].Columns.Count ,4);
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
}
}
}

View File

@ -0,0 +1,139 @@
//
// 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 OracleDataAdapter_Fill_3: ADONetTesterClass
{
public static void Main()
{
OracleDataAdapter_Fill_3 tc = new OracleDataAdapter_Fill_3();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_Fill_3");
tc.run();
}
catch(Exception ex){exp = ex;}
finally {tc.EndTest(exp);}
}
[Test]
public void run()
{
Exception exp = null;
//in DB2 when trying to fill an empty table - no table is loaded
OracleConnection conn = new OracleConnection(MonoTests.System.Data.Utils.ConnectedDataProvider.ConnectionString);
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand("Select * from GH_EMPTYTABLE",conn);
DataSet ds = new DataSet();
oleDBda.Fill(ds);
try
{
BeginCase("Table count - fill with SP");
Compare(ds.Tables.Count ,1 );
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
//add for bug #2508 - OLEDBDataAdapter.Fill fills only the 1st result set, reported from an evaluation
if (ConnectedDataProvider.GetDbType(oleDBda.SelectCommand.Connection) == DataBaseServer.SQLServer)
//multiple commands can not be done with Oracle or DB2
{
//get excpected results
if (oleDBda.SelectCommand.Connection.State != ConnectionState.Open)
{
oleDBda.SelectCommand.Connection.Open();
}
OracleCommand cmd = new OracleCommand("",oleDBda.SelectCommand.Connection);
cmd.CommandText = "Select count(*) from Customers";
int TblResult0 = (int)cmd.ExecuteScalar();
cmd.CommandText = "Select count(*) from Categories";
int TblResult1 = (int)cmd.ExecuteScalar();
cmd.CommandText = "Select count(*) from Region";
int TblResult2 = (int)cmd.ExecuteScalar();
if (oleDBda.SelectCommand.Connection.State != ConnectionState.Closed)
{
oleDBda.SelectCommand.Connection.Close();
}
oleDBda.SelectCommand.CommandText = "Select * from Customers; " +
"Select * from Categories; " +
"Select * from Region";
ds = new DataSet();
oleDBda.Fill(ds);
try
{
BeginCase("Table count - Fill with query");
Compare(ds.Tables.Count ,3 );
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
try
{
BeginCase("Table 0 rows count");
Compare(ds.Tables[0].Rows.Count ,TblResult0 );
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
try
{
BeginCase("Table 1 rows count");
Compare(ds.Tables[1].Rows.Count ,TblResult1 );
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
try
{
BeginCase("Table 2 rows count");
Compare(ds.Tables[2].Rows.Count ,TblResult2 );
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
}
}
}
}

View File

@ -0,0 +1,90 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_Fill_Ds : ADONetTesterClass
{
[SetUp]
public void SetUp()
{
Exception exp = null;
BeginCase("Setup");
try
{
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
}
[TearDown]
public void TearDown()
{
}
public static void Main()
{
OracleDataAdapter_Fill_Ds tc = new OracleDataAdapter_Fill_Ds();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_Fill_Ds");
tc.SetUp();
tc.run();
tc.TearDown();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
[Test]
#if JAVA
[Category("NotWorking")]
#endif
public void run()
{
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand("",new OracleConnection());
base.DbDataAdapter_Fill_Ds((DbDataAdapter)oleDBda);
}
}
}

View File

@ -0,0 +1,84 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_Fill_DsStr : ADONetTesterClass
{
public static void Main()
{
OracleDataAdapter_Fill_DsStr tc = new OracleDataAdapter_Fill_DsStr();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_Fill_DsStr");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
#if JAVA
[Category("NotWorking")]
#endif
public void run()
{
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand("",new OracleConnection());
base.DbDataAdapter_Fill_Ds_Str((DbDataAdapter)oleDBda);
}
}
}

View File

@ -0,0 +1,85 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_Fill_Ds_Int_Int_Str : ADONetTesterClass
{
public static void Main()
{
OracleDataAdapter_Fill_Ds_Int_Int_Str tc = new OracleDataAdapter_Fill_Ds_Int_Int_Str();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_Fill_DIIS");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
#if JAVA
[Category("NotWorking")]
#endif
public void run()
{
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand("",new OracleConnection());
base.DbDataAdapter_Fill_Ds_Int_Int_Str((DbDataAdapter)oleDBda);
}
}
}

View File

@ -0,0 +1,85 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_Fill_Dt : ADONetTesterClass
{
public static void Main()
{
OracleDataAdapter_Fill_Dt tc = new OracleDataAdapter_Fill_Dt();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_Fill_Dt");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
#if JAVA
[Category("NotWorking")]
#endif
public void run()
{
//Exception exp = null;
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand("",new OracleConnection());
base.DbDataAdapter_Fill_Dt((DbDataAdapter)oleDBda);
}
}
}

View File

@ -0,0 +1,119 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_GetFillParameters : GHTBase
{
public static void Main()
{
OracleDataAdapter_GetFillParameters tc = new OracleDataAdapter_GetFillParameters();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_GetFillParameters");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
#if !TARGET_JVM
[Ignore ("JVM test")]
#endif
public void run()
{
Exception exp = null;
string selectSQL = "SELECT * FROM Employees WHERE EmployeeId = ? AND FirstName = ?";
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand(selectSQL,new OracleConnection());
IDataParameter[] Idp = oleDBda.GetFillParameters();
try
{
BeginCase("Length");
Compare(Idp.Length ,0);
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
oleDBda.SelectCommand.Parameters.Add(new OracleParameter("@EmployeeId",DbType.Int32)) ;
oleDBda.SelectCommand.Parameters["@EmployeeId"].SourceColumn = "EmployeeId";
oleDBda.SelectCommand.Parameters.Add(new OracleParameter("@FirstName",OracleType.VarChar,10));
Idp = oleDBda.GetFillParameters();
try
{
BeginCase("Parameter 0");
Compare(Idp[0] ,oleDBda.SelectCommand.Parameters[0]);
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
try
{
BeginCase("Parameter 1");
Compare(Idp[1] ,oleDBda.SelectCommand.Parameters[1]);
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
}
}
}

View File

@ -0,0 +1,92 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_InsertCommand : GHTBase
{
public static void Main()
{
OracleDataAdapter_InsertCommand tc = new OracleDataAdapter_InsertCommand();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_InsertCommand");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
public void run()
{
Exception exp = null;
OracleDataAdapter oleDBda = new OracleDataAdapter();
OracleCommand Cmd = new OracleCommand();
oleDBda.InsertCommand = Cmd;
try
{
BeginCase("InsertCommand - Get");
Compare(oleDBda.InsertCommand, Cmd);
}
catch(Exception ex) {exp = ex;}
finally {EndCase(exp); exp = null;}
}
}
}

View File

@ -0,0 +1,81 @@
//
// 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.Common;
using System.Data.OracleClient;
using MonoTests.System.Data.Utils;
using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
public class OracleDataAdapter_MissingMappingAction : ADONetTesterClass
{
public static void Main()
{
OracleDataAdapter_MissingMappingAction tc = new OracleDataAdapter_MissingMappingAction();
Exception exp = null;
try
{
tc.BeginTest("OracleDataAdapter_MissingMappingAction");
tc.run();
}
catch(Exception ex)
{
exp = ex;
}
finally
{
tc.EndTest(exp);
}
}
//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
[Test]
public void run()
{
OracleDataAdapter oleDBda = new OracleDataAdapter();
oleDBda.SelectCommand = new OracleCommand("",new OracleConnection());
base.DataAdapter_MissingMappingAction((DbDataAdapter)oleDBda);
}
}
}

Some files were not shown because too many files have changed in this diff Show More