-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
李家奥
authored and
李家奥
committed
Apr 20, 2022
1 parent
5958b92
commit 2667b42
Showing
5 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/ParenthesisGroupTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html | ||
*/ | ||
|
||
package net.sourceforge.pmd.lang.plsql.ast; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import net.sourceforge.pmd.lang.plsql.AbstractPLSQLParserTst; | ||
|
||
public class ParenthesisGroupTest extends AbstractPLSQLParserTst { | ||
|
||
@Test | ||
public void parseParenthesisGroup0() { | ||
ASTInput input = plsql.parseResource("ParenthesisGroup0.pls"); | ||
Assert.assertNotNull(input); | ||
} | ||
|
||
@Test | ||
public void parseParenthesisGroup1() { | ||
ASTInput input = plsql.parseResource("ParenthesisGroup1.pls"); | ||
Assert.assertNotNull(input); | ||
} | ||
|
||
@Test | ||
public void parseParenthesisGroup2() { | ||
ASTInput input = plsql.parseResource("ParenthesisGroup2.pls"); | ||
Assert.assertNotNull(input); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ParenthesisGroup0.pls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
CREATE OR REPLACE PROCEDURE EXAMPLE_PROCEDURE IS | ||
-- | ||
CURSOR c_example IS | ||
SELECT a.owner, u.object_name, p.aggregate | ||
FROM (USER_OBJECTS u) INNER JOIN (ALL_OBJECTS a) ON | ||
u.object_name = a.object_name AND u.object_type = a.object_type AND u.object_id = a.object_id) | ||
INNER JOIN (ALL_PROCEDURES p) ON | ||
p.owner = a.owner AND p.object_name = a.object_name AND p.object_type = a.object_type | ||
WHERE a.owner = USER; | ||
-- | ||
BEGIN | ||
-- | ||
FOR l_object IN c_example LOOP | ||
-- | ||
DBMS_OUTPUT.Put_Line(l_object.owner); | ||
DBMS_OUTPUT.Put_Line(l_object.object_name); | ||
DBMS_OUTPUT.Put_Line(l_object.aggregate); | ||
-- | ||
END LOOP; | ||
-- | ||
END EXAMPLE_PROCEDURE; |
21 changes: 21 additions & 0 deletions
21
pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ParenthesisGroup1.pls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
CREATE OR REPLACE PROCEDURE EXAMPLE_PROCEDURE IS | ||
-- | ||
CURSOR c_example IS | ||
SELECT a.owner, u.object_name, p.aggregate | ||
FROM (((USER_OBJECTS u) INNER JOIN (ALL_OBJECTS a) ON | ||
u.object_name = a.object_name AND u.object_type = a.object_type AND u.object_id = a.object_id) | ||
INNER JOIN (ALL_PROCEDURES p) ON | ||
p.owner = a.owner AND p.object_name = a.object_name AND p.object_type = a.object_type) | ||
WHERE a.owner = USER; | ||
-- | ||
BEGIN | ||
-- | ||
FOR l_object IN c_example LOOP | ||
-- | ||
DBMS_OUTPUT.Put_Line(l_object.owner); | ||
DBMS_OUTPUT.Put_Line(l_object.object_name); | ||
DBMS_OUTPUT.Put_Line(l_object.aggregate); | ||
-- | ||
END LOOP; | ||
-- | ||
END EXAMPLE_PROCEDURE; |
15 changes: 15 additions & 0 deletions
15
pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ParenthesisGroup2.pls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
CREATE OR REPLACE PROCEDURE TEST_PROCEDURE IS | ||
-- | ||
CURSOR c_test IS | ||
SELECT si.sid, sn.name, sa.age, ss.score, sp.parent | ||
FROM ((((STUDENT_INFO si) INNER JOIN (STUDENT_AGE sa) on si.sid = sa.sid) | ||
INNER JOIN | ||
(STUDENT_SCORE ss) on si.sid = sp.sid) | ||
INNER JOIN | ||
(STUDENT_PARENT sp) on si.sid = sp.sid) | ||
WHERE si.sid = '114514'; | ||
-- | ||
BEGIN | ||
-- | ||
-- | ||
END EXAMPLE_PROCEDURE; |