コード例 #1
0
            public void startDump(DumpCredentialsConfig credentialsConfigInstance)
            {
                SqlDump mysqldump = new SqlDump(credentialsConfigInstance);

                mysqldump.IsTest = true;
                DumpResultSet dumpresult = mysqldump.executeDump();
            }
コード例 #2
0
ファイル: TestSqlDump.cs プロジェクト: schifflee/LightBox
        public void TestExecuteDump()
        {
            ConfigurationManager.getInstance();
            SqlDump mysqldump = new SqlDump(new DumpCredentialsConfig(Const.host, 3306, Const.username, Const.password, Const.database));

            mysqldump.IsTest = true;

            DumpResultSet dumpresult = mysqldump.executeDump();

            Console.WriteLine(dumpresult.ToString());
            Assert.IsTrue(dumpresult.wasSuccessful);
            Assert.AreEqual(0, dumpresult.errorNumber);
            string absfilepath = dumpresult.fileAbsPath;

            Assert.AreEqual(true, File.Exists(absfilepath));
            File.Delete(absfilepath);
            Assert.AreEqual(false, File.Exists(absfilepath));
        }
コード例 #3
0
ファイル: TestSqlDump.cs プロジェクト: schifflee/LightBox
        public void TestExecuteDumpPhaseTwo()
        {
            DumpCredentialsConfig creconfig = new DumpCredentialsConfig();

            creconfig.host     = Const.host;
            creconfig.port     = 3306;
            creconfig.username = Const.username;
            creconfig.password = Const.password;
            creconfig.database = Const.database;

            ConfigurationManager.getInstance();
            ConfigurationManager.getInstance().mysqlDumpConfigInstance.getSettings().includeCreateSchema = false;
            ConfigurationManager.getInstance().compressConfigInstance.getSettings().enableCompression = true;

            //DbConnection connection = DbConnection.Instance();
            //connection.Host = Const.host;
            //connection.password = Const.password;
            //connection.username = Const.username;

            List <string> tables = DbUtils.getTables(new sqlservers(Const.host, 3306, Const.username, Const.password), Const.database);

            int actualNumOfTables = tables.Count;

            SqlDump mysqldump = new SqlDump(creconfig);

            mysqldump.IsTest            = true;
            mysqldump.CompressProgress += compressProgress;
            mysqldump.CompressStart    += onCompressStart;
            mysqldump.TableRowCount    += tableRowCount;
            mysqldump.TableStartDump   += onTableStartDump;

            DumpResultSet dumpresult = mysqldump.executeDump();

            Assert.IsTrue(dumpresult.wasSuccessful);
            Assert.IsTrue(File.Exists(dumpresult.fileAbsPath));
            File.Delete(dumpresult.fileAbsPath);
            Assert.AreEqual(false, File.Exists(dumpresult.fileAbsPath));
            validateOnTableStartDump(actualNumOfTables);
        }
コード例 #4
0
ファイル: TestSqlDump.cs プロジェクト: schifflee/LightBox
 public async Task <DumpResultSet> execdump(SqlDump mysqldump)
 {
     return(mysqldump.executeDump());
 }