public void BinaryDumpLoadIdxRebuild()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            // create .df
            var dfPath = Path.Combine(TestFolder, "bindb.df");

            File.WriteAllText(dfPath, "ADD TABLE \"table1\"\n  AREA \"Schema Area\"\n  DESCRIPTION \"table one\"\n  DUMP-NAME \"table1\"\n\nADD FIELD \"field1\" OF \"table1\" AS character \n  DESCRIPTION \"field one\"\n  FORMAT \"x(8)\"\n  INITIAL \"\"\n  POSITION 2\n  MAX-WIDTH 16\n  ORDER 10\n\nADD FIELD \"field2\" OF \"table1\" AS integer \n  DESCRIPTION \"field two\"\n  FORMAT \"9\"\n  INITIAL 0\n  POSITION 3\n  ORDER 20\n");

            using (var dataAdmin = new UoeDatabaseAdministrator(dlcPath)) {
                var db = GetDb("dumploadbin");
                dataAdmin.CreateWithDf(db, dfPath);

                var dataDirectory = Path.Combine(TestFolder, "bindb_data");
                Directory.CreateDirectory(dataDirectory);
                try {
                    var table1Path = Path.Combine(dataDirectory, "table1.d");
                    // load data from .d
                    File.WriteAllText(table1Path, "\"value1\" 1\n\"value2\" 2\n");
                    dataAdmin.LoadData(dataAdmin.GetDatabaseConnection(db), dataDirectory);
                    File.Delete(table1Path);

                    // dump binary
                    dataAdmin.DumpBinaryData(db, "table1", dataDirectory);
                    var binDataFilePath = Path.Combine(dataDirectory, "table1.bd");
                    Assert.IsTrue(File.Exists(binDataFilePath));

                    // recreate db
                    dataAdmin.Delete(db);
                    dataAdmin.CreateWithDf(db, dfPath);

                    // load binary
                    dataAdmin.LoadBinaryData(db, binDataFilePath);

                    // re-rebuild index
                    dataAdmin.RebuildIndexes(db, new UoeProcessArgs().Append("table", "table1") as UoeProcessArgs);

                    // dump data .d
                    dataAdmin.DumpData(dataAdmin.GetDatabaseConnection(db), dataDirectory, "table1");
                    Assert.IsTrue(File.Exists(table1Path));
                    var dataContent = File.ReadAllText(table1Path);
                    Assert.IsTrue(dataContent.Contains("\"value1\" 1"));

                    // truncate table
                    dataAdmin.TruncateTableData(dataAdmin.GetDatabaseConnection(db), "table1");

                    // dump empty data .d
                    dataAdmin.DumpData(dataAdmin.GetDatabaseConnection(db), dataDirectory, "table1");
                    Assert.IsFalse(File.ReadAllText(table1Path).Contains("\"value1\" 1"));
                } finally {
                    Directory.Delete(dataDirectory, true);
                }
            }
        }
예제 #2
0
        public void Sql()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            // create .df
            var dfPath = Path.Combine(TestFolder, "sql.df");

            File.WriteAllText(dfPath, "ADD TABLE \"table1\"\n  AREA \"Schema Area\"\n  DESCRIPTION \"table one\"\n  DUMP-NAME \"table1\"\n\nADD FIELD \"field1\" OF \"table1\" AS character \n  DESCRIPTION \"field one\"\n  FORMAT \"x(8)\"\n  INITIAL \"\"\n  POSITION 2\n  MAX-WIDTH 16\n  ORDER 10\n\nADD FIELD \"field2\" OF \"table1\" AS integer \n  DESCRIPTION \"field two\"\n  FORMAT \"9\"\n  INITIAL 0\n  POSITION 3\n  ORDER 20\n");

            using (var dataAdmin = new UoeDatabaseAdministrator(dlcPath)) {
                var db = GetDb("sql");
                dataAdmin.CreateWithDf(db, dfPath);

                var dbConnect = dataAdmin.GetDatabaseConnection(db);

                // load sql
                var table1Path = Path.Combine(TestFolder, "PUB.table1.dsql");
                File.WriteAllText(table1Path, "\"value1\" 1\n\"value2\" 2\n");
                dataAdmin.LoadSqlData(dbConnect, TestFolder);
                File.Delete(table1Path);

                // dump sql
                dataAdmin.DumpSqlData(dbConnect, TestFolder);
                Assert.IsTrue(File.Exists(table1Path));
            }
        }
