Esempio n. 1
0
        public void UploadTable_LoadTest()
        {
            int recordCount = 500000;
            var data        = CreateTable("Post", recordCount);

            var manifestObject = GetJsonFile <DatabaseJobManifest>(_inputRoot, "database.manifest.xepdb1.json");
            var sql            = GetJsonFile <TargetSql>(_inputRoot, "xepdb1.target.person.json");

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start(); // start timer

            var target = new OracleSqlWriter();

            target.UploadTable(connectionString,
                               sql.SetupTempDml,
                               manifestObject.manifest.tables[0],
                               data,
                               new List <string> {
                sql.UpdateFromTempDml, sql.ClearTempDml
            });

            stopwatch.Stop();                        // end timer
            var ElapsedDuration = stopwatch.Elapsed; // this is the elapsed duration now for updating RecordsCount records in table database

            WriteLogCsvFile(new CsvLogger {
                TestDate = DateTime.Now, NoOfRecords = recordCount, TimeElapsed = ElapsedDuration
            });
        }
        public void CanUploadTable()
        {
            var manifestObject = GetJsonFile <DatabaseJobManifest>(_inputRoot, "database.manifest.xepdb1.json");
            var sql            = GetJsonFile <TargetSql>(_inputRoot, "xepdb1.target.person.json");
            var data           = CreateTable();

            var target = new OracleSqlWriter();

            target.UploadTable(connectionString,
                               sql.SetupTempDml,
                               manifestObject.manifest.tables[0],
                               data,
                               new List <string> {
                sql.UpdateFromTempDml, sql.ClearTempDml
            });

            var reader = new OracleSqlReader();
            var result = reader.GetData(connectionString, $"select * from TEST_USER.Person");

            result.Tables.Should().NotBeEmpty();
            result.Tables[0].Rows.Should().NotBeEmpty();
        }