コード例 #1
0
        public void DropContextTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("DropContext"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "DropContext");
            scanner.readNextBlock();

            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("CONTEXT", scanner.currCommand.cmdName);
            Assert.AreEqual("DROP", scanner.currCommand.action);
            Assert.AreEqual("HR_CONTEXT", scanner.currCommand.objectName);
        }
コード例 #2
0
        public void CreateClusterTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateCluster"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateCluster");
            scanner.readNextBlock();

            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("CLUSTER", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("PERSONNEL", scanner.currCommand.objectName);
        }
コード例 #3
0
        public void CreateBitmapIndexTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateBitmapIndex"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateBitmapIndex");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("BITMAP INDEX", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("PRODUCT_BM_IX", scanner.currCommand.objectName);
        }
コード例 #4
0
        public void AnalyzeTableTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("AnalyzeTable"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "AnalyzeTable");
            scanner.readNextBlock();

            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("TABLE", scanner.currCommand.cmdName);
            Assert.AreEqual("ANALYZE", scanner.currCommand.action);
            Assert.AreEqual("HR.ORDERS", scanner.currCommand.objectName);
        }
コード例 #5
0
        public void AlterDatabaseTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("AlterDatabase"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "AlterDatabase");
            scanner.readNextBlock();

            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("DATABASE", scanner.currCommand.cmdName);
            Assert.AreEqual("ALTER", scanner.currCommand.action);
            Assert.AreEqual("", scanner.currCommand.objectName);
        }
コード例 #6
0
        public void DropDatabaseLinkTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("DropDatabaseLink"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "DropDatabaseLink");
            scanner.readNextBlock();

            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("DATABASE LINK", scanner.currCommand.cmdName);
            Assert.AreEqual("DROP", scanner.currCommand.action);
            Assert.AreEqual("REMOTE", scanner.currCommand.objectName);
        }
コード例 #7
0
        public void CreateBigfileTablespaceTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateBigfileTablespace"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateBigfileTablespace");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("BIGFILE TABLESPACE", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("BIGTBS_01", scanner.currCommand.objectName);
        }
コード例 #8
0
        public void DeleteTableCollectionTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("DeleteTableCollection"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "DeleteTableCollection");
            scanner.readNextBlock();

            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("", scanner.currCommand.cmdName);
            Assert.AreEqual("DELETE", scanner.currCommand.action);
            Assert.AreEqual("[TABLE COLLECTION]", scanner.currCommand.objectName);
        }
コード例 #9
0
        public void WrappedPackageBodyTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("WrappedPackageBody"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "WrappedPackageBody");
            scanner.readNextBlock();

            Assert.AreEqual(CommandTypes.Plsql, scanner.currCommand.cmdType);
            Assert.AreEqual("PACKAGE BODY", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE OR REPLACE", scanner.currCommand.action);
            Assert.AreEqual("ZBLJ", scanner.currCommand.objectName);
            Assert.AreEqual(8, scanner.tokenCountWithoutComments);
        }
コード例 #10
0
        public void AlterTableAddConstraintPrimaryTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("AlterTableAddConstraintPrimary"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "AlterTableAddConstraintPrimary");
            scanner.readNextBlock();

            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("TABLE", scanner.currCommand.cmdName);
            Assert.AreEqual("ALTER", scanner.currCommand.action);
            Assert.AreEqual("STUDENTS", scanner.currCommand.objectName);
            Assert.AreEqual("ADD CONSTRAINT", scanner.currCommand.alterType);
            Assert.AreEqual("PRIMARY", scanner.currCommand.secondaryCmdName);
            Assert.AreEqual("STUDENTS_PK", scanner.currCommand.secondaryObjectName);
        }
コード例 #11
0
        public void CreateSynonymTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateSynonym"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateSynonym");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("SYNONYM", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE OR REPLACE", scanner.currCommand.action);
            Assert.AreEqual("OFFICES", scanner.currCommand.objectName);
            Assert.AreEqual("HR.LOCATIONS", scanner.currCommand.secondaryObjectName);
        }
コード例 #12
0
        public void CreateSharedPublicDatabaseLinkTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateSharedPublicDatabaseLink"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateSharedPublicDatabaseLink");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("SHARED PUBLIC DATABASE LINK", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
        }
コード例 #13
0
        public void CreateSequenceTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateSequence"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateSequence");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("SEQUENCE", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("CUSTOMERS_SEQ", scanner.currCommand.objectName);
        }
コード例 #14
0
        public void CreateRollbackSegmentTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateRollbackSegment"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateRollbackSegment");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("ROLLBACK SEGMENT", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("RBS_ONE", scanner.currCommand.objectName);
        }
コード例 #15
0
        public void CreateGlobalTemporaryTableTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateGlobalTemporaryTable"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateGlobalTemporaryTable");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("GLOBAL TEMPORARY TABLE", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("TODAY_SALES", scanner.currCommand.objectName);
        }