예제 #3
0
        public void SequenceData()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var db = GetDb("seqdata");

            // create .df
            var dfPath = Path.Combine(TestFolder, "seqdata.df");

            File.WriteAllText(dfPath, "ADD SEQUENCE \"sequence1\"\n  INITIAL 0\n  INCREMENT 1\n  CYCLE-ON-LIMIT no\n\nADD SEQUENCE \"sequence2\"\n  INITIAL 0\n  INCREMENT 1\n  CYCLE-ON-LIMIT no\n");

            using (var dataAdmin = new UoeDatabaseAdministrator(dlcPath)) {
                dataAdmin.CreateWithDf(db, dfPath);

                var sequenceDataFilePath = Path.Combine(TestFolder, $"{db.PhysicalName}.d");

                // load seq
                File.WriteAllText(sequenceDataFilePath, "0 \"sequence1\" 20\n");
                dataAdmin.LoadSequenceData(dataAdmin.GetDatabaseConnection(db), sequenceDataFilePath);

                // dump seq
                File.Delete(sequenceDataFilePath);
                dataAdmin.DumpSequenceData(dataAdmin.GetDatabaseConnection(db), sequenceDataFilePath);

                Assert.IsTrue(File.Exists(sequenceDataFilePath));
                var dataContent = File.ReadAllText(sequenceDataFilePath);
                Assert.IsTrue(dataContent.Contains("\"sequence1\" 20"));
                Assert.IsTrue(dataContent.Contains("\"sequence2\" 0"));
            }
        }
예제 #4
0
        public void DumpDf()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var db     = GetDb("dumpdf");
            var dfPath = Path.Combine(TestFolder, $"{db.PhysicalName}.df");

            // create .df
            File.WriteAllText(dfPath, "ADD SEQUENCE \"sequence1\"\n  INITIAL 0\n  INCREMENT 1\n  CYCLE-ON-LIMIT no\n\nADD TABLE \"table1\"\n  AREA \"Schema Area\"\n  DESCRIPTION \"table one\"\n  DUMP-NAME \"table1\"\n\nADD FIELD \"field1\" OF \"table1\" AS character \n  DESCRIPTION \"field one\"\n  FORMAT \"x(8)\"\n  INITIAL \"\"\n  POSITION 2\n  MAX-WIDTH 16\n  ORDER 10\n\nADD INDEX \"idx_1\" ON \"table1\" \n  AREA \"Schema Area\"\n  PRIMARY\n  INDEX-FIELD \"field1\" ASCENDING\n");

            using (var dataAdmin = new UoeDatabaseAdministrator(dlcPath)) {
                dataAdmin.CreateWithDf(db, dfPath);

                var dfPathOut = Path.Combine(TestFolder, "dumpdf_out.df");
                dataAdmin.DumpSchemaDefinition(UoeDatabaseConnection.NewSingleUserConnection(db), dfPathOut);

                Assert.IsTrue(File.Exists(dfPathOut));
                Assert.IsTrue(File.ReadAllText(dfPathOut).Contains("field1"));

                var dumpOut = Path.Combine(TestFolder, "dump_custom.txt");
                dataAdmin.DumpCustomInfoExtraction(UoeDatabaseConnection.NewSingleUserConnection(db), dumpOut);

                Assert.IsTrue(File.Exists(dumpOut));
                Assert.IsTrue(File.ReadAllText(dumpOut).Contains("field1"));
            }
        }
