@@ -57,7 +57,8 @@ public void testParseExpression2() throws Exception {
5757
5858 @ Test
5959 public void testParseExpressionNonPartial () throws Exception {
60- assertThrows (JSQLParserException .class , () -> CCJSqlParserUtil .parseExpression ("a+" , false ));
60+ assertThrows (JSQLParserException .class ,
61+ () -> CCJSqlParserUtil .parseExpression ("a+" , false ));
6162
6263 }
6364
@@ -68,7 +69,8 @@ public void testParseExpressionFromStringFail() throws Exception {
6869
6970 @ Test
7071 public void testParseExpressionFromRaderFail () throws Exception {
71- assertThrows (JSQLParserException .class , () -> CCJSqlParserUtil .parse (new StringReader ("whatever$" )));
72+ assertThrows (JSQLParserException .class ,
73+ () -> CCJSqlParserUtil .parse (new StringReader ("whatever$" )));
7274 }
7375
7476 @ Test
@@ -91,14 +93,17 @@ public void testParseCondExpressionFail() throws Exception {
9193 @ Test
9294 public void testParseFromStreamFail () throws Exception {
9395 assertThrows (JSQLParserException .class ,
94- () -> CCJSqlParserUtil .parse (new ByteArrayInputStream ("BLA" .getBytes (StandardCharsets .UTF_8 ))));
96+ () -> CCJSqlParserUtil
97+ .parse (new ByteArrayInputStream ("BLA" .getBytes (StandardCharsets .UTF_8 ))));
9598
9699 }
97100
98101 @ Test
99102 public void testParseFromStreamWithEncodingFail () throws Exception {
100103 assertThrows (JSQLParserException .class ,
101- () -> CCJSqlParserUtil .parse (new ByteArrayInputStream ("BLA" .getBytes (StandardCharsets .UTF_8 )), StandardCharsets .UTF_8 .name ()));
104+ () -> CCJSqlParserUtil .parse (
105+ new ByteArrayInputStream ("BLA" .getBytes (StandardCharsets .UTF_8 )),
106+ StandardCharsets .UTF_8 .name ()));
102107
103108 }
104109
@@ -110,7 +115,8 @@ public void testParseCondExpressionNonPartial() throws Exception {
110115
111116 @ Test
112117 public void testParseCondExpressionNonPartial2 () throws Exception {
113- assertThrows (JSQLParserException .class , () -> CCJSqlParserUtil .parseCondExpression ("x=92 lasd y=29" , false ));
118+ assertThrows (JSQLParserException .class ,
119+ () -> CCJSqlParserUtil .parseCondExpression ("x=92 lasd y=29" , false ));
114120 }
115121
116122 @ Test
@@ -121,22 +127,23 @@ public void testParseCondExpressionPartial2() throws Exception {
121127
122128 @ Test
123129 public void testParseCondExpressionIssue471 () throws Exception {
124- Expression result = CCJSqlParserUtil .parseCondExpression ("(SSN,SSM) IN ('11111111111111', '22222222222222')" );
130+ Expression result = CCJSqlParserUtil
131+ .parseCondExpression ("(SSN,SSM) IN ('11111111111111', '22222222222222')" );
125132 assertEquals ("(SSN, SSM) IN ('11111111111111', '22222222222222')" , result .toString ());
126133 }
127134
128135 @ Test
129136 public void testParseStatementsIssue691 () throws Exception {
130137 Statements result = CCJSqlParserUtil .parseStatements (
131138 "select * from dual;\n "
132- + "\n "
133- + "select\n "
134- + "*\n "
135- + "from\n "
136- + "dual;\n "
137- + "\n "
138- + "select *\n "
139- + "from dual;" );
139+ + "\n "
140+ + "select\n "
141+ + "*\n "
142+ + "from\n "
143+ + "dual;\n "
144+ + "\n "
145+ + "select *\n "
146+ + "from dual;" );
140147 assertEquals ("SELECT * FROM dual;\n "
141148 + "SELECT * FROM dual;\n "
142149 + "SELECT * FROM dual;\n " , result .toString ());
@@ -169,19 +176,21 @@ public void accept(Statement statement) {
169176 public void testParseStatementsFail () throws Exception {
170177 // This will not fail, but always return the Unsupported Statements
171178 // Since we can't LOOKAHEAD in the Statements() production
172- assertThrows (JSQLParserException .class , () -> CCJSqlParserUtil .parseStatements ("select * from dual;WHATEVER!!" ));
179+ assertThrows (JSQLParserException .class ,
180+ () -> CCJSqlParserUtil .parseStatements ("select * from dual;WHATEVER!!" ));
173181 }
174182
175183 @ Test
176184 public void testParseASTFail () throws Exception {
177- assertThrows (JSQLParserException .class , () -> CCJSqlParserUtil .parseAST ("select * from dual;WHATEVER!!" ));
185+ assertThrows (JSQLParserException .class ,
186+ () -> CCJSqlParserUtil .parseAST ("select * from dual;WHATEVER!!" ));
178187 }
179188
180189 @ Test
181190 public void testParseStatementsIssue691_2 () throws Exception {
182191 Statements result = CCJSqlParserUtil .parseStatements (
183192 "select * from dual;\n "
184- + "---test" );
193+ + "---test" );
185194 assertEquals ("SELECT * FROM dual;\n " , result .toString ());
186195 }
187196
@@ -193,9 +202,11 @@ public void testParseStatementIssue742() throws Exception {
193202 + " PRIMARY KEY (`id`),\n "
194203 + " UNIQUE KEY `uk_another_column_id` (`another_column_id`)\n "
195204 + ")" );
196- assertEquals ("CREATE TABLE `table_name` (`id` bigint (20) NOT NULL AUTO_INCREMENT, `another_column_id` "
197- + "bigint (20) NOT NULL COMMENT 'column id as sent by SYSTEM', PRIMARY KEY (`id`), UNIQUE KEY `uk_another_column_id` "
198- + "(`another_column_id`));\n " , result .toString ());
205+ assertEquals (
206+ "CREATE TABLE `table_name` (`id` bigint (20) NOT NULL AUTO_INCREMENT, `another_column_id` "
207+ + "bigint (20) NOT NULL COMMENT 'column id as sent by SYSTEM', PRIMARY KEY (`id`), UNIQUE KEY `uk_another_column_id` "
208+ + "(`another_column_id`));\n " ,
209+ result .toString ());
199210 }
200211
201212 @ Test
@@ -232,7 +243,8 @@ public void testNestingDepth() throws Exception {
232243 + " , a.id_instrument_type\n "
233244 + " , b.id_portfolio\n "
234245 + " , c.attribute_value product_code\n "
235- + " , t.valid_date\n " + " , t.ccf\n "
246+ + " , t.valid_date\n "
247+ + " , t.ccf\n "
236248 + " FROM cfe.instrument a\n "
237249 + " INNER JOIN cfe.impairment b\n "
238250 + " ON a.id_instrument = b.id_instrument\n "
@@ -258,26 +270,31 @@ public void testNestingDepth() throws Exception {
258270
259271 @ Test
260272 public void testParseStatementIssue1250 () throws Exception {
261- Statement result = CCJSqlParserUtil .parse ("Select test.* from (Select * from sch.PERSON_TABLE // root test\n ) as test" );
262- assertEquals ("SELECT test.* FROM (SELECT * FROM sch.PERSON_TABLE) AS test" , result .toString ());
273+ Statement result = CCJSqlParserUtil .parse (
274+ "Select test.* from (Select * from sch.PERSON_TABLE // root test\n ) as test" );
275+ assertEquals ("SELECT test.* FROM (SELECT * FROM sch.PERSON_TABLE) AS test" ,
276+ result .toString ());
263277 }
264278
265279 @ Test
266280 public void testCondExpressionIssue1482 () throws JSQLParserException {
267- Expression expr = CCJSqlParserUtil .parseCondExpression ("test_table_enum.f1_enum IN ('TEST2'::test.test_enum)" , false );
281+ Expression expr = CCJSqlParserUtil
282+ .parseCondExpression ("test_table_enum.f1_enum IN ('TEST2'::test.test_enum)" , false );
268283 assertEquals ("test_table_enum.f1_enum IN ('TEST2'::test.test_enum)" , expr .toString ());
269284 }
270285
271286 @ Test
272287 public void testCondExpressionIssue1482_2 () throws JSQLParserException {
273- Expression expr = CCJSqlParserUtil .parseCondExpression ("test_table_enum.f1_enum IN ('TEST2'::test.\" test_enum\" )" , false );
288+ Expression expr = CCJSqlParserUtil .parseCondExpression (
289+ "test_table_enum.f1_enum IN ('TEST2'::test.\" test_enum\" )" , false );
274290 assertEquals ("test_table_enum.f1_enum IN ('TEST2'::test.\" test_enum\" )" , expr .toString ());
275291 }
276292
277293 @ Test
278294 public void testTimeOutIssue1582 () throws InterruptedException {
279295 // This statement is INVALID on purpose
280- // There are crafted INTO keywords in order to make it fail but only after a long time (40 seconds plus)
296+ // There are crafted INTO keywords in order to make it fail but only after a long time (40
297+ // seconds plus)
281298
282299 String sqlStr = ""
283300 + "select\n "
@@ -309,15 +326,16 @@ public void execute() throws Throwable {
309326 }
310327 });
311328
312- // With custom TIMEOUT 60 Seconds, we expect the statement to not timeout but to fail instead
329+ // With custom TIMEOUT 60 Seconds, we expect the statement to not timeout but to fail
330+ // instead
313331 // No TimeoutException wrapped into a Parser Exception must be thrown
314332 // Instead we expect a Parser Exception only
315333 assertThrows (JSQLParserException .class , new Executable () {
316334 @ Override
317335 public void execute () throws Throwable {
318336 try {
319337 CCJSqlParserUtil .parse (sqlStr , parser -> {
320- parser .withTimeOut (10000 );
338+ parser .withTimeOut (60000 );
321339 parser .withAllowComplexParsing (false );
322340 });
323341 } catch (JSQLParserException ex ) {
0 commit comments