1212import java .io .File ;
1313import java .io .IOException ;
1414import java .util .Arrays ;
15+ import java .util .LinkedList ;
1516import java .util .List ;
1617import java .util .logging .Level ;
1718import java .util .logging .Logger ;
2122import static net .sf .jsqlparser .test .TestUtils .assertSqlCanBeParsedAndDeparsed ;
2223import org .apache .commons .io .FileUtils ;
2324import static org .junit .Assert .assertTrue ;
25+
26+ import org .assertj .core .api .Assertions ;
2427import org .junit .ComparisonFailure ;
2528import org .junit .Test ;
2629
@@ -245,6 +248,7 @@ public void testAllSqlsParseDeparse() throws IOException {
245248 public void testAllSqlsOnlyParse () throws IOException {
246249 File [] sqlTestFiles = new File (SQLS_DIR , "only-parse-test" ).listFiles ();
247250
251+ List <String > regressionFiles = new LinkedList <>();
248252 for (File file : sqlTestFiles ) {
249253 LOG .log (Level .INFO , "testing {0}" , file .getName ());
250254 String sql = FileUtils .readFileToString (file );
@@ -253,9 +257,12 @@ public void testAllSqlsOnlyParse() throws IOException {
253257
254258 LOG .info (" -> SUCCESS" );
255259 } catch (JSQLParserException ex ) {
260+ regressionFiles .add (file .getName ());
256261 LOG .log (Level .SEVERE , null , ex );
257262 }
258263 }
264+
265+ Assertions .assertThat (regressionFiles ).describedAs ("All files should parse successfully, a regression was detected!" ).isEmpty ();
259266 }
260267
261268 @ Test
0 commit comments