예제 #5
0
 public static void CreateDatabaseFromDf(string targetDatabasePath, string dfPath)
 {
     if (!GetDlcPath(out string dlcPath))
     {
         return;
     }
     using (var dbAdministrator = new UoeDatabaseAdministrator(dlcPath)) {
         dbAdministrator.CreateWithDf(new UoeDatabaseLocation(targetDatabasePath), dfPath);
     }
 }
        public void OeExecutionDbExtractTableAndSequenceListTest_Dump_db()
        {
            if (!GetEnvExecution(out UoeExecutionEnv env))
            {
                return;
            }

            var base1Db = new UoeDatabaseLocation(Path.Combine(TestFolder, "base1.db"));
            var base2Db = new UoeDatabaseLocation(Path.Combine(TestFolder, "base2.db"));

            if (!base1Db.Exists())
            {
                var dfPath = Path.Combine(TestFolder, "base1.df");
                File.WriteAllText(dfPath, "ADD SEQUENCE \"sequence1\"\n  INITIAL 0\n  INCREMENT 1\n  CYCLE-ON-LIMIT no\n\nADD TABLE \"table1\"\n  AREA \"Schema Area\"\n  DESCRIPTION \"table one\"\n  DUMP-NAME \"table1\"\n\nADD FIELD \"field1\" OF \"table1\" AS character \n  DESCRIPTION \"field one\"\n  FORMAT \"x(8)\"\n  INITIAL \"\"\n  POSITION 2\n  MAX-WIDTH 16\n  ORDER 10\n\nADD INDEX \"idx_1\" ON \"table1\" \n  AREA \"Schema Area\"\n  PRIMARY\n  INDEX-FIELD \"field1\" ASCENDING");
                using (var dbAdministrator = new UoeDatabaseAdministrator(env.DlcDirectoryPath)) {
                    dbAdministrator.CreateWithDf(base1Db, dfPath);
                    dbAdministrator.CreateWithDf(base2Db, dfPath);
                }
            }

            env.DatabaseConnections = new [] { UoeDatabaseConnection.NewSingleUserConnection(base1Db), UoeDatabaseConnection.NewSingleUserConnection(base2Db) };
            env.DatabaseAliases     = new List <IUoeExecutionDatabaseAlias> {
                new UoeExecutionDatabaseAlias {
                    DatabaseLogicalName = "base1",
                    AliasLogicalName    = "alias1"
                }
            };

            using (var exec = new UoeExecutionDbExtractTableCrcAndSequenceList(env)) {
                exec.ExecuteNoWait();
                exec.WaitForExit();
                Assert.IsFalse(exec.ExecutionHandledExceptions, "ExecutionHandledExceptions");
                Assert.IsFalse(exec.DatabaseConnectionFailed, "DbConnectionFailed");

                Assert.AreEqual("base1.sequence1,alias1.sequence1,base2.sequence1", string.Join(",", exec.Sequences), "sequences");
                Assert.AreEqual("base1.table1,alias1.table1,base1._Sequence,alias1._Sequence,base2.table1,base2._Sequence", string.Join(",", exec.TablesCrc.Keys), "tables");
            }
            env.Dispose();
        }
