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

            var ope = new UoeDatabaseOperator(dlcPath);

            var tgtDb = GetDb("start");

            ope.Create(tgtDb);
            Assert.IsTrue(tgtDb.Exists());

            Assert.AreEqual(DatabaseBusyMode.NotBusy, ope.GetBusyMode(tgtDb));

            var nextPort = UoeDatabaseOperator.GetNextAvailablePort();

            try {
                ope.Start(tgtDb, "localhost", nextPort.ToString(), new UoeProcessArgs().Append("-minport", "50000", "-maxport", "50100", "-L", "20000") as UoeProcessArgs);

                Assert.AreEqual(DatabaseBusyMode.MultiUser, ope.GetBusyMode(tgtDb));
            } finally {
                ope.Kill(tgtDb);
            }

            Assert.AreEqual(DatabaseBusyMode.NotBusy, ope.GetBusyMode(tgtDb));
        }
Exemple #2
0
        public void LoadSchemaDefinition()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var ope    = new UoeDatabaseOperator(dlcPath);
            var db     = GetDb("loaddf");
            var dfPath = Path.Combine(TestFolder, $"{db.PhysicalName}.df");

            ope.Create(db);
            Assert.IsTrue(db.Exists());

            // 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.LoadSchemaDefinition(UoeDatabaseConnection.NewSingleUserConnection(db), dfPath);
            }

            ope.Delete(db);
            ope.Create(db);

            // create .df
            File.WriteAllText(dfPath, "ADD 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");

            using (var dataAdmin = new UoeDatabaseAdministrator(dlcPath)) {
                Assert.ThrowsException <UoeDatabaseException>(() => dataAdmin.LoadSchemaDefinition(UoeDatabaseConnection.NewSingleUserConnection(db), dfPath));
            }
        }
        public void AddAndRemoveExtents()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var ope = new UoeDatabaseOperator(dlcPath);

            var tgtDb = GetDb("extents");

            ope.Create(tgtDb);
            Assert.IsTrue(tgtDb.Exists());

            var stPath = Path.Combine(TestFolder, "extents_add.st");

            File.WriteAllText(stPath, $"d \"Data Area\" \"{TestFolder}\"");

            ope.AddStructureDefinition(tgtDb, stPath);

            try {
                ope.Start(tgtDb);
                File.WriteAllText(stPath, $"d \"New Area\" \"{TestFolder}\"");
                ope.AddStructureDefinition(tgtDb, stPath);
            } finally {
                ope.Stop(tgtDb);
            }

            Assert.IsTrue(File.Exists(Path.Combine(TestFolder, "extents_7.d1")));
            Assert.IsTrue(File.Exists(Path.Combine(TestFolder, "extents_8.d1")));

            ope.RemoveStructureDefinition(tgtDb, "d", "Data Area");

            Assert.IsFalse(File.Exists(Path.Combine(TestFolder, "extents_7.d1")));
        }
        public void GenerateStructureFileFromDf()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var ope = new UoeDatabaseOperator(dlcPath);
            var db  = GetDb("generatedf");

            var pathDf = Path.Combine(TestFolder, "generatedf.df");

            File.WriteAllText(pathDf, "ADD TABLE \"Benefits\"\n  AREA \"Employee\"\n  DESCRIPTION \"The benefits table contains employee benefits.\"\n  DUMP-NAME \"benefits\"\n\nADD TABLE \"BillTo\"\n  AREA \"Order\"\n  DESCRIPTION \"The billto table contains bill to address information for an order. \"\n  DUMP-NAME \"billto\"\n");

            var generatedSt = ope.GenerateStructureFileFromDf(db, pathDf);

            Assert.AreEqual(db.StructureFileFullPath, generatedSt);
            Assert.IsTrue(File.Exists(generatedSt));

            Assert.IsTrue(File.ReadAllText(generatedSt).Contains("Employee"));
            Assert.IsTrue(File.ReadAllText(generatedSt).Contains("Order"));

            File.WriteAllText(pathDf, "");

            ope.GenerateStructureFileFromDf(db, pathDf);
            Assert.IsTrue(File.ReadAllText(generatedSt).Contains("Schema Area"));
        }
        public void Copy()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var ope = new UoeDatabaseOperator(dlcPath);

            var stPath = Path.Combine(TestFolder, "copysource.st");

            File.WriteAllText(stPath, $"b .\nd \"Schema Area\" \"{TestFolder}\"");

            var srcDb = GetDb("copysource");
            var tgtDb = GetDb("copytarget");

            ope.Create(srcDb, stPath);
            Assert.IsTrue(srcDb.Exists());

            ope.Copy(tgtDb, srcDb, false, false);
            Assert.IsTrue(tgtDb.Exists());

            ope.Delete(tgtDb);
            Assert.IsFalse(tgtDb.Exists());

            ope.Copy(tgtDb, srcDb);
            Assert.IsTrue(tgtDb.Exists());
        }
        public void RepairDatabaseControlInfo()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var ope = new UoeDatabaseOperator(dlcPath);

            var tgtDb = GetDb("repair");

            ope.Create(tgtDb);
            Assert.IsTrue(tgtDb.Exists());

            var stPath = Path.Combine(TestFolder, "repair.st");

            File.WriteAllText(stPath, $"b .\nd \"Schema Area\" \"{TestFolder}\"");

            ope.RepairDatabaseControlInfo(tgtDb);

            File.WriteAllText(stPath, "b .\nd \"Schema Area\" .");

            File.Delete(tgtDb.FullPath);
            ope.RepairDatabaseControlInfo(tgtDb);

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

            var ope = new UoeDatabaseOperator(dlcPath);
            var db  = GetDb("trunclog");

            ope.Create(db);
            Assert.IsTrue(db.Exists());

            ope.TruncateLog(db);

            try {
                ope.Start(db);

                var oldSize = new FileInfo(Path.Combine(TestFolder, "trunclog.lg")).Length;

                ope.TruncateLog(db);

                var newSize = new FileInfo(Path.Combine(TestFolder, "trunclog.lg")).Length;

                Assert.AreNotEqual(oldSize, newSize);

                var cs = ope.GetDatabaseConnection(db);
                Assert.IsFalse(cs.SingleUser);
                Assert.IsTrue(string.IsNullOrEmpty(cs.Service));
            } finally {
                ope.Kill(db);
            }
        }
        public static void Cleanup()
        {
            UoeDatabaseOperator.KillAllMproSrv();

            if (Directory.Exists(TestFolder))
            {
                Directory.Delete(TestFolder, true);
            }
        }
        public void OeExecution_Test_DbConnection_ok()
        {
            if (!GetEnvExecution(out UoeExecutionEnv env))
            {
                return;
            }
            env.UseProgressCharacterMode = true;

            // generate temp base
            var db   = new UoeDatabaseOperator(env.DlcDirectoryPath);
            var dbPn = new UoeDatabaseLocation(Path.Combine(TestFolder, "test1.db"));

            db.Create(dbPn);
            Assert.IsTrue(dbPn.Exists());

            // generate temp base
            var dbPn2 = new UoeDatabaseLocation(Path.Combine(TestFolder, "test2.db"));

            db.Create(dbPn2);
            Assert.IsTrue(dbPn2.Exists());

            // try if connected well and can manage aliases
            env.DatabaseConnections = new [] { db.GetDatabaseConnection(dbPn), db.GetDatabaseConnection(dbPn2) };
            env.DatabaseAliases     = new List <IUoeExecutionDatabaseAlias> {
                new UoeExecutionDatabaseAlias {
                    DatabaseLogicalName = "test1",
                    AliasLogicalName    = "alias1"
                },
                new UoeExecutionDatabaseAlias {
                    DatabaseLogicalName = "test1",
                    AliasLogicalName    = "alias2"
                },
                new UoeExecutionDatabaseAlias {
                    DatabaseLogicalName = "test2",
                    AliasLogicalName    = "alias3"
                }
            };
            using (var exec = new UoeExecutionCustomTest(env)) {
                exec.NeedDatabaseConnection = true;
                exec.ProgramContent         = @"
                DEFINE VARIABLE li_db AS INTEGER NO-UNDO.
                REPEAT li_db = 1 TO NUM-ALIASES:
                    PUT UNFORMATTED ALIAS(li_db) SKIP.
                END.";
                exec.ExecuteNoWait();
                exec.WaitForExit();
                Assert.IsFalse(exec.ExecutionHandledExceptions, "ok");
                Assert.AreEqual("dictdb alias1 alias2 alias3", new StringBuilder(exec.Output).CliCompactWhitespaces().ToString());
            }
            env.Dispose();
        }
        public void Analysis()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var ope = new UoeDatabaseOperator(dlcPath);
            var db  = GetDb("analys");

            ope.Create(db);
            Assert.IsTrue(db.Exists());

            Assert.IsTrue(ope.GenerateAnalysisReport(db).Length > 10);
        }
        public void Create()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var ope = new UoeDatabaseOperator(dlcPath);
            var db  = GetDb("test1.db");

            ope.Create(db);

            Assert.IsTrue(db.Exists());

            ope.Delete(db);

            Assert.IsFalse(db.Exists());

            var stPath = Path.Combine(TestFolder, "test1.st");

            File.WriteAllText(stPath, "b .\nd \"Schema Area\" .\nd \"data\" .");

            ope.Create(db, stPath);

            Assert.IsTrue(db.Exists());
            Assert.IsTrue(File.Exists(Path.Combine(TestFolder, "test1_7.d1")));

            ope.Delete(db);

            Assert.IsFalse(db.Exists());

            File.WriteAllText(stPath, "b .\nd \"Schema Area\" ./sub\nd \"data\" ./data");

            ope.Create(db, stPath, DatabaseBlockSize.S4096, "utf", false, false);

            Assert.IsTrue(db.Exists());

            Assert.IsTrue(File.Exists(Path.Combine(TestFolder, "sub", "test1.d1")));
            Assert.IsTrue(File.Exists(Path.Combine(TestFolder, "data", "test1_7.d1")));

            ope.Delete(db);

            Assert.IsFalse(File.Exists(Path.Combine(TestFolder, "sub", "test1.d1")));
            Assert.IsFalse(File.Exists(Path.Combine(TestFolder, "data", "test1_7.d1")));
        }
        public void Test()
        {
            var serverPort = UoeDatabaseOperator.GetNextAvailablePort(1050);
            var proxyPort  = UoeDatabaseOperator.GetNextAvailablePort(serverPort + 1);

            // hostname to use
            // we need something different than 127.0.0.1 or localhost for the proxy!
            IPHostEntry hostEntry;

            try {
                hostEntry = Dns.GetHostEntry("mylocalhost");
            } catch (Exception) {
                hostEntry = null;
            }
            var host = hostEntry == null ? "127.0.0.1" : "mylocalhost";

            var archiver = Archiver.NewHttpFileServerArchiver();

            Assert.IsNotNull(archiver);

            var baseDir = Path.Combine(TestFolder, "http");

            archiver.SetProxy($"http://{host}:{proxyPort}/", "jucai69d", "julien caillon");
            archiver.SetBasicAuthentication("admin", "admin123");

            var listFiles = GetPackageTestFilesList(TestFolder, $"http://{host}:{serverPort}/server1");

            listFiles.AddRange(GetPackageTestFilesList(TestFolder, $"http://{host}:{serverPort}/server2"));

            var fileServer  = new SimpleHttpFileServer(baseDir, "admin", "admin123");
            var proxyServer = new SimpleHttpProxyServer("jucai69d", "julien caillon");

            var cts   = new CancellationTokenSource();
            var task1 = HttpServer.ListenAsync(serverPort, cts.Token, fileServer.OnHttpRequest, true);
            var task2 = HttpServer.ListenAsync(proxyPort, cts.Token, proxyServer.OnHttpRequest, true);

            PartialTestForHttpFileServer(archiver, listFiles);

            if (!host.Equals("127.0.0.1"))
            {
                Assert.AreEqual(61, proxyServer.NbRequestsHandledOk);
            }

            HttpServer.Stop(cts, task1, task2);
        }
        public void ValidateStructureFile()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }
            var pathSt = Path.Combine(TestFolder, "validate.st");

            File.WriteAllText(pathSt, "b .\nd \"Schema Area\":6,32;1 .\nd \"Data\":11,32;1 .");

            var ope = new UoeDatabaseOperator(dlcPath);

            ope.ValidateStructureFile(GetDb("data"), pathSt);

            File.WriteAllText(pathSt, "z \"Schema Area\":6,32;1 .\nd \"Order\":11,32;1 . f 1280 \nd \"Order\":11,32;1 .");

            Assert.ThrowsException <UoeDatabaseException>(() => ope.ValidateStructureFile(GetDb("data"), pathSt));
        }
        public void UpdateStructureFile()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var ope = new UoeDatabaseOperator(dlcPath);

            var tgtDb = GetDb("updatest");

            ope.Create(tgtDb);
            Assert.IsTrue(tgtDb.Exists());

            File.Delete(tgtDb.StructureFileFullPath);

            ope.UpdateStructureFile(tgtDb, false, false);

            Assert.IsTrue(File.ReadAllText(tgtDb.StructureFileFullPath).Contains(Path.Combine(tgtDb.DirectoryPath, "updatest.b1")));

            File.Delete(tgtDb.StructureFileFullPath);

            ope.UpdateStructureFile(tgtDb, false, true);

            Assert.IsFalse(File.ReadAllText(tgtDb.StructureFileFullPath).Contains(Path.Combine(tgtDb.DirectoryPath, "updatest.b1")));
            Assert.IsTrue(File.ReadAllText(tgtDb.StructureFileFullPath).Contains(tgtDb.DirectoryPath));

            File.Delete(tgtDb.StructureFileFullPath);

            ope.UpdateStructureFile(tgtDb, true, false);

            Assert.IsFalse(File.ReadAllText(tgtDb.StructureFileFullPath).Contains(Path.Combine(tgtDb.DirectoryPath, "updatest.b1")));
            Assert.IsFalse(File.ReadAllText(tgtDb.StructureFileFullPath).Contains(tgtDb.DirectoryPath));
            Assert.IsTrue(File.ReadAllText(tgtDb.StructureFileFullPath).Contains("updatest.b1"));

            File.Delete(tgtDb.StructureFileFullPath);

            ope.UpdateStructureFile(tgtDb, true, true);

            Assert.IsFalse(File.ReadAllText(tgtDb.StructureFileFullPath).Contains(Path.Combine(tgtDb.DirectoryPath, "updatest.b1")));
            Assert.IsFalse(File.ReadAllText(tgtDb.StructureFileFullPath).Contains(tgtDb.DirectoryPath));
            Assert.IsFalse(File.ReadAllText(tgtDb.StructureFileFullPath).Contains("updatest.b1"));
            Assert.IsTrue(File.ReadAllText(tgtDb.StructureFileFullPath).Contains("."));
        }
        public void Test()
        {
            var serverHost = @"127.0.0.1";
            var serverIp   = UoeDatabaseOperator.GetNextAvailablePort(2024);
            var ftpUri     = $"ftp://{serverHost}:{serverIp}/";

            // Setup dependency injection
            var services = new ServiceCollection();

            services.Configure <DotNetFileSystemOptions>(opt => opt
                                                         .RootPath = Path.Combine(TestFolder, "archives"));

            services.AddFtpServer(builder => builder
                                  .UseDotNetFileSystem()             // Use the .NET file system functionality
                                  .EnableAnonymousAuthentication()); // allow anonymous logins

            services.Configure <FtpServerOptions>(opt => {
                opt.ServerAddress = serverHost;
                opt.Port          = serverIp;
            });

            using (var serviceProvider = services.BuildServiceProvider()) {
                // Initialize the FTP server
                var ftpServer = serviceProvider.GetRequiredService <IFtpServer>();

                // Start the FTP server
                ftpServer.Start();

                SpinWait.SpinUntil(() => ftpServer.Ready, 5000);

                FtpArchiver archiver = new FtpArchiver();

                var listFiles = GetPackageTestFilesList(TestFolder, ftpUri);

                WholeTest(archiver, listFiles);

                // Stop the FTP server
                ftpServer.Stop();
            }
        }
        public void Backup_Restore()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }
            var ope = new UoeDatabaseOperator(dlcPath);
            var db  = GetDb("backuprest");

            ope.Copy(db, new UoeDatabaseLocation(Path.Combine(dlcPath, "sports2000")));
            Assert.IsTrue(db.Exists());

            var backupPath = Path.Combine(TestFolder, "backup.bkp");

            ope.Backup(db, backupPath);

            ope.Delete(db);
            Assert.IsFalse(db.Exists());

            ope.Restore(db, backupPath);
            Assert.IsTrue(db.Exists());
        }
        public void GetConnectionString()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var ope = new UoeDatabaseOperator(dlcPath);
            var db  = GetDb("connec");

            ope.Create(db);

            Assert.IsTrue(ope.GetDatabaseConnection(db).SingleUser);
            Assert.IsTrue(string.IsNullOrEmpty(ope.GetDatabaseConnection(db).Service));
            Assert.AreEqual(null, ope.GetDatabaseConnection(db).LogicalName);
            Assert.AreEqual("test", ope.GetDatabaseConnection(db, "test").LogicalName);

            try {
                ope.Start(db);

                Assert.IsFalse(ope.GetDatabaseConnection(db).SingleUser);
                Assert.IsTrue(string.IsNullOrEmpty(ope.GetDatabaseConnection(db).Service));
            } finally {
                ope.Kill(db);
            }

            try {
                ope.Start(db, null, UoeDatabaseOperator.GetNextAvailablePort().ToString());

                Assert.IsFalse(ope.GetDatabaseConnection(db).SingleUser);
                Assert.IsFalse(string.IsNullOrEmpty(ope.GetDatabaseConnection(db).Service));
                Assert.IsFalse(string.IsNullOrEmpty(ope.GetDatabaseConnection(db).HostName));
            } finally {
                ope.Kill(db);
            }
        }
 public void GetNextAvailablePort()
 {
     Assert.IsTrue(UoeDatabaseOperator.GetNextAvailablePort(0) > 0);
     Assert.IsTrue(UoeDatabaseOperator.GetNextAvailablePort(1025) >= 1025);
 }
        public void ReadLogFileTest()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }
            var ope = new UoeDatabaseOperator(dlcPath);

            var lgPAth = Path.Combine(TestFolder, "ReadLogFileTest.lg");

            File.WriteAllText(lgPAth, @"
                Tue Jan  1 15:28:10 2019
[2019/01/01@14:46:51.345+0100] P-10860      T-17952 I BROKER  0: (333)   Multi-user session begin.
[2019/01/01@14:46:51.345+0100] P-10860      T-15580 I BROKER  0: (4393)  This server is licenced for local logins only.
[2019/01/01@14:46:51.345+0100] P-10860      T-7584  I BROKER  0: (4261)  Host Name (-H): hostname
[2019/01/01@14:46:51.349+0100] P-10860      T-7584  I BROKER  0: (4262)  Service Name (-S): 1
");
            ope.ReadStartingParametersFromLogFile(lgPAth, out string hostName, out string serviceName);

            Assert.IsNotNull(hostName);
            Assert.IsNotNull(serviceName);

            Assert.AreEqual(@"localhost", hostName);
            Assert.AreEqual(@"1", serviceName);

            File.WriteAllText(lgPAth, @"
                Tue Jan  1 15:28:10 2019
[2019/01/01@14:46:51.345+0100] P-10860      T-17952 I BROKER  0: (333)   Multi-user session begin.
[2019/01/01@14:46:51.345+0100] P-10860      T-7584  I BROKER  0: (4261)  Host Name (-H): hostname
[2019/01/01@14:46:51.349+0100] P-10860      T-7584  I BROKER  0: (4262)  Service Name (-S): 999
");
            ope.ReadStartingParametersFromLogFile(lgPAth, out hostName, out serviceName);

            Assert.IsNotNull(hostName);
            Assert.IsNotNull(serviceName);

            Assert.AreEqual(@"hostname", hostName);
            Assert.AreEqual(@"999", serviceName);

            File.WriteAllText(lgPAth, @"
                Tue Jan  1 15:28:10 2019
[2019/01/01@14:46:51.345+0100] P-10860      T-17952 I BROKER  0: (333)   Multi-user session begin.
[2019/01/01@14:46:51.345+0100] P-10860      T-7584  I BROKER  0: (4261)  Host Name (-H): hostname
[2019/01/01@14:46:51.349+0100] P-10860      T-7584  I BROKER  0: (4262)  Service Name (-S): 0
");
            ope.ReadStartingParametersFromLogFile(lgPAth, out hostName, out serviceName);

            Assert.AreEqual(null, hostName);
            Assert.AreEqual(null, serviceName);

            File.WriteAllText(lgPAth, @"
                Tue Jan  1 15:28:10 2019
[2019/01/01@14:46:51.345+0100] P-10860      T-17952 I BROKER  0: (333)   Multi-user session begin.
[2019/01/01@14:46:51.345+0100] P-10860      T-7584  I BROKER  0: (4261)  Host Name (-H): hostname
[2019/01/01@14:46:51.349+0100] P-10860      T-7584  I BROKER  0: (4262)  Service Name (-S): 0
[2019/01/01@14:46:51.349+0100] P-10999      T-7584  I SRV     1: (5646)  Started on port 3000 using TCP IPV4 address 127.0.0.1, pid 17372.
[2019/01/01@14:46:51.349+0100] P-11111      T-6060  I SQLSRV2 1: (-----) SQL Server 11.7.04 started, configuration: ""db.virtualconfig""
");
            var pids = ope.GetPidsFromLogFile(lgPAth).ToList();

            Assert.AreEqual(11111, pids[0]);
            Assert.AreEqual(10999, pids[1]);
            Assert.AreEqual(10860, pids[2]);
        }
Exemple #20
0
 protected override int ExecuteCommand(CommandLineApplication app, IConsole console)
 {
     UoeDatabaseOperator.KillAllMproSrv();
     return(0);
 }
        public void Delete()
        {
            if (!TestHelper.GetDlcPath(out string dlcPath))
            {
                return;
            }

            var db = new UoeDatabaseOperator(dlcPath);

            var deleteDir = Path.Combine(TestFolder, "delete");

            Directory.CreateDirectory(deleteDir);

            var stPath = Path.Combine(deleteDir, "test1.st");

            File.WriteAllText(stPath, @"
b .
d ""Schema Area"":6,32;1 .
d ""Data Area"":7,32;1 .
d ""Index Area"":8,32;8 .
d ""Data Area2"":9,32;8 .
d ""Data Area3"":12,32;8 .
");
            var loc = new UoeDatabaseLocation(Path.Combine(deleteDir, "test1.db"));

            db.Create(loc, stPath);

            Assert.AreEqual(9, Directory.EnumerateFiles(deleteDir, "*", SearchOption.TopDirectoryOnly).Count());

            File.Delete(stPath);

            db.Delete(loc);

            Assert.AreEqual(1, Directory.EnumerateFiles(deleteDir, "*", SearchOption.TopDirectoryOnly).Count(), "only the .st should be left (it has been recreated to list files to delete).");

            File.WriteAllText(stPath, @"
b ./2
a ./3 f 1024
a ./3 f 1024
a !""./3"" f 1024
t . f 4096
d ""Employee"",32 ./1/emp f 1024
d ""Employee"",32 ./1/emp
d ""Inventory"",32 ./1/inv f 1024
d ""Inventory"",32 ./1/inv
d ""Cust_Data"",32;64 ./1/cust f 1024
d ""Cust_Data"",32;64 ./1/cust
d ""Cust_Index"",32;8 ./1/cust
d ""Order"",32;64 ./1/ord f 1024
d ""Order"",32;64 ./1/ord
d ""Misc"",32 !""./1/misc data"" f 1024
d ""Misc"",32 !""./1/misc data""
d ""schema Area"" .
");

            db.CreateVoidDatabase(loc, stPath);

            Assert.AreEqual(20, Directory.EnumerateFiles(deleteDir, "*", SearchOption.AllDirectories).Count());

            db.Delete(loc);

            Assert.AreEqual(1, Directory.EnumerateFiles(deleteDir, "*", SearchOption.AllDirectories).Count());
        }