public override void Run(object context)
        {
            DbController dbc = new DbController(Connection);

            try
            {
                String schemaName = DbHelper.GetRandomString(10);
                DbDefault.CreateDB(schemaName, DbCreateType.PKPartition);

                foreach (TableName tname in Enum.GetValues(typeof(TableName)))
                {
                    Command.CommandText = DbDefault.GetSelectCountStatement(schemaName, tname);
                    if (Convert.ToInt32(Command.ExecuteScalar()) < 1)
                    {
                        Fail(String.Format("Failed to create table {0}.{1}", schemaName, tname.ToString()));
                    }
                }

                DbDefault.DropDB(schemaName);
            }
            catch (Exception e)
            {
                Fail(e);
            }
            finally
            {
                base.Run(context);
            }
        }
        public override void Run(object context)
        {
            String schemaName = DbHelper.GetRandomString(10);

            try
            {
                DbDefault.CreateDB(schemaName, DbCreateType.Basic);

                try
                {
                    Command.CommandText = "DROP SCHEMA " + schemaName + " RESTRICT";
                    Command.ExecuteNonQuery();

                    Fail("Expected exception when schema is dropped");
                }
                catch (GFXDException e)
                {
                    Log(e);
                }
            }
            catch (Exception e)
            {
                Fail(e);
            }
            finally
            {
                DbDefault.DropDB(schemaName);
                Command.CommandText = "DROP SCHEMA " + schemaName + " RESTRICT";
                base.Run(context);
            }
        }
Пример #3
0
        public override void Run(object context)
        {
            String schemaName = DbHelper.GetRandomString(5);

            try
            {
                DbDefault.CreateDB(schemaName, DbCreateType.Basic);
                Command.CommandText = DbDefault.GetInnerJoinSelectStatement(
                    schemaName, Relation.ORDER_CUSTOMER, null);
                DataTable dt = new DataTable();
                Log(Command.CommandText);
                DataAdapter.Fill(dt);

                if (dt.Rows.Count <= 0)
                {
                    Fail("Failed to perform join query");
                }
            }
            catch (Exception e)
            {
                Fail(e);
            }
            finally
            {
                try
                {
                    DbDefault.DropDB(schemaName);
                }
                catch (Exception e)
                {
                    Log(e);
                }

                base.Run(context);
            }
        }
Пример #4
0
        public override void Run(object context)
        {
            String schemaName = "ADONETTEST";

            try
            {
                DbDefault.CreateDB(schemaName, DbCreateType.PKPartition);

                DbController dbc = new DbController(Connection, schemaName);

                IList <Address> objList1 = dbc.GetAddresses();
                foreach (Address obj in objList1)
                {
                    Log(obj.ToString());
                }

                IList <Supplier> objList2 = dbc.GetSuppliers();
                foreach (Supplier obj in objList2)
                {
                    Log(obj.ToString());
                }

                IList <Category> objList3 = dbc.GetCategories();
                foreach (Category obj in objList3)
                {
                    Log(obj.ToString());
                }

                IList <Product> objList4 = dbc.GetProducts();
                foreach (Product obj in objList4)
                {
                    Log(obj.ToString());
                }

                IList <Customer> objList5 = dbc.GetCustomers();
                foreach (Customer obj in objList5)
                {
                    Log(obj.ToString());
                }

                IList <Order> objList6 = dbc.GetOrders();
                foreach (Order obj in objList6)
                {
                    Log(obj.ToString());
                }

                IList <OrderDetail> objList7 = dbc.GetOrderDetails();
                foreach (OrderDetail obj in objList7)
                {
                    Log(obj.ToString());
                }
            }
            catch (Exception e)
            {
                Fail(e);
            }
            finally
            {
                DbDefault.DropDB(schemaName);
                base.Run(context);
            }
        }