예제 #7
0
        public void Execute()
        {
            if (!GetEnvExecution(out UoeExecutionEnv env))
            {
                return;
            }

            var base1Db = new UoeDatabaseLocation(Path.Combine(TestFolder, "base1.db"));
            var base2Db = new UoeDatabaseLocation(Path.Combine(TestFolder, "base2.db"));

            var beforeSchemaLoad = DateTime.Now;

            if (!base1Db.Exists())
            {
                var dfPath = Path.Combine(TestFolder, "base1.df");
                File.WriteAllText(dfPath, "ADD SEQUENCE \"sequence1\"\n  INITIAL 0\n  INCREMENT 1\n  CYCLE-ON-LIMIT no\n\nADD TABLE \"table1\"\n  AREA \"Schema Area\"\n  DESCRIPTION \"table one\"\n  DUMP-NAME \"table1\"\n\nADD FIELD \"field1\" OF \"table1\" AS character \n  DESCRIPTION \"field one\"\n  FORMAT \"x(8)\"\n  INITIAL \"\"\n  POSITION 2\n  MAX-WIDTH 16\n  ORDER 10\n\nADD INDEX \"idx_1\" ON \"table1\" \n  AREA \"Schema Area\"\n  PRIMARY\n  INDEX-FIELD \"field1\" ASCENDING");
                using (var dbAdministrator = new UoeDatabaseAdministrator(env.DlcDirectoryPath)) {
                    dbAdministrator.CreateWithDf(base1Db, dfPath);
                    dbAdministrator.CreateWithDf(base2Db, dfPath);
                }
            }

            var afterSchemaLoad = DateTime.Now;

            env.DatabaseConnections = new [] { UoeDatabaseConnection.NewSingleUserConnection(base1Db), UoeDatabaseConnection.NewSingleUserConnection(base2Db) };

            using (var exec = new UoeExecutionDbExtractLastSchemaUpdate(env)) {
                exec.ExecuteNoWait();
                exec.WaitForExit();
                Assert.IsFalse(exec.ExecutionHandledExceptions, "ExecutionHandledExceptions");
                Assert.IsFalse(exec.DatabaseConnectionFailed, "DbConnectionFailed");

                Assert.AreEqual(2, exec.LastSchemaUpdates.Count);
                Assert.IsTrue(beforeSchemaLoad.CompareTo(exec.LastSchemaUpdates["base1"]) < 0, $"{beforeSchemaLoad} > {exec.LastSchemaUpdates["base1"]}");
                Assert.IsTrue(afterSchemaLoad.CompareTo(exec.LastSchemaUpdates["base1"]) > 0, $"{exec.LastSchemaUpdates["base1"]} > {afterSchemaLoad}");
            }
            env.Dispose();
        }
예제 #8
0
        public void CreateDatabase()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var db     = GetDb("createdf");
            var dfPath = Path.Combine(TestFolder, $"{db.PhysicalName}.df");

            // create .df
            File.WriteAllText(dfPath, "ADD SEQUENCE \"sequence1\"\n  INITIAL 0\n  INCREMENT 1\n  CYCLE-ON-LIMIT no\n\nADD TABLE \"table1\"\n  AREA \"Schema Area\"\n  DESCRIPTION \"table one\"\n  DUMP-NAME \"table1\"\n\nADD FIELD \"field1\" OF \"table1\" AS character \n  DESCRIPTION \"field one\"\n  FORMAT \"x(8)\"\n  INITIAL \"\"\n  POSITION 2\n  MAX-WIDTH 16\n  ORDER 10\n\nADD INDEX \"idx_1\" ON \"table1\" \n  AREA \"Schema Area\"\n  PRIMARY\n  INDEX-FIELD \"field1\" ASCENDING\n");

            using (var dataAdmin = new UoeDatabaseAdministrator(dlcPath)) {
                dataAdmin.CreateWithDf(db, dfPath);
                Assert.IsTrue(db.Exists());
            }
        }
예제 #9
0
        public void Data()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var db = GetDb("datad");

            // create .df
            var dfPath = Path.Combine(TestFolder, "data.df");

            File.WriteAllText(dfPath, "ADD TABLE \"table1\"\n  AREA \"Schema Area\"\n  DESCRIPTION \"table one\"\n  DUMP-NAME \"table1\"\n\nADD FIELD \"field1\" OF \"table1\" AS character \n  DESCRIPTION \"field one\"\n  FORMAT \"x(8)\"\n  INITIAL \"\"\n  POSITION 2\n  MAX-WIDTH 16\n  ORDER 10\n\nADD FIELD \"field2\" OF \"table1\" AS integer \n  DESCRIPTION \"field two\"\n  FORMAT \"9\"\n  INITIAL 0\n  POSITION 3\n  ORDER 20\n");

            using (var dataAdmin = new UoeDatabaseAdministrator(dlcPath)) {
                dataAdmin.CreateWithDf(db, dfPath);

                var dataDirectory = Path.Combine(TestFolder, "data");
                Directory.CreateDirectory(dataDirectory);
                try {
                    var table1Path = Path.Combine(dataDirectory, "table1.d");
                    // load data
                    File.WriteAllText(table1Path, "\"value1\" 1\n\"value2\" 2\n");
                    dataAdmin.LoadData(dataAdmin.GetDatabaseConnection(db), dataDirectory);

                    // dump seq
                    File.Delete(table1Path);
                    dataAdmin.DumpData(dataAdmin.GetDatabaseConnection(db), dataDirectory);

                    Assert.IsTrue(File.Exists(table1Path));
                    var dataContent = File.ReadAllText(table1Path);
                    Assert.IsTrue(dataContent.Contains("\"value1\" 1"));
                    Assert.IsTrue(dataContent.Contains("\"value2\" 2"));
                } finally {
                    Directory.Delete(dataDirectory, true);
                }
            }
        }
