public void TestInformixFiles() { String[] allfiles = System.IO.Directory.GetFiles(UnitTestCommon.BASE_SQL_DIR() + @"informix\", "*.sql", System.IO.SearchOption.AllDirectories); int cnt = 0; foreach (var file in allfiles) { FileInfo info = new FileInfo(file); UnitTestCommon.checkFile(parser, info.FullName); cnt++; } }
public void TestRedshiftFiles2() { String[] allfiles = System.IO.Directory.GetFiles(UnitTestCommon.BASE_SQL_DIR() + @"new_dotnet\redshift\", "*.sql", System.IO.SearchOption.AllDirectories); int cnt = 0; List <string> excludeFiles = new List <string> { "modulo.sql", "qualified_name_drop_table.sql", "with_clause_select_insert.sql" }; foreach (var file in allfiles) { FileInfo info = new FileInfo(file); if (UnitTestCommon.excludeFile(info.Name, excludeFiles)) { continue; } UnitTestCommon.checkFile(parser, info.FullName); cnt++; } }
public void TestPostgreSQLFiles2() { String[] allfiles = System.IO.Directory.GetFiles(UnitTestCommon.BASE_SQL_DIR() + @"new_dotnet\postgresql\", "*.sql", System.IO.SearchOption.AllDirectories); int cnt = 0; List <String> excludeFiles = new List <string> { "like_in_select_list.sql", "modulo.sql", "with_clause_select_insert.sql", "with_select_create_view.sql" }; foreach (var file in allfiles) { FileInfo info = new FileInfo(file); if (UnitTestCommon.excludeFile(info.Name, excludeFiles)) { continue; } UnitTestCommon.checkFile(parser, info.FullName); cnt++; } }
public void testRawStatements() { string rootdir = UnitTestCommon.BASE_SQL_DIR() + @"mdx\"; TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvmdx); sqlparser.sqlfilename = rootdir + "case.sql"; sqlparser.getrawsqlstatements(); Assert.IsTrue(sqlparser.sqlstatements.get(0).sqlstatementtype == ESqlStatementType.sstmdxselect); Assert.IsTrue(sqlparser.sqlstatements.get(1).sqlstatementtype == ESqlStatementType.sstmdxselect); sqlparser.sqlfilename = rootdir + "createmember.sql"; sqlparser.getrawsqlstatements(); Assert.IsTrue(sqlparser.sqlstatements.get(0).sqlstatementtype == ESqlStatementType.sstmdxcreatemember); sqlparser.sqlfilename = rootdir + "createsessioncube.sql"; sqlparser.getrawsqlstatements(); Assert.IsTrue(sqlparser.sqlstatements.size() == 1); Assert.IsTrue(sqlparser.sqlstatements.get(0).sqlstatementtype == ESqlStatementType.sstmdxcreatesessioncube); sqlparser.sqlfilename = rootdir + "createsubcube.sql"; sqlparser.getrawsqlstatements(); Assert.IsTrue(sqlparser.sqlstatements.size() == 6); Assert.IsTrue(sqlparser.sqlstatements.get(0).sqlstatementtype == ESqlStatementType.sstmdxcreatesubcube); Assert.IsTrue(sqlparser.sqlstatements.get(1).sqlstatementtype == ESqlStatementType.sstmdxselect); Assert.IsTrue(sqlparser.sqlstatements.get(2).sqlstatementtype == ESqlStatementType.sstmdxcreatesubcube); Assert.IsTrue(sqlparser.sqlstatements.get(3).sqlstatementtype == ESqlStatementType.sstmdxselect); Assert.IsTrue(sqlparser.sqlstatements.get(4).sqlstatementtype == ESqlStatementType.sstmdxcreatesubcube); Assert.IsTrue(sqlparser.sqlstatements.get(5).sqlstatementtype == ESqlStatementType.sstmdxselect); sqlparser.sqlfilename = rootdir + "drillthrough.sql"; sqlparser.getrawsqlstatements(); Assert.IsTrue(sqlparser.sqlstatements.size() == 1); Assert.IsTrue(sqlparser.sqlstatements.get(0).sqlstatementtype == ESqlStatementType.sstmdxdrillthrough); sqlparser.sqlfilename = rootdir + "scope.sql"; sqlparser.getrawsqlstatements(); Assert.IsTrue(sqlparser.sqlstatements.size() == 2); Assert.IsTrue(sqlparser.sqlstatements.get(0).sqlstatementtype == ESqlStatementType.sstmdxscope); Assert.IsTrue(sqlparser.sqlstatements.get(1).sqlstatementtype == ESqlStatementType.sstmdxscope); }