コード例 #16
0
        public void WrappedTypeTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("WrappedType"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "WrappedType");
            scanner.readNextBlock();

            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("TYPE", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("SCHEMA_NAME.TYPE_NAME", scanner.currCommand.objectName);
            Assert.AreEqual(9, scanner.tokenCountWithoutComments);
        }
コード例 #17
0
        public void CreateTypeTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateType"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateType");
            Assert.AreEqual("CREATE", scanner.get());
            Assert.AreEqual("TYPE", scanner.get());
            Assert.AreEqual("TEST", scanner.get());
            Assert.AreEqual("AS", scanner.get());
            Assert.AreEqual("OBJECT", scanner.get());
            Assert.AreEqual("(", scanner.get());
            Assert.AreEqual("A", scanner.get());
            Assert.AreEqual("NUMBER", scanner.get());
            Assert.AreEqual("(", scanner.get());
            Assert.AreEqual("1", scanner.get());
            Assert.AreEqual(")", scanner.get());
            Assert.AreEqual(")", scanner.get());

            try { scanner.get(); Assert.Fail(); }
            catch (EOBException)
            {
                Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
                Assert.AreEqual("TYPE", scanner.currCommand.cmdName);
                Assert.AreEqual("CREATE", scanner.currCommand.action);
            }
        }
コード例 #18
0
        public void CreateProcedureTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateProcedure"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateProcedure");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Plsql, scanner.currCommand.cmdType);
            Assert.AreEqual("PROCEDURE", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE OR REPLACE", scanner.currCommand.action);
            Assert.AreEqual("REMOVE_EMP", scanner.currCommand.objectName);
        }
コード例 #19
0
        public void CreateDiskgroupTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateDiskgroup"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateDiskgroup");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("DISKGROUP", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("DGROUP_01", scanner.currCommand.objectName);
        }
コード例 #20
0
        public void CreateFlashbackArchiveTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateFlashbackArchive"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateFlashbackArchive");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("FLASHBACK ARCHIVE", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("TEST_ARCHIVE1", scanner.currCommand.objectName);
        }
コード例 #21
0
        public void CreateMaterializedViewTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateMaterializedView"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateMaterializedView");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("MATERIALIZED VIEW", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("FOREIGN_CUSTOMERS", scanner.currCommand.objectName);
        }
コード例 #22
0
        public void CreateMaterializedViewLogTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateMaterializedViewLog"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateMaterializedViewLog");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("MATERIALIZED VIEW LOG", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("PRODUCT_INFORMATION", scanner.currCommand.secondaryObjectName);
        }
コード例 #23
0
        public void CreateIndexTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateIndex"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateIndex");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("INDEX", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("ORD_CUSTOMER_IX", scanner.currCommand.objectName);
            Assert.AreEqual("ORDERS", scanner.currCommand.secondaryObjectName);
        }
コード例 #24
0
        public void CreatePublicOutlineTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreatePublicOutline"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreatePublicOutline");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("PUBLIC OUTLINE", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE OR REPLACE", scanner.currCommand.action);
            Assert.AreEqual("SALARIES", scanner.currCommand.objectName);
        }
コード例 #25
0
        public void CreateTableTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateTable"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateTable");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("TABLE", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("EMPLOYEES_DEMO", scanner.currCommand.objectName);
        }
コード例 #26
0
        public void CreateControlFileTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateControlFile"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateControlFile");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("CONTROLFILE", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
        }
コード例 #27
0
        public void CreateViewTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateView"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateView");
            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("VIEW", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE OR REPLACE", scanner.currCommand.action);
            Assert.AreEqual("EMP_VIEW", scanner.currCommand.objectName);
        }
コード例 #28
0
        public void CreateRestorePointTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateRestorePoint"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateRestorePoint");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Sql, scanner.currCommand.cmdType);
            Assert.AreEqual("RESTORE POINT", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE", scanner.currCommand.action);
            Assert.AreEqual("GOOD_DATA", scanner.currCommand.objectName);
        }
コード例 #29
0
        public void CreatePackageBodyTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreatePackageBody"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreatePackageBody");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Plsql, scanner.currCommand.cmdType);
            Assert.AreEqual("PACKAGE BODY", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE OR REPLACE", scanner.currCommand.action);
            Assert.AreEqual("EMP_MGMT", scanner.currCommand.objectName);
        }
コード例 #30
0
        public void CreateFunctionTest()
        {
            StringReader sr = new StringReader(ResourceHelper.GetResourceString("CreateFunction"));
            SQLMake.Util.Settings.loadSettings();

            SQLPlusScanner scanner;
            scanner = new SQLPlusScanner(sr, "CreateFunction");

            scanner.readNextBlock();
            Assert.AreEqual(CommandTypes.Plsql, scanner.currCommand.cmdType);
            Assert.AreEqual("FUNCTION", scanner.currCommand.cmdName);
            Assert.AreEqual("CREATE OR REPLACE", scanner.currCommand.action);
            Assert.AreEqual("GET_BAL", scanner.currCommand.objectName);
        }