예제 #10
0
        public void Execute()
        {
            if (!GetEnvExecution(out UoeExecutionEnv env))
            {
                return;
            }

            var base1Db = new UoeDatabaseLocation(Path.Combine(TestFolder, "base1.db"));

            if (!base1Db.Exists())
            {
                var dfPath = Path.Combine(TestFolder, "base1.df");
                File.WriteAllBytes(dfPath, Resources.Resources.GetBytesFromResource("Database.complete.df"));
                using (var dbAdministrator = new UoeDatabaseAdministrator(env.DlcDirectoryPath)) {
                    dbAdministrator.CreateWithDf(base1Db, dfPath);
                }
            }

            env.DatabaseConnections = new [] { UoeDatabaseConnection.NewSingleUserConnection(base1Db) };
            using (var exec = new UoeExecutionDbExtractDefinition(env)) {
                exec.ExecuteNoWait();
                exec.WaitForExit();
                Assert.IsFalse(exec.ExecutionHandledExceptions, exec.ExecutionHandledExceptions ? exec.HandledExceptions[0].ToString() : "ok");
                Assert.IsFalse(exec.DatabaseConnectionFailed, "DbConnectionFailed");
                var db = exec.GetDatabases()[0];

                Assert.AreEqual(DatabaseBlockSize.S4096, db.BlockSize);
                Assert.AreEqual("iso8859-1", db.Charset);
                Assert.AreEqual("basic", db.Collation);
                Assert.AreEqual("base1", db.LogicalName);
                Assert.AreEqual("base1", db.PhysicalName);
                Assert.AreEqual(2, db.Sequences.Count);
                Assert.AreEqual(true, db.Sequences[0].CycleOnLimit);
                Assert.AreEqual(2, db.Sequences[0].Increment);
                Assert.AreEqual(20, db.Sequences[0].Initial);
                Assert.AreEqual(200, db.Sequences[0].Max);
                Assert.AreEqual(null, db.Sequences[0].Min);
                Assert.AreEqual("theseq1", db.Sequences[0].Name);
                Assert.AreEqual(2, db.Tables.Count);
                Assert.AreEqual("Data Area", db.Tables[0].Area);
                Assert.AreEqual(5575, db.Tables[0].Crc);
                Assert.AreEqual("thedesc1", db.Tables[0].Description);
                Assert.AreEqual("thedump1", db.Tables[0].DumpName);
                Assert.AreEqual("theforeignname", db.Tables[0].Foreign);
                Assert.AreEqual(false, db.Tables[0].Frozen);
                Assert.AreEqual(false, db.Tables[0].Hidden);
                Assert.AreEqual("thelabel1", db.Tables[0].Label);
                Assert.AreEqual("T", db.Tables[0].LabelAttribute);
                Assert.AreEqual("thetable1", db.Tables[0].Name);
                Assert.AreEqual("thereplication1", db.Tables[0].Replication);
                Assert.AreEqual("false", db.Tables[0].ValidationExpression);
                Assert.AreEqual("not true", db.Tables[0].ValidationMessage);
                Assert.AreEqual("R", db.Tables[0].ValidationMessageAttribute);
                Assert.AreEqual(3, db.Tables[0].Fields.Count);
                Assert.AreEqual(true, db.Tables[0].Fields[0].CaseSensitive);
                Assert.AreEqual(null, db.Tables[0].Fields[0].ClobCharset);
                Assert.AreEqual(null, db.Tables[0].Fields[0].ClobCollation);
                Assert.AreEqual(0, db.Tables[0].Fields[0].ClobType);
                Assert.AreEqual("thecollabel1", db.Tables[0].Fields[0].ColumnLabel);
                Assert.AreEqual("T", db.Tables[0].Fields[0].ColumnLabelAttribute);
                Assert.AreEqual(UoeDatabaseDataType.Character, db.Tables[0].Fields[0].DataType);
                Assert.AreEqual(0, db.Tables[0].Fields[0].Decimals);
                Assert.AreEqual("thedesc1", db.Tables[0].Fields[0].Description);
                Assert.AreEqual(2, db.Tables[0].Fields[0].Extent);
                Assert.AreEqual("x(10)", db.Tables[0].Fields[0].Format);
                Assert.AreEqual("T", db.Tables[0].Fields[0].FormatAttribute);
                Assert.AreEqual("thehelp1", db.Tables[0].Fields[0].Help);
                Assert.AreEqual("T", db.Tables[0].Fields[0].HelpAttribute);
                Assert.AreEqual("theinitial1", db.Tables[0].Fields[0].InitialValue);
                Assert.AreEqual("T", db.Tables[0].Fields[0].InitialValueAttribute);
                Assert.AreEqual("thelabel1", db.Tables[0].Fields[0].Label);
                Assert.AreEqual("T", db.Tables[0].Fields[0].LabelAttribute);
                Assert.AreEqual(null, db.Tables[0].Fields[0].LobArea);
                Assert.AreEqual(0, db.Tables[0].Fields[0].LobBytes);
                Assert.AreEqual(null, db.Tables[0].Fields[0].LobSize);
                Assert.AreEqual(true, db.Tables[0].Fields[0].Mandatory);
                Assert.AreEqual("thefield1", db.Tables[0].Fields[0].Name);
                Assert.AreEqual(10, db.Tables[0].Fields[0].Order);
                Assert.AreEqual(2, db.Tables[0].Fields[0].Position);
                Assert.AreEqual(null, db.Tables[0].Fields[0].Triggers);
                Assert.AreEqual(44, db.Tables[0].Fields[0].Width);
                Assert.AreEqual(false, db.Tables[0].Fields[1].CaseSensitive);
                Assert.AreEqual(null, db.Tables[0].Fields[1].ClobCharset);
                Assert.AreEqual(null, db.Tables[0].Fields[1].ClobCollation);
                Assert.AreEqual(0, db.Tables[0].Fields[1].ClobType);
                Assert.AreEqual(null, db.Tables[0].Fields[1].ColumnLabel);
                Assert.AreEqual(null, db.Tables[0].Fields[1].ColumnLabelAttribute);
                Assert.AreEqual(UoeDatabaseDataType.Integer, db.Tables[0].Fields[1].DataType);
                Assert.AreEqual(0, db.Tables[0].Fields[1].Decimals);
                Assert.AreEqual("", db.Tables[0].Fields[1].Description);
                Assert.AreEqual(0, db.Tables[0].Fields[1].Extent);
                Assert.AreEqual("9999", db.Tables[0].Fields[1].Format);
                Assert.AreEqual(null, db.Tables[0].Fields[1].FormatAttribute);
                Assert.AreEqual("", db.Tables[0].Fields[1].Help);
                Assert.AreEqual("", db.Tables[0].Fields[1].HelpAttribute);
                Assert.AreEqual("0", db.Tables[0].Fields[1].InitialValue);
                Assert.AreEqual(null, db.Tables[0].Fields[1].InitialValueAttribute);
                Assert.AreEqual(null, db.Tables[0].Fields[1].Label);
                Assert.AreEqual(null, db.Tables[0].Fields[1].LabelAttribute);
                Assert.AreEqual(null, db.Tables[0].Fields[1].LobArea);
                Assert.AreEqual(0, db.Tables[0].Fields[1].LobBytes);
                Assert.AreEqual(null, db.Tables[0].Fields[1].LobSize);
                Assert.AreEqual(true, db.Tables[0].Fields[1].Mandatory);
                Assert.AreEqual("thefield2", db.Tables[0].Fields[1].Name);
                Assert.AreEqual(20, db.Tables[0].Fields[1].Order);
                Assert.AreEqual(3, db.Tables[0].Fields[1].Position);
                Assert.AreEqual(1, db.Tables[0].Fields[1].Triggers.Count);
                Assert.AreEqual(4, db.Tables[0].Fields[1].Width);
                Assert.AreEqual(3, db.Tables[0].Indexes.Count);
                Assert.AreEqual(true, db.Tables[0].Indexes[0].Active);
                Assert.AreEqual("Index Area", db.Tables[0].Indexes[0].Area);
                Assert.AreEqual(36396, db.Tables[0].Indexes[0].Crc);
                Assert.AreEqual("thedesc1", db.Tables[0].Indexes[0].Description);
                Assert.AreEqual("theindex1", db.Tables[0].Indexes[0].Name);
                Assert.AreEqual(1, db.Tables[0].Indexes[0].Fields.Count);
                Assert.AreEqual(false, db.Tables[0].Indexes[0].Primary);
                Assert.AreEqual(false, db.Tables[0].Indexes[0].Unique);
                Assert.AreEqual(true, db.Tables[0].Indexes[0].Word);
                Assert.AreEqual(true, db.Tables[0].Indexes[1].Active);
                Assert.AreEqual("Index Area", db.Tables[0].Indexes[1].Area);
                Assert.AreEqual(16650, db.Tables[0].Indexes[1].Crc);
                Assert.AreEqual("desc2", db.Tables[0].Indexes[1].Description);
                Assert.AreEqual(1, db.Tables[0].Indexes[1].Fields.Count);
                Assert.AreEqual(false, db.Tables[0].Indexes[1].Fields[0].Abbreviate);
                Assert.AreEqual(true, db.Tables[0].Indexes[1].Fields[0].Ascending);
                Assert.AreEqual("theindex2", db.Tables[0].Indexes[1].Name);
                Assert.AreEqual(true, db.Tables[0].Indexes[1].Primary);
                Assert.AreEqual(true, db.Tables[0].Indexes[1].Unique);
                Assert.AreEqual(false, db.Tables[0].Indexes[1].Word);
                Assert.AreEqual(1, db.Tables[0].Triggers.Count);
                Assert.AreEqual(0, db.Tables[0].Triggers[0].Crc);
                Assert.AreEqual(UoeDatabaseTriggerEvent.Create, db.Tables[0].Triggers[0].Event);
                Assert.AreEqual(true, db.Tables[0].Triggers[0].Overridable);
                Assert.AreEqual("theproc1", db.Tables[0].Triggers[0].Procedure);
                Assert.AreEqual("Data Area", db.Tables[1].Area);
                Assert.AreEqual(94, db.Tables[1].Crc);
                Assert.AreEqual("", db.Tables[1].Description);
                Assert.AreEqual("thetable2", db.Tables[1].DumpName);
                Assert.AreEqual(11, db.Tables[1].Fields.Count);
                Assert.AreEqual(null, db.Tables[1].Foreign);
                Assert.AreEqual(false, db.Tables[1].Frozen);
                Assert.AreEqual(false, db.Tables[1].Hidden);
                Assert.AreEqual(null, db.Tables[1].Indexes);
                Assert.AreEqual(null, db.Tables[1].Label);
                Assert.AreEqual(null, db.Tables[1].LabelAttribute);
                Assert.AreEqual("thetable2", db.Tables[1].Name);
                Assert.AreEqual(null, db.Tables[1].Replication);
                Assert.AreEqual(null, db.Tables[1].Triggers);
                Assert.AreEqual(UoeDatabaseTableType.T, db.Tables[1].Type);
                Assert.AreEqual(null, db.Tables[1].ValidationExpression);
                Assert.AreEqual("", db.Tables[1].ValidationMessage);
                Assert.AreEqual(null, db.Tables[1].ValidationMessageAttribute);
            }

            env.Dispose();
        }