Update to strip away comment lines (e.g., copyright) and use -- comments

This commit is contained in:
2022-06-13 14:50:01 -05:00
parent 3187eceb22
commit 0c18c377e6
2 changed files with 21 additions and 20 deletions

View File

@ -57,6 +57,7 @@ public class TestUtils
InputStream primeTestDatabaseSqlStream = TestUtils.class.getResourceAsStream("/prime-test-database.sql"); InputStream primeTestDatabaseSqlStream = TestUtils.class.getResourceAsStream("/prime-test-database.sql");
assertNotNull(primeTestDatabaseSqlStream); assertNotNull(primeTestDatabaseSqlStream);
List<String> lines = (List<String>) IOUtils.readLines(primeTestDatabaseSqlStream); List<String> lines = (List<String>) IOUtils.readLines(primeTestDatabaseSqlStream);
lines = lines.stream().filter(line -> !line.startsWith("-- ")).toList();
String joinedSQL = String.join("\n", lines); String joinedSQL = String.join("\n", lines);
for(String sql : joinedSQL.split(";")) for(String sql : joinedSQL.split(";"))
{ {

View File

@ -1,23 +1,23 @@
/* --
* QQQ - Low-code Application Framework for Engineers. -- QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2022. Kingsrook, LLC -- Copyright (C) 2021-2022. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States -- 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com -- contact@kingsrook.com
* https://github.com/Kingsrook/ -- https://github.com/Kingsrook/
* --
* This program is free software: you can redistribute it and/or modify -- This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as -- it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the -- published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. -- License, or (at your option) any later version.
* --
* This program is distributed in the hope that it will be useful, -- This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of -- but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. -- GNU Affero General Public License for more details.
* --
* You should have received a copy of the GNU Affero General Public License -- You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ --
DROP TABLE IF EXISTS person; DROP TABLE IF EXISTS person;
CREATE TABLE person CREATE TABLE person