Skip to content

Commit 97e9229

Browse files
authored
Unit tests support multi-os and higher versions of jdk (#1886)
* fix: tokenBlockPattern support \r\n or \r * test: remove nashorn ignore annotation to support jdk11+
1 parent 64c0f13 commit 97e9229

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/net/sf/jsqlparser/parser/ParserKeywordsUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public static void main(String[] args) throws Exception {
214214

215215
public static TreeSet<String> getAllKeywordsUsingRegex(File file) throws IOException {
216216
Pattern tokenBlockPattern = Pattern.compile(
217-
"TOKEN\\s*:\\s*(?:/\\*.*\\*/*)\\n\\{(?:[^\\}\\{]+|\\{(?:[^\\}\\{]+|\\{[^\\}\\{]*\\})*\\})*\\}",
217+
"TOKEN\\s*:\\s*(?:/\\*.*\\*/*)(?:\\r?\\n|\\r)\\{(?:[^\\}\\{]+|\\{(?:[^\\}\\{]+|\\{[^\\}\\{]*\\})*\\})*\\}",
218218
Pattern.MULTILINE);
219219
Pattern tokenStringValuePattern = Pattern.compile("\\\"(\\w{2,})\\\"", Pattern.MULTILINE);
220220

src/test/java/net/sf/jsqlparser/util/TablesNamesFinderTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010
package net.sf.jsqlparser.util;
1111

12-
import jdk.nashorn.internal.ir.annotations.Ignore;
1312
import net.sf.jsqlparser.JSQLParserException;
1413
import net.sf.jsqlparser.expression.OracleHint;
1514
import net.sf.jsqlparser.parser.CCJSqlParserManager;
@@ -23,6 +22,7 @@
2322
import net.sf.jsqlparser.statement.simpleparsing.CCJSqlParserManagerTest;
2423
import net.sf.jsqlparser.test.TestException;
2524
import net.sf.jsqlparser.test.TestUtils;
25+
import org.junit.jupiter.api.Disabled;
2626
import org.junit.jupiter.api.Test;
2727

2828
import java.io.BufferedReader;
@@ -41,17 +41,17 @@ public class TablesNamesFinderTest {
4141

4242
private static final CCJSqlParserManager PARSER_MANAGER = new CCJSqlParserManager();
4343

44-
@Ignore
44+
@Disabled
4545
public void testRUBiSTableList() throws Exception {
4646
runTestOnResource("/RUBiS-select-requests.txt");
4747
}
4848

49-
@Ignore
49+
@Disabled
5050
public void testMoreComplexExamples() throws Exception {
5151
runTestOnResource("complex-select-requests.txt");
5252
}
5353

54-
@Ignore
54+
@Disabled
5555
public void testComplexMergeExamples() throws Exception {
5656
runTestOnResource("complex-merge-requests.txt");
5757
}

0 commit comments

Comments
 (0)