From d21cf392eb045838d89f1c8d1d3003c1a1ed9896 Mon Sep 17 00:00:00 2001 From: Romuald Rousseau Date: Thu, 3 Oct 2024 08:35:20 +0800 Subject: [PATCH] chore: Add Test Suites --- .../{bigdata => collections}/Chunk.java | 2 +- .../ChunkMetaData.java | 2 +- .../ChunkSerializer.java | 2 +- .../ChunkSerializerFactory.java | 6 +- .../CollectionUtils.java | 2 +- .../{bigdata => collections}/DataFrame.java | 2 +- .../DataFrameIterator.java | 2 +- .../DataFrameWriter.java | 2 +- .../{bigdata => collections}/DataView.java | 2 +- .../DataViewIterator.java | 2 +- .../commons/{bigdata => collections}/Row.java | 2 +- .../{bigdata => collections}/RowIterator.java | 2 +- .../serializer/ChunkSerializerFury.java | 6 +- .../serializer/ChunkSerializerJava.java | 6 +- .../archery/commons/io}/Disk.java | 2 +- .../archery/commons/io}/TempFile.java | 2 +- .../archery/commons/preprocessing/Text.java | 2 +- .../archery/commons/redux/Action.java | 33 --------- .../archery/commons/redux/Reducer.java | 5 -- .../archery/commons/redux/Store.java | 36 --------- .../archery/commons/redux/Subscriber.java | 5 -- .../archery/commons/FullTestSuite.java | 11 +++ ...est_BigData.java => Test_Collections.java} | 29 ++++---- .../archery/commons/Test_Python.java | 4 +- .../archery/commons/Test_Redux.java | 55 -------------- .../archery/commons/Test_RegexComparer.java | 22 +++++- .../archery/commons/Test_StringUtils.java | 8 +- .../archery/commons/Test_Tensor.java | 9 ++- .../archery/commons/Test_Text.java | 20 +++-- .../archery/commons/UnitTestSuite.java | 13 ++++ .../archery/loader/csv/CsvDocument.java | 2 +- .../archery/loader/csv/CsvSheet.java | 6 +- .../archery/FullTestSuite.java | 11 +++ .../archery/{AppTest.java => Test_CSV.java} | 8 +- .../archery/UnitTestSuite.java | 13 ++++ .../archery/loader/dbf/DbfDocument.java | 2 +- .../archery/loader/dbf/DbfSheet.java | 6 +- .../archery/FullTestSuite.java | 11 +++ .../archery/{AppTest.java => Test_DBF.java} | 7 +- .../archery/UnitTestSuite.java | 13 ++++ .../loader/excel/xlsx/ContentHandler.java | 6 +- .../archery/loader/excel/xlsx/XlsxSheet.java | 4 +- .../archery/FullTestSuite.java | 11 +++ .../archery/{AppTest.java => Test_Excel.java} | 9 ++- .../archery/UnitTestSuite.java | 13 ++++ .../archery/parser/LayexTableParser.java | 6 +- .../archery/{ => parser}/layex/Layex.java | 24 +++--- .../archery/{ => parser}/layex/Lexer.java | 2 +- .../{ => parser}/layex/StringLexer.java | 2 +- .../{ => parser}/layex/StringSymbol.java | 2 +- .../{ => parser}/layex/TableLexer.java | 2 +- .../{ => parser}/layex/TableMatcher.java | 2 +- .../{ => parser}/layex/TableParser.java | 2 +- .../{ => parser}/layex/operations/Any.java | 8 +- .../{ => parser}/layex/operations/Concat.java | 8 +- .../layex/operations/EndOfRow.java | 8 +- .../{ => parser}/layex/operations/Group.java | 8 +- .../layex/operations/Literal.java | 8 +- .../layex/operations/LiteralNeg.java | 8 +- .../{ => parser}/layex/operations/Many.java | 8 +- .../{ => parser}/layex/operations/Nop.java | 8 +- .../{ => parser}/layex/operations/Not.java | 8 +- .../{ => parser}/layex/operations/Or.java | 8 +- .../{ => parser}/layex/operations/Value.java | 8 +- .../layex/operations/ValueNeg.java | 8 +- .../archery/parser/table/DataTableParser.java | 2 +- .../archery/parser/table/MetaTableParser.java | 2 +- .../archery/FullTestSuite.java | 11 +++ .../romualdrousseau/archery/Test_Layexes.java | 10 ++- .../archery/UnitTestSuite.java | 13 ++++ .../archery/FullTestSuite.java | 11 +++ .../archery/{classifier => }/Test_LLM.java | 10 ++- .../archery/UnitTestSuite.java | 13 ++++ .../archery/classifier/NetTagClassifier.java | 4 +- .../classifier/TrainingSetBuilder.java | 2 +- .../archery/FullTestSuite.java | 11 +++ .../{classifier => }/Test_TrainingEntry.java | 11 ++- .../archery/UnitTestSuite.java | 13 ++++ .../loader/parquet/ParquetDocument.java | 2 +- .../archery/loader/parquet/ParquetSheet.java | 6 +- .../archery/FullTestSuite.java | 11 +++ .../{AppTest.java => Test_Parquet.java} | 7 +- .../archery/UnitTestSuite.java | 13 ++++ .../archery/loader/pdf/PdfDocument.java | 2 +- .../archery/loader/pdf/PdfSheet.java | 6 +- .../romualdrousseau/archery/AppTest.java | 60 --------------- .../archery/FullTestSuite.java | 11 +++ .../romualdrousseau/archery/Test_PDF.java | 70 ++++++++++++++++++ .../archery/UnitTestSuite.java | 13 ++++ .../Panama - BM - BGA - Sales - 20230601.pdf | Bin 0 -> 12426 bytes .../archery/base/BaseSheet.java | 2 +- .../archery/intelli/IntelliRow.java | 2 +- .../archery/intelli/IntelliTable.java | 6 +- .../archery/FullTestSuite.java | 11 +++ .../archery/Test_Any2Json.java | 14 +++- .../archery/UnitTestSuite.java | 13 ++++ justfile | 4 +- pom.xml | 15 +++- 98 files changed, 571 insertions(+), 366 deletions(-) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/Chunk.java (92%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/ChunkMetaData.java (88%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/ChunkSerializer.java (73%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/ChunkSerializerFactory.java (94%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{types => collections}/CollectionUtils.java (87%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/DataFrame.java (98%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/DataFrameIterator.java (90%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/DataFrameWriter.java (97%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/DataView.java (96%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/DataViewIterator.java (90%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/Row.java (96%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/RowIterator.java (89%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/serializer/ChunkSerializerFury.java (80%) rename archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/{bigdata => collections}/serializer/ChunkSerializerJava.java (81%) rename {archery/src/main/java/com/github/romualdrousseau/archery/util => archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/io}/Disk.java (98%) rename {archery/src/main/java/com/github/romualdrousseau/archery/util => archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/io}/TempFile.java (89%) delete mode 100644 archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Action.java delete mode 100644 archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Reducer.java delete mode 100644 archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Store.java delete mode 100644 archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Subscriber.java create mode 100644 archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/FullTestSuite.java rename archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/{Test_BigData.java => Test_Collections.java} (88%) delete mode 100644 archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Redux.java create mode 100644 archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/UnitTestSuite.java create mode 100644 archery-csv/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java rename archery-csv/src/test/java/com/github/romualdrousseau/archery/{AppTest.java => Test_CSV.java} (95%) create mode 100644 archery-csv/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java create mode 100644 archery-dbf/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java rename archery-dbf/src/test/java/com/github/romualdrousseau/archery/{AppTest.java => Test_DBF.java} (95%) create mode 100644 archery-dbf/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java create mode 100644 archery-excel/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java rename archery-excel/src/test/java/com/github/romualdrousseau/archery/{AppTest.java => Test_Excel.java} (96%) create mode 100644 archery-excel/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/Layex.java (86%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/Lexer.java (79%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/StringLexer.java (95%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/StringSymbol.java (90%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/TableLexer.java (98%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/TableMatcher.java (82%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/TableParser.java (92%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/operations/Any.java (70%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/operations/Concat.java (75%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/operations/EndOfRow.java (69%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/operations/Group.java (76%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/operations/Literal.java (74%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/operations/LiteralNeg.java (75%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/operations/Many.java (82%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/operations/Nop.java (56%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/operations/Not.java (73%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/operations/Or.java (78%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/operations/Value.java (73%) rename archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/{ => parser}/layex/operations/ValueNeg.java (74%) create mode 100644 archery-layex-parser/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java create mode 100644 archery-layex-parser/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java create mode 100644 archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java rename archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/{classifier => }/Test_LLM.java (96%) create mode 100644 archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java create mode 100644 archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java rename archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/{classifier => }/Test_TrainingEntry.java (88%) create mode 100644 archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java create mode 100644 archery-parquet/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java rename archery-parquet/src/test/java/com/github/romualdrousseau/archery/{AppTest.java => Test_Parquet.java} (94%) create mode 100644 archery-parquet/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java delete mode 100644 archery-pdf/src/test/java/com/github/romualdrousseau/archery/AppTest.java create mode 100644 archery-pdf/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java create mode 100644 archery-pdf/src/test/java/com/github/romualdrousseau/archery/Test_PDF.java create mode 100644 archery-pdf/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java create mode 100644 archery-pdf/src/test/resources/data/Panama - BM - BGA - Sales - 20230601.pdf create mode 100644 archery/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java create mode 100644 archery/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/Chunk.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/Chunk.java similarity index 92% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/Chunk.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/Chunk.java index 8c188c04..8f926444 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/Chunk.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/Chunk.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.bigdata; +package com.github.romualdrousseau.archery.commons.collections; import java.util.ArrayList; import java.util.List; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/ChunkMetaData.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/ChunkMetaData.java similarity index 88% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/ChunkMetaData.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/ChunkMetaData.java index ca53b18c..fe888eca 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/ChunkMetaData.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/ChunkMetaData.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.bigdata; +package com.github.romualdrousseau.archery.commons.collections; public class ChunkMetaData { diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/ChunkSerializer.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/ChunkSerializer.java similarity index 73% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/ChunkSerializer.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/ChunkSerializer.java index 15f65c98..6d582e05 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/ChunkSerializer.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/ChunkSerializer.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.bigdata; +package com.github.romualdrousseau.archery.commons.collections; import java.io.IOException; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/ChunkSerializerFactory.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/ChunkSerializerFactory.java similarity index 94% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/ChunkSerializerFactory.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/ChunkSerializerFactory.java index 0608291b..312ba3f3 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/ChunkSerializerFactory.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/ChunkSerializerFactory.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.bigdata; +package com.github.romualdrousseau.archery.commons.collections; import java.io.IOException; import java.io.InputStream; @@ -11,8 +11,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.github.romualdrousseau.archery.commons.bigdata.serializer.ChunkSerializerFury; -import com.github.romualdrousseau.archery.commons.bigdata.serializer.ChunkSerializerJava; +import com.github.romualdrousseau.archery.commons.collections.serializer.ChunkSerializerFury; +import com.github.romualdrousseau.archery.commons.collections.serializer.ChunkSerializerJava; public class ChunkSerializerFactory { diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/types/CollectionUtils.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/CollectionUtils.java similarity index 87% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/types/CollectionUtils.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/CollectionUtils.java index df9554d1..87b1eddd 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/types/CollectionUtils.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/CollectionUtils.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.types; +package com.github.romualdrousseau.archery.commons.collections; import java.util.ArrayList; import java.util.Collections; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataFrame.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataFrame.java similarity index 98% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataFrame.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataFrame.java index 879f1183..db7874ed 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataFrame.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataFrame.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.bigdata; +package com.github.romualdrousseau.archery.commons.collections; import java.io.Closeable; import java.io.IOException; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataFrameIterator.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataFrameIterator.java similarity index 90% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataFrameIterator.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataFrameIterator.java index 5c4b955b..183deca1 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataFrameIterator.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataFrameIterator.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.bigdata; +package com.github.romualdrousseau.archery.commons.collections; import java.util.Iterator; import java.util.Spliterator; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataFrameWriter.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataFrameWriter.java similarity index 97% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataFrameWriter.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataFrameWriter.java index 4b16a6bc..9717a11d 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataFrameWriter.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataFrameWriter.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.bigdata; +package com.github.romualdrousseau.archery.commons.collections; import java.io.Closeable; import java.io.IOException; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataView.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataView.java similarity index 96% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataView.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataView.java index 43919d16..67af5191 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataView.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataView.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.bigdata; +package com.github.romualdrousseau.archery.commons.collections; import java.util.Iterator; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataViewIterator.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataViewIterator.java similarity index 90% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataViewIterator.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataViewIterator.java index 0d5b005a..f36b042a 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/DataViewIterator.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/DataViewIterator.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.bigdata; +package com.github.romualdrousseau.archery.commons.collections; import java.util.Iterator; import java.util.Spliterator; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/Row.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/Row.java similarity index 96% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/Row.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/Row.java index bffec296..12af238a 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/Row.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/Row.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.bigdata; +package com.github.romualdrousseau.archery.commons.collections; import java.io.Serializable; import java.util.Iterator; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/RowIterator.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/RowIterator.java similarity index 89% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/RowIterator.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/RowIterator.java index 2154a4a9..01319b46 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/RowIterator.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/RowIterator.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.bigdata; +package com.github.romualdrousseau.archery.commons.collections; import java.util.Iterator; import java.util.Spliterator; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/serializer/ChunkSerializerFury.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/serializer/ChunkSerializerFury.java similarity index 80% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/serializer/ChunkSerializerFury.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/serializer/ChunkSerializerFury.java index 455d5b84..ead2686a 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/serializer/ChunkSerializerFury.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/serializer/ChunkSerializerFury.java @@ -1,11 +1,11 @@ -package com.github.romualdrousseau.archery.commons.bigdata.serializer; +package com.github.romualdrousseau.archery.commons.collections.serializer; import java.io.IOException; import org.xerial.snappy.Snappy; -import com.github.romualdrousseau.archery.commons.bigdata.ChunkSerializer; -import com.github.romualdrousseau.archery.commons.bigdata.Row; +import com.github.romualdrousseau.archery.commons.collections.ChunkSerializer; +import com.github.romualdrousseau.archery.commons.collections.Row; import io.fury.Fury; import io.fury.config.Language; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/serializer/ChunkSerializerJava.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/serializer/ChunkSerializerJava.java similarity index 81% rename from archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/serializer/ChunkSerializerJava.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/serializer/ChunkSerializerJava.java index d8060c95..d8d17c11 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/bigdata/serializer/ChunkSerializerJava.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/collections/serializer/ChunkSerializerJava.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.commons.bigdata.serializer; +package com.github.romualdrousseau.archery.commons.collections.serializer; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -6,8 +6,8 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import com.github.romualdrousseau.archery.commons.bigdata.ChunkSerializer; -import com.github.romualdrousseau.archery.commons.bigdata.Row; +import com.github.romualdrousseau.archery.commons.collections.ChunkSerializer; +import com.github.romualdrousseau.archery.commons.collections.Row; public class ChunkSerializerJava implements ChunkSerializer { diff --git a/archery/src/main/java/com/github/romualdrousseau/archery/util/Disk.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/io/Disk.java similarity index 98% rename from archery/src/main/java/com/github/romualdrousseau/archery/util/Disk.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/io/Disk.java index 8a773bf3..48716c75 100644 --- a/archery/src/main/java/com/github/romualdrousseau/archery/util/Disk.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/io/Disk.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.util; +package com.github.romualdrousseau.archery.commons.io; import java.io.File; import java.io.FileInputStream; diff --git a/archery/src/main/java/com/github/romualdrousseau/archery/util/TempFile.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/io/TempFile.java similarity index 89% rename from archery/src/main/java/com/github/romualdrousseau/archery/util/TempFile.java rename to archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/io/TempFile.java index 2643b666..f9a9665f 100644 --- a/archery/src/main/java/com/github/romualdrousseau/archery/util/TempFile.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/io/TempFile.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.util; +package com.github.romualdrousseau.archery.commons.io; import java.io.Closeable; import java.io.IOException; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/preprocessing/Text.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/preprocessing/Text.java index b6bddb76..c75d6fd4 100644 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/preprocessing/Text.java +++ b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/preprocessing/Text.java @@ -10,7 +10,7 @@ import java.util.stream.IntStream; import java.util.stream.Stream; -import com.github.romualdrousseau.archery.commons.types.CollectionUtils; +import com.github.romualdrousseau.archery.commons.collections.CollectionUtils; import com.github.romualdrousseau.archery.commons.json.JSON; import com.github.romualdrousseau.archery.commons.json.JSONArray; import com.github.romualdrousseau.archery.commons.preprocessing.hasher.DefaultHasher; diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Action.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Action.java deleted file mode 100644 index f160414e..00000000 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Action.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.github.romualdrousseau.archery.commons.redux; - -import java.util.function.Supplier; - -public class Action implements Supplier { - - private final String type; - - public Action(final String type) { - this.type = type; - } - - public String getType() { - return this.type; - } - - public int hashCode() { - return this.type.hashCode(); - } - - public boolean equals(final Object obj) { - if (!(obj instanceof Action)) { - return false; - } - final var otherAction = (Action) obj; - return this.type.equals(otherAction.type); - } - - @Override - public Action get() { - return this; - } -} diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Reducer.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Reducer.java deleted file mode 100644 index 4db6d1a6..00000000 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Reducer.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.github.romualdrousseau.archery.commons.redux; - -import java.util.function.BiFunction; - -public interface Reducer extends BiFunction {} diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Store.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Store.java deleted file mode 100644 index 372833bd..00000000 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Store.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.github.romualdrousseau.archery.commons.redux; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class Store { - - private final Map>> subscribers = new HashMap<>(); - private final List> reducers = new ArrayList<>(); - private S state; - - public Store(final S state) { - this.state = state; - } - - public S getState() { - return this.state; - } - - public void addSubscriber(final A action, final Subscriber subscriber) { - this.subscribers.computeIfAbsent(action, x -> new ArrayList<>()).add(subscriber); - } - - public void addReducer(final Reducer reducer) { - this.reducers.add(reducer); - } - - public void dispatch(final A action) { - @SuppressWarnings("unchecked") final var result = (A) action.get(); - this.state = reducers.stream().reduce(this.state, (x, y) -> y.apply(x, result), (x, y) -> y); - this.subscribers.getOrDefault(result, Collections.emptyList()).forEach(x -> x.accept(this, result)); - } -} diff --git a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Subscriber.java b/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Subscriber.java deleted file mode 100644 index 4388e1f4..00000000 --- a/archery-commons/src/main/java/com/github/romualdrousseau/archery/commons/redux/Subscriber.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.github.romualdrousseau.archery.commons.redux; - -import java.util.function.BiConsumer; - -public interface Subscriber extends BiConsumer, A> {} diff --git a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/FullTestSuite.java b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/FullTestSuite.java new file mode 100644 index 00000000..6999da5c --- /dev/null +++ b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/FullTestSuite.java @@ -0,0 +1,11 @@ +package com.github.romualdrousseau.archery.commons; + +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags({"unit", "full"}) +@SelectPackages("com.github.romualdrousseau.archery.commons") +public class FullTestSuite { +} diff --git a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_BigData.java b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Collections.java similarity index 88% rename from archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_BigData.java rename to archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Collections.java index b168ead0..d043f0a6 100644 --- a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_BigData.java +++ b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Collections.java @@ -4,25 +4,26 @@ import static org.junit.Assert.assertThrows; import java.io.IOException; -import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.IntStream; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Tag; -import com.github.romualdrousseau.archery.commons.bigdata.ChunkSerializer; -import com.github.romualdrousseau.archery.commons.bigdata.ChunkSerializerFactory; -import com.github.romualdrousseau.archery.commons.bigdata.ChunkSerializerFactory.SerializerType; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrameWriter; -import com.github.romualdrousseau.archery.commons.bigdata.Row; +import com.github.romualdrousseau.archery.commons.collections.ChunkSerializer; +import com.github.romualdrousseau.archery.commons.collections.ChunkSerializerFactory; +import com.github.romualdrousseau.archery.commons.collections.DataFrameWriter; +import com.github.romualdrousseau.archery.commons.collections.Row; +import com.github.romualdrousseau.archery.commons.collections.ChunkSerializerFactory.SerializerType; -public class Test_BigData { +public class Test_Collections { private final ChunkSerializer serializer = ChunkSerializerFactory.newInstance(SerializerType.FURY); @Test + @Tag("unit") public void testSerialize() throws IOException { final var rows = IntStream.range(0, 10000) .mapToObj(i -> Row.of(IntStream.range(0, 1000) @@ -42,6 +43,7 @@ public void testSerialize() throws IOException { } @Test + @Tag("unit") public void testDataFrameWhole() throws IOException { try (final var writer = new DataFrameWriter(100, 10)) { for (int i = 0; i < 10; i++) { @@ -60,6 +62,7 @@ public void testDataFrameWhole() throws IOException { } @Test + @Tag("unit") public void testDataFrameFullView() throws IOException { try (final var writer = new DataFrameWriter(100, 10)) { for (int i = 0; i < 10; i++) { @@ -79,6 +82,7 @@ public void testDataFrameFullView() throws IOException { } @Test + @Tag("unit") public void testDataFramePartialView() throws IOException { try (final var writer = new DataFrameWriter(100, 100)) { for (int i = 0; i < 5000; i++) { @@ -98,6 +102,7 @@ public void testDataFramePartialView() throws IOException { } @Test + @Tag("unit") public void testDataFrameRandom() throws IOException { try (final var writer = new DataFrameWriter(100, 100)) { for (int i = 0; i < 5000; i++) { @@ -113,10 +118,8 @@ public void testDataFrameRandom() throws IOException { } @Test + @Tag("full") public void testDataFrameMassive() throws IOException { - if (!Path.of("/mnt/media2").toFile().exists()) { - return; - } try (final var writer = new DataFrameWriter(10000, 1000)) { for (int i = 0; i < 10000000; i++) { writer.write(Row.of(IntStream.range(0, writer.getColumnCount()) @@ -134,10 +137,8 @@ public void testDataFrameMassive() throws IOException { } @Test + @Tag("full") public void testArrayListMassive() { - if (!Path.of("/mnt/media2").toFile().exists()) { - return; - } assertThrows(OutOfMemoryError.class, () -> { final var list = new ArrayList(); for (int i = 0; i < 10000000; i++) { diff --git a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Python.java b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Python.java index c45d82bf..4c893e68 100644 --- a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Python.java +++ b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Python.java @@ -7,13 +7,15 @@ import java.time.ZoneId; import java.util.Date; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Tag; import com.github.romualdrousseau.archery.commons.python.PythonSimpleDateFormat; public class Test_Python { @Test + @Tag("unit") public void testPythonSimpleDateformat() throws ParseException { final PythonSimpleDateFormat formatter = new PythonSimpleDateFormat("%a,%d/%m/%y"); assertEquals("Sun,24/09/23", formatter.format(Date.from(LocalDate.of(2023, 9, 24).atStartOfDay(ZoneId.systemDefault()).toInstant()))); diff --git a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Redux.java b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Redux.java deleted file mode 100644 index 46ee53a2..00000000 --- a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Redux.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.github.romualdrousseau.archery.commons; - -import static org.junit.Assert.assertEquals; - -import java.util.HashMap; - -import org.junit.Test; - -import com.github.romualdrousseau.archery.commons.redux.Action; -import com.github.romualdrousseau.archery.commons.redux.Store; - -public class Test_Redux { - - @Test - public void testStoreNoReducerNoSbuscriber() { - final var state = new HashMap(); - final var store = new Store, Action>(state); - final var testAction = new Action("test"); - store.dispatch(testAction); - } - - @Test - public void testStoreNoReducerWithSubscriber() { - final var state = new HashMap(); - final var store = new Store, Action>(state); - final var testAction = new Action("test"); - store.addSubscriber(testAction, (s, a) -> assertEquals("test", a.getType())); - store.dispatch(testAction); - } - - @Test - public void testStoreWithReducerAndSubscribers() { - final var state = new HashMap(); - state.put("counter", 0); - - final var store = new Store, Action>(state); - store.addReducer((s, a) -> { - if (a.getType().equals("inc")) { - s.computeIfPresent("counter", (x, y) -> y + 1); - } - if (a.getType().equals("dec")) { - s.computeIfPresent("counter", (x, y) -> y - 1); - } - return s; - }); - - final var incAction = new Action("inc"); - final var decAction = new Action("dec"); - - store.addSubscriber(incAction, (s, a) -> assertEquals(Integer.valueOf(1), s.getState().get("counter"))); - store.addSubscriber(decAction, (s, a) -> assertEquals(Integer.valueOf(0), s.getState().get("counter"))); - store.dispatch(incAction); - store.dispatch(decAction); - } -} diff --git a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_RegexComparer.java b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_RegexComparer.java index a2e7c78e..dadbb062 100644 --- a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_RegexComparer.java +++ b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_RegexComparer.java @@ -10,18 +10,20 @@ import java.util.Map; import java.util.stream.Stream; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Tag; import com.github.romualdrousseau.archery.commons.preprocessing.comparer.RegexComparer; - +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class Test_RegexComparer { private Map patterns; private List bagOfWords; - @Before + @BeforeAll public void setUp() { this.patterns = new HashMap<>(); patterns.put("\\d{1,4}[/|.|-]\\d{1,2}[/|.|-]\\d{1,4}", "DATE"); @@ -31,18 +33,21 @@ public void setUp() { } @Test + @Tag("unit") public void testApplyNullValuesInList() { final var rc = new RegexComparer(this.patterns); assertFalse(rc.apply(null, this.bagOfWords)); } @Test + @Tag("unit") public void testApplyEmptyList() { final var rc = new RegexComparer(this.patterns); assertFalse(rc.apply("NUMBER", Collections.emptyList())); } @Test + @Tag("unit") public void testApplyMatchingPattern() { final var rc = new RegexComparer(this.patterns); assertTrue(rc.apply("NUMBER", this.bagOfWords)); @@ -50,6 +55,7 @@ public void testApplyMatchingPattern() { } @Test + @Tag("unit") public void testApplyNonMatchingPattern() { final var rc = new RegexComparer(this.patterns); assertFalse(rc.apply("NUMBER", this.bagOfWords.stream().skip(2).toList())); @@ -57,6 +63,7 @@ public void testApplyNonMatchingPattern() { } @Test + @Tag("unit") public void testAnonymizeMatchingPattern() { final var rc = new RegexComparer(this.patterns); assertEquals("NUMBER", rc.anonymize(this.bagOfWords.get(0))); @@ -64,6 +71,7 @@ public void testAnonymizeMatchingPattern() { } @Test + @Tag("unit") public void testAnonymizeNonMatchingPattern() { final var rc = new RegexComparer(this.patterns); assertEquals(this.bagOfWords.get(2), rc.anonymize(this.bagOfWords.get(2))); @@ -71,6 +79,7 @@ public void testAnonymizeNonMatchingPattern() { } @Test + @Tag("unit") public void testAnonymizeMatchingPatternWithFilter() { final var rc = new RegexComparer(this.patterns); assertEquals("NUMBER", rc.anonymize(this.bagOfWords.get(0), "NUMBER")); @@ -78,6 +87,7 @@ public void testAnonymizeMatchingPatternWithFilter() { } @Test + @Tag("unit") public void testAnonymizeNonMatchingPatternWithFilter() { final var rc = new RegexComparer(this.patterns); assertEquals(this.bagOfWords.get(0), rc.anonymize(this.bagOfWords.get(0), "DATE")); @@ -85,6 +95,7 @@ public void testAnonymizeNonMatchingPatternWithFilter() { } @Test + @Tag("unit") public void testFindMatchingPattern() { final var rc = new RegexComparer(this.patterns); assertEquals("1000.25", rc.find(this.bagOfWords.get(0)).get()); @@ -92,6 +103,7 @@ public void testFindMatchingPattern() { } @Test + @Tag("unit") public void testFindNonMatchingPattern() { final var rc = new RegexComparer(this.patterns); assertTrue(rc.find(this.bagOfWords.get(2)).isEmpty()); @@ -99,6 +111,7 @@ public void testFindNonMatchingPattern() { } @Test + @Tag("unit") public void testFindMatchingPatternWithFilter() { final var rc = new RegexComparer(this.patterns); final var expected = List.of("1000.25", "2024-01-01"); @@ -107,6 +120,7 @@ public void testFindMatchingPatternWithFilter() { } @Test + @Tag("unit") public void testFindNonMatchingPatternWithFilter() { final var rc = new RegexComparer(this.patterns); assertTrue(rc.find(this.bagOfWords.get(0), "DATE").isEmpty()); diff --git a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_StringUtils.java b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_StringUtils.java index 6ccec112..adc6328d 100644 --- a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_StringUtils.java +++ b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_StringUtils.java @@ -4,7 +4,8 @@ import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Tag; import com.github.romualdrousseau.archery.commons.preprocessing.tokenizer.ShingleTokenizer; import com.github.romualdrousseau.archery.commons.strings.StringUtils; @@ -12,6 +13,7 @@ public class Test_StringUtils { @Test + @Tag("unit") public void testSnakeWithLemmatization() { final var tokenizer = new ShingleTokenizer(List.of("al", "total,tot", "dollar", "percent")); assertEquals("total_quantity_dollar", StringUtils.toSnake("total quantity $", tokenizer)); @@ -23,6 +25,7 @@ public void testSnakeWithLemmatization() { } @Test + @Tag("unit") public void testSnakeWithoutLemmatization() { final var tokenizer = new ShingleTokenizer(List.of("al", "total,tot", "dollar", "percent"), 1, false); assertEquals("total_quantity_dollar", StringUtils.toSnake("total quantity $", tokenizer)); @@ -34,6 +37,7 @@ public void testSnakeWithoutLemmatization() { } @Test + @Tag("unit") public void testCamelWithLemmatization() { final var tokenizer = new ShingleTokenizer(List.of("al", "total,tot", "dollar", "percent")); assertEquals("totalQuantityDollar", StringUtils.toCamel("total quantity $", tokenizer)); @@ -45,6 +49,7 @@ public void testCamelWithLemmatization() { } @Test + @Tag("unit") public void testCamelWithoutLemmatization() { final var tokenizer = new ShingleTokenizer(List.of("al", "total,tot", "dollar", "percent"), 1, false); assertEquals("totQuantityDollar", StringUtils.toCamel("tot quantity $", tokenizer)); @@ -56,6 +61,7 @@ public void testCamelWithoutLemmatization() { } @Test + @Tag("unit") public void testCleanToken() { assertEquals("total quantity $", StringUtils.cleanToken(" total quantity $ ")); assertEquals("total quantity $", StringUtils.cleanToken(" \"\"\" total quantity $ \"\"\"")); diff --git a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Tensor.java b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Tensor.java index 61402414..e16ea3db 100644 --- a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Tensor.java +++ b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Tensor.java @@ -8,13 +8,15 @@ import org.hamcrest.BaseMatcher; import org.hamcrest.Description; import org.hamcrest.Matcher; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Tag; import com.github.romualdrousseau.archery.commons.types.Tensor; public class Test_Tensor { @Test + @Tag("unit") public void testNull() { final Tensor M1 = Tensor.Null; final Tensor M2 = Tensor.zeros(1); @@ -23,6 +25,7 @@ public void testNull() { } @Test + @Tag("unit") public void testZero() { final Tensor M1 = Tensor.zeros(4); final Tensor M2 = Tensor.of(0, 0, 0, 0); @@ -32,6 +35,7 @@ public void testZero() { } @Test + @Tag("unit") public void testEquals() { final Tensor M1 = Tensor.of(1, 2, 3, 4, 5); final Tensor M2 = Tensor.of(1, 2, 3, 4, 5); @@ -43,6 +47,7 @@ public void testEquals() { } @Test + @Tag("unit") public void testIAdd() { final Tensor M1 = Tensor.of(1, 2, 3, 4, 5); final Tensor M2 = Tensor.of(2, 4, 6, 8, 10); @@ -51,6 +56,7 @@ public void testIAdd() { } @Test + @Tag("unit") public void testIf_lt_then() { final Tensor M1 = Tensor.of(1, 2, 3, 4, 5); final Tensor M2 = Tensor.of(0, 0, 1, 1, 1); @@ -59,6 +65,7 @@ public void testIf_lt_then() { } @Test + @Tag("unit") public void testArgMax() { final Tensor M1 = Tensor.Null; final Tensor M2 = Tensor.of(1, 2, 5, 4, 3); diff --git a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Text.java b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Text.java index 039badf4..335a4265 100644 --- a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Text.java +++ b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/Test_Text.java @@ -9,20 +9,22 @@ import java.util.Map; import java.util.stream.Stream; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.Tag; import com.github.romualdrousseau.archery.commons.preprocessing.Text; import com.github.romualdrousseau.archery.commons.preprocessing.comparer.RegexComparer; - +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class Test_Text { private Map patterns; private List classes; private List bagOfWords; - @Before + @BeforeAll public void setUp() { this.patterns = new HashMap<>(); patterns.put("\\d{1,4}[/|.|-]\\d{1,2}[/|.|-]\\d{1,4}", "DATE"); @@ -30,22 +32,26 @@ public void setUp() { this.classes = List.of("DATE", "NUMBER"); - this.bagOfWords = Stream.of("1000.25", "Date: 2024-01-01", "some words", "2 words: word1 and word2", null).toList(); + this.bagOfWords = Stream.of("1000.25", "Date: 2024-01-01", "some words", "2 words: word1 and word2", null) + .toList(); } @Test + @Tag("unit") public void testAllWords() { final var expected = List.of("01", "1000", "2", "2024", "25", "and", "date", "some", "word1", "word2", "words"); assertEquals(expected, Text.all_words(this.bagOfWords)); } @Test + @Tag("unit") public void testToWords() { final var expected = List.of("2", "words", "word1", "and", "word2"); assertEquals(expected, Text.to_words(this.bagOfWords.get(3))); } @Test + @Tag("unit") public void testToCategorical() { final var comparer = new RegexComparer(this.patterns); assertEquals(List.of(0, 1), Text.to_categorical(this.bagOfWords.get(0), this.classes, comparer)); @@ -55,6 +61,7 @@ public void testToCategorical() { } @Test + @Tag("unit") public void testAnonymize() { final var comparer = new RegexComparer(this.patterns); final var expected = Stream.of("NUMBER", "Date: DATE", "some words", "2 words: word1 and word2", null).toList(); @@ -65,12 +72,14 @@ public void testAnonymize() { } @Test + @Tag("unit") public void testOnehot() { final var expected = List.of("2", "words", "word1", "and", "word2").stream().map(x -> x.hashCode()).toList(); assertEquals(expected, Text.one_hot(this.bagOfWords.get(3))); } @Test + @Tag("unit") public void testPadSequence() { final var value = List.of(0, 1, 2, 3); final var expected = List.of(0, 1, 2, 3, 0, 0, 0, 0); @@ -78,6 +87,7 @@ public void testPadSequence() { } @Test + @Tag("unit") public void testMutateSequence() { final var value = List.of(0, 1, 2, 3); assertTrue(Text.mutate_sequence(value).size() < value.size()); diff --git a/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/UnitTestSuite.java b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/UnitTestSuite.java new file mode 100644 index 00000000..1cf3078a --- /dev/null +++ b/archery-commons/src/test/java/com/github/romualdrousseau/archery/commons/UnitTestSuite.java @@ -0,0 +1,13 @@ +package com.github.romualdrousseau.archery.commons; + +import org.junit.platform.suite.api.ExcludeTags; +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags("unit") +@ExcludeTags("full") +@SelectPackages("com.github.romualdrousseau.archery.commons") +public class UnitTestSuite { +} diff --git a/archery-csv/src/main/java/com/github/romualdrousseau/archery/loader/csv/CsvDocument.java b/archery-csv/src/main/java/com/github/romualdrousseau/archery/loader/csv/CsvDocument.java index 279c5259..7ca6eb6a 100644 --- a/archery-csv/src/main/java/com/github/romualdrousseau/archery/loader/csv/CsvDocument.java +++ b/archery-csv/src/main/java/com/github/romualdrousseau/archery/loader/csv/CsvDocument.java @@ -12,7 +12,7 @@ import com.github.romualdrousseau.archery.base.BaseDocument; import com.github.romualdrousseau.archery.base.BaseSheet; import com.github.romualdrousseau.archery.transform.op.DropColumnsWhenFillRatioLessThan; -import com.github.romualdrousseau.archery.util.Disk; +import com.github.romualdrousseau.archery.commons.io.Disk; import com.github.romualdrousseau.archery.commons.strings.StringUtils; public class CsvDocument extends BaseDocument { diff --git a/archery-csv/src/main/java/com/github/romualdrousseau/archery/loader/csv/CsvSheet.java b/archery-csv/src/main/java/com/github/romualdrousseau/archery/loader/csv/CsvSheet.java index ad2ac20c..6e66e029 100644 --- a/archery-csv/src/main/java/com/github/romualdrousseau/archery/loader/csv/CsvSheet.java +++ b/archery-csv/src/main/java/com/github/romualdrousseau/archery/loader/csv/CsvSheet.java @@ -6,9 +6,9 @@ import java.util.ArrayList; import com.github.romualdrousseau.archery.base.PatcheableSheetStore; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrame; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrameWriter; -import com.github.romualdrousseau.archery.commons.bigdata.Row; +import com.github.romualdrousseau.archery.commons.collections.DataFrame; +import com.github.romualdrousseau.archery.commons.collections.DataFrameWriter; +import com.github.romualdrousseau.archery.commons.collections.Row; import com.github.romualdrousseau.archery.commons.strings.StringUtils; import com.github.romualdrousseau.archery.commons.types.Tensor; diff --git a/archery-csv/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java b/archery-csv/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java new file mode 100644 index 00000000..f46854ae --- /dev/null +++ b/archery-csv/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java @@ -0,0 +1,11 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags({"unit", "full"}) +@SelectPackages("com.github.romualdrousseau.archery") +public class FullTestSuite { +} diff --git a/archery-csv/src/test/java/com/github/romualdrousseau/archery/AppTest.java b/archery-csv/src/test/java/com/github/romualdrousseau/archery/Test_CSV.java similarity index 95% rename from archery-csv/src/test/java/com/github/romualdrousseau/archery/AppTest.java rename to archery-csv/src/test/java/com/github/romualdrousseau/archery/Test_CSV.java index 50eeef9b..cf51e1f2 100644 --- a/archery-csv/src/test/java/com/github/romualdrousseau/archery/AppTest.java +++ b/archery-csv/src/test/java/com/github/romualdrousseau/archery/Test_CSV.java @@ -7,17 +7,19 @@ import java.io.File; import java.net.URISyntaxException; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Tag; /** * Unit test for simple App. */ -public class AppTest { +public class Test_CSV { /** * Rigorous Test :-) */ @Test + @Tag("unit") public void testReadWithoutIntelliTag() { final File file = this.getResourceFile("Singapore - ZUELLIG - Sales - 202101.csv"); @@ -37,6 +39,7 @@ public void testReadWithoutIntelliTag() { * Rigorous Test :-) */ @Test + @Tag("unit") public void testReadWithoutIntelliTagAndWithPivot() { final File file = this.getResourceFile("Bulgaria - IQVIA NATIONAL Other pharmacy - Product Sales - 202306.csv"); @@ -58,6 +61,7 @@ public void testReadWithoutIntelliTagAndWithPivot() { * Rigorous Test :-) */ @Test + @Tag("unit") public void testReadWithIntelliTag() { final File file = this.getResourceFile("Singapore - ZUELLIG - Sales - 202101.csv"); diff --git a/archery-csv/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java b/archery-csv/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java new file mode 100644 index 00000000..011a5909 --- /dev/null +++ b/archery-csv/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java @@ -0,0 +1,13 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.ExcludeTags; +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags("unit") +@ExcludeTags("full") +@SelectPackages("com.github.romualdrousseau.archery") +public class UnitTestSuite { +} diff --git a/archery-dbf/src/main/java/com/github/romualdrousseau/archery/loader/dbf/DbfDocument.java b/archery-dbf/src/main/java/com/github/romualdrousseau/archery/loader/dbf/DbfDocument.java index 19bbf53e..957cbb2d 100644 --- a/archery-dbf/src/main/java/com/github/romualdrousseau/archery/loader/dbf/DbfDocument.java +++ b/archery-dbf/src/main/java/com/github/romualdrousseau/archery/loader/dbf/DbfDocument.java @@ -12,7 +12,7 @@ import com.github.romualdrousseau.archery.Sheet; import com.github.romualdrousseau.archery.base.BaseDocument; import com.github.romualdrousseau.archery.base.BaseSheet; -import com.github.romualdrousseau.archery.util.Disk; +import com.github.romualdrousseau.archery.commons.io.Disk; import com.linuxense.javadbf.DBFReader; public class DbfDocument extends BaseDocument { diff --git a/archery-dbf/src/main/java/com/github/romualdrousseau/archery/loader/dbf/DbfSheet.java b/archery-dbf/src/main/java/com/github/romualdrousseau/archery/loader/dbf/DbfSheet.java index b9f7f3b7..d5899d87 100644 --- a/archery-dbf/src/main/java/com/github/romualdrousseau/archery/loader/dbf/DbfSheet.java +++ b/archery-dbf/src/main/java/com/github/romualdrousseau/archery/loader/dbf/DbfSheet.java @@ -9,9 +9,9 @@ import java.util.List; import com.github.romualdrousseau.archery.base.PatcheableSheetStore; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrame; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrameWriter; -import com.github.romualdrousseau.archery.commons.bigdata.Row; +import com.github.romualdrousseau.archery.commons.collections.DataFrame; +import com.github.romualdrousseau.archery.commons.collections.DataFrameWriter; +import com.github.romualdrousseau.archery.commons.collections.Row; import com.github.romualdrousseau.archery.commons.strings.StringUtils; import com.linuxense.javadbf.DBFField; import com.linuxense.javadbf.DBFReader; diff --git a/archery-dbf/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java b/archery-dbf/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java new file mode 100644 index 00000000..f46854ae --- /dev/null +++ b/archery-dbf/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java @@ -0,0 +1,11 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags({"unit", "full"}) +@SelectPackages("com.github.romualdrousseau.archery") +public class FullTestSuite { +} diff --git a/archery-dbf/src/test/java/com/github/romualdrousseau/archery/AppTest.java b/archery-dbf/src/test/java/com/github/romualdrousseau/archery/Test_DBF.java similarity index 95% rename from archery-dbf/src/test/java/com/github/romualdrousseau/archery/AppTest.java rename to archery-dbf/src/test/java/com/github/romualdrousseau/archery/Test_DBF.java index c764f1bc..fdcadf20 100644 --- a/archery-dbf/src/test/java/com/github/romualdrousseau/archery/AppTest.java +++ b/archery-dbf/src/test/java/com/github/romualdrousseau/archery/Test_DBF.java @@ -7,17 +7,19 @@ import java.io.File; import java.net.URISyntaxException; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Tag; /** * Unit test for simple App. */ -public class AppTest { +public class Test_DBF { /** * Rigorous Test :-) */ @Test + @Tag("unit") public void testReadWithoutIntelliTag() { final File file = this.getResourceFile("Slovakia - Phoenix - Sales - 202306.dbf"); @@ -37,6 +39,7 @@ public void testReadWithoutIntelliTag() { * Rigorous Test :-) */ @Test + @Tag("unit") public void testReadWithIntelliTag() { final File file = this.getResourceFile("Slovakia - Phoenix - Sales - 202306.dbf"); diff --git a/archery-dbf/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java b/archery-dbf/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java new file mode 100644 index 00000000..011a5909 --- /dev/null +++ b/archery-dbf/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java @@ -0,0 +1,13 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.ExcludeTags; +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags("unit") +@ExcludeTags("full") +@SelectPackages("com.github.romualdrousseau.archery") +public class UnitTestSuite { +} diff --git a/archery-excel/src/main/java/com/github/romualdrousseau/archery/loader/excel/xlsx/ContentHandler.java b/archery-excel/src/main/java/com/github/romualdrousseau/archery/loader/excel/xlsx/ContentHandler.java index 2ed0ec14..0f14e299 100644 --- a/archery-excel/src/main/java/com/github/romualdrousseau/archery/loader/excel/xlsx/ContentHandler.java +++ b/archery-excel/src/main/java/com/github/romualdrousseau/archery/loader/excel/xlsx/ContentHandler.java @@ -6,9 +6,9 @@ import java.util.ArrayList; import java.util.List; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrame; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrameWriter; -import com.github.romualdrousseau.archery.commons.bigdata.Row; +import com.github.romualdrousseau.archery.commons.collections.DataFrame; +import com.github.romualdrousseau.archery.commons.collections.DataFrameWriter; +import com.github.romualdrousseau.archery.commons.collections.Row; import com.github.romualdrousseau.archery.commons.strings.StringUtils; import org.apache.poi.ss.usermodel.BorderStyle; diff --git a/archery-excel/src/main/java/com/github/romualdrousseau/archery/loader/excel/xlsx/XlsxSheet.java b/archery-excel/src/main/java/com/github/romualdrousseau/archery/loader/excel/xlsx/XlsxSheet.java index 76566061..bf14c66c 100644 --- a/archery-excel/src/main/java/com/github/romualdrousseau/archery/loader/excel/xlsx/XlsxSheet.java +++ b/archery-excel/src/main/java/com/github/romualdrousseau/archery/loader/excel/xlsx/XlsxSheet.java @@ -10,8 +10,8 @@ import javax.xml.parsers.SAXParserFactory; import com.github.romualdrousseau.archery.base.PatcheableSheetStore; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrame; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrameWriter; +import com.github.romualdrousseau.archery.commons.collections.DataFrame; +import com.github.romualdrousseau.archery.commons.collections.DataFrameWriter; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.xssf.model.SharedStrings; diff --git a/archery-excel/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java b/archery-excel/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java new file mode 100644 index 00000000..f46854ae --- /dev/null +++ b/archery-excel/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java @@ -0,0 +1,11 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags({"unit", "full"}) +@SelectPackages("com.github.romualdrousseau.archery") +public class FullTestSuite { +} diff --git a/archery-excel/src/test/java/com/github/romualdrousseau/archery/AppTest.java b/archery-excel/src/test/java/com/github/romualdrousseau/archery/Test_Excel.java similarity index 96% rename from archery-excel/src/test/java/com/github/romualdrousseau/archery/AppTest.java rename to archery-excel/src/test/java/com/github/romualdrousseau/archery/Test_Excel.java index 131a9bc8..783caead 100644 --- a/archery-excel/src/test/java/com/github/romualdrousseau/archery/AppTest.java +++ b/archery-excel/src/test/java/com/github/romualdrousseau/archery/Test_Excel.java @@ -7,17 +7,19 @@ import java.io.File; import java.net.URISyntaxException; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Tag; /** * Unit test for simple App. */ -public class AppTest { +public class Test_Excel { /** * Rigorous Test :-) */ @Test + @Tag("unit") public void testReadWithoutIntelliLayexAndTag() { final File file = this.getResourceFile("Results_Gidy_FY2324.xlsx"); @@ -38,6 +40,7 @@ public void testReadWithoutIntelliLayexAndTag() { * Rigorous Test :-) */ @Test + @Tag("unit") public void testReadWithIntelliLayexAndTag() { final File file = this.getResourceFile("HongKong - ZUELLIG - Sales - 20220305.xlsx"); @@ -59,6 +62,7 @@ public void testReadWithIntelliLayexAndTag() { * Rigorous Test :-) */ @Test + @Tag("unit") public void testReadWithIntelliLayex() { final File file = this.getResourceFile("HongKong - ZUELLIG - Sales - 20220305.xlsx"); @@ -80,6 +84,7 @@ public void testReadWithIntelliLayex() { * Rigorous Test :-) */ @Test + @Tag("unit") public void testReadWithIntelliLayexWithRecipe() { final File file = this.getResourceFile("HongKong - ZUELLIG - Sales - 20220305.xlsx"); diff --git a/archery-excel/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java b/archery-excel/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java new file mode 100644 index 00000000..011a5909 --- /dev/null +++ b/archery-excel/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java @@ -0,0 +1,13 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.ExcludeTags; +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags("unit") +@ExcludeTags("full") +@SelectPackages("com.github.romualdrousseau.archery") +public class UnitTestSuite { +} diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/LayexTableParser.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/LayexTableParser.java index 4bad12be..82d6cf6b 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/LayexTableParser.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/LayexTableParser.java @@ -12,13 +12,13 @@ import com.github.romualdrousseau.archery.base.DataTable; import com.github.romualdrousseau.archery.base.MetaTable; import com.github.romualdrousseau.archery.header.MetaHeader; +import com.github.romualdrousseau.archery.parser.layex.Layex; +import com.github.romualdrousseau.archery.parser.layex.TableLexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; import com.github.romualdrousseau.archery.parser.table.DataTableGroupSubFooterParserFactory; import com.github.romualdrousseau.archery.parser.table.DataTableGroupSubHeaderParserFactory; import com.github.romualdrousseau.archery.parser.table.DataTableParserFactory; import com.github.romualdrousseau.archery.parser.table.MetaTableParser; -import com.github.romualdrousseau.archery.layex.Layex; -import com.github.romualdrousseau.archery.layex.TableLexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; public class LayexTableParser extends SimpleTableParser { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/Layex.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/Layex.java similarity index 86% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/Layex.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/Layex.java index ee18663b..4b9fdff9 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/Layex.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/Layex.java @@ -1,19 +1,19 @@ -package com.github.romualdrousseau.archery.layex; +package com.github.romualdrousseau.archery.parser.layex; import java.util.ArrayDeque; import java.util.Deque; -import com.github.romualdrousseau.archery.layex.operations.Any; -import com.github.romualdrousseau.archery.layex.operations.Many; -import com.github.romualdrousseau.archery.layex.operations.Concat; -import com.github.romualdrousseau.archery.layex.operations.EndOfRow; -import com.github.romualdrousseau.archery.layex.operations.Group; -import com.github.romualdrousseau.archery.layex.operations.Literal; -import com.github.romualdrousseau.archery.layex.operations.LiteralNeg; -import com.github.romualdrousseau.archery.layex.operations.Nop; -import com.github.romualdrousseau.archery.layex.operations.Or; -import com.github.romualdrousseau.archery.layex.operations.Value; -import com.github.romualdrousseau.archery.layex.operations.ValueNeg; +import com.github.romualdrousseau.archery.parser.layex.operations.Any; +import com.github.romualdrousseau.archery.parser.layex.operations.Concat; +import com.github.romualdrousseau.archery.parser.layex.operations.EndOfRow; +import com.github.romualdrousseau.archery.parser.layex.operations.Group; +import com.github.romualdrousseau.archery.parser.layex.operations.Literal; +import com.github.romualdrousseau.archery.parser.layex.operations.LiteralNeg; +import com.github.romualdrousseau.archery.parser.layex.operations.Many; +import com.github.romualdrousseau.archery.parser.layex.operations.Nop; +import com.github.romualdrousseau.archery.parser.layex.operations.Or; +import com.github.romualdrousseau.archery.parser.layex.operations.Value; +import com.github.romualdrousseau.archery.parser.layex.operations.ValueNeg; public class Layex { public Layex(final String layex) { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/Lexer.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/Lexer.java similarity index 79% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/Lexer.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/Lexer.java index aa09ccf7..70f00ab7 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/Lexer.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/Lexer.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.layex; +package com.github.romualdrousseau.archery.parser.layex; import com.github.romualdrousseau.archery.base.Symbol; diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/StringLexer.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/StringLexer.java similarity index 95% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/StringLexer.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/StringLexer.java index d09e321e..ebe5e6bd 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/StringLexer.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/StringLexer.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.layex; +package com.github.romualdrousseau.archery.parser.layex; import java.util.ArrayDeque; import java.util.Deque; diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/StringSymbol.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/StringSymbol.java similarity index 90% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/StringSymbol.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/StringSymbol.java index 903aa923..d3610108 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/StringSymbol.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/StringSymbol.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.layex; +package com.github.romualdrousseau.archery.parser.layex; import com.github.romualdrousseau.archery.base.Symbol; diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/TableLexer.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/TableLexer.java similarity index 98% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/TableLexer.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/TableLexer.java index 5b14225d..6f879670 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/TableLexer.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/TableLexer.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.layex; +package com.github.romualdrousseau.archery.parser.layex; import java.util.ArrayDeque; import java.util.Deque; diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/TableMatcher.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/TableMatcher.java similarity index 82% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/TableMatcher.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/TableMatcher.java index d132276e..284bb4b6 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/TableMatcher.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/TableMatcher.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.layex; +package com.github.romualdrousseau.archery.parser.layex; import com.github.romualdrousseau.archery.base.Symbol; diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/TableParser.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/TableParser.java similarity index 92% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/TableParser.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/TableParser.java index bce8a37d..00bc940f 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/TableParser.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/TableParser.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.layex; +package com.github.romualdrousseau.archery.parser.layex; import com.github.romualdrousseau.archery.base.Symbol; diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Any.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Any.java similarity index 70% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Any.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Any.java index 89f4ec7c..1103406f 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Any.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Any.java @@ -1,9 +1,9 @@ -package com.github.romualdrousseau.archery.layex.operations; +package com.github.romualdrousseau.archery.parser.layex.operations; import com.github.romualdrousseau.archery.base.Symbol; -import com.github.romualdrousseau.archery.layex.TableParser; -import com.github.romualdrousseau.archery.layex.Lexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.Lexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class Any implements TableMatcher { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Concat.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Concat.java similarity index 75% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Concat.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Concat.java index 7185cfef..440a569b 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Concat.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Concat.java @@ -1,11 +1,11 @@ -package com.github.romualdrousseau.archery.layex.operations; +package com.github.romualdrousseau.archery.parser.layex.operations; import java.util.Deque; import com.github.romualdrousseau.archery.base.Symbol; -import com.github.romualdrousseau.archery.layex.TableParser; -import com.github.romualdrousseau.archery.layex.Lexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.Lexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class Concat implements TableMatcher { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/EndOfRow.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/EndOfRow.java similarity index 69% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/EndOfRow.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/EndOfRow.java index 66e8e16a..97229808 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/EndOfRow.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/EndOfRow.java @@ -1,9 +1,9 @@ -package com.github.romualdrousseau.archery.layex.operations; +package com.github.romualdrousseau.archery.parser.layex.operations; import com.github.romualdrousseau.archery.base.Symbol; -import com.github.romualdrousseau.archery.layex.TableParser; -import com.github.romualdrousseau.archery.layex.Lexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.Lexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class EndOfRow implements TableMatcher { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Group.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Group.java similarity index 76% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Group.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Group.java index 841deeda..c84f1adc 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Group.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Group.java @@ -1,12 +1,12 @@ -package com.github.romualdrousseau.archery.layex.operations; +package com.github.romualdrousseau.archery.parser.layex.operations; import java.util.Deque; import com.github.romualdrousseau.archery.base.Symbol; -import com.github.romualdrousseau.archery.layex.TableParser; -import com.github.romualdrousseau.archery.layex.Lexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.Lexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class Group implements TableMatcher { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Literal.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Literal.java similarity index 74% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Literal.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Literal.java index 6610236f..713839cb 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Literal.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Literal.java @@ -1,9 +1,9 @@ -package com.github.romualdrousseau.archery.layex.operations; +package com.github.romualdrousseau.archery.parser.layex.operations; import com.github.romualdrousseau.archery.base.Symbol; -import com.github.romualdrousseau.archery.layex.TableParser; -import com.github.romualdrousseau.archery.layex.Lexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.Lexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class Literal implements TableMatcher { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/LiteralNeg.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/LiteralNeg.java similarity index 75% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/LiteralNeg.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/LiteralNeg.java index 61b81f12..7bb037f5 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/LiteralNeg.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/LiteralNeg.java @@ -1,9 +1,9 @@ -package com.github.romualdrousseau.archery.layex.operations; +package com.github.romualdrousseau.archery.parser.layex.operations; import com.github.romualdrousseau.archery.base.Symbol; -import com.github.romualdrousseau.archery.layex.TableParser; -import com.github.romualdrousseau.archery.layex.Lexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.Lexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class LiteralNeg implements TableMatcher { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Many.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Many.java similarity index 82% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Many.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Many.java index 86950e9f..892f95d6 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Many.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Many.java @@ -1,12 +1,12 @@ -package com.github.romualdrousseau.archery.layex.operations; +package com.github.romualdrousseau.archery.parser.layex.operations; import java.util.Deque; import com.github.romualdrousseau.archery.base.Symbol; -import com.github.romualdrousseau.archery.layex.TableParser; -import com.github.romualdrousseau.archery.layex.Lexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.Lexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class Many implements TableMatcher { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Nop.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Nop.java similarity index 56% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Nop.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Nop.java index 023cef98..fd75b328 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Nop.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Nop.java @@ -1,9 +1,9 @@ -package com.github.romualdrousseau.archery.layex.operations; +package com.github.romualdrousseau.archery.parser.layex.operations; import com.github.romualdrousseau.archery.base.Symbol; -import com.github.romualdrousseau.archery.layex.TableParser; -import com.github.romualdrousseau.archery.layex.Lexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.Lexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class Nop implements TableMatcher { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Not.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Not.java similarity index 73% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Not.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Not.java index 2ee97514..85e0702e 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Not.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Not.java @@ -1,11 +1,11 @@ -package com.github.romualdrousseau.archery.layex.operations; +package com.github.romualdrousseau.archery.parser.layex.operations; import java.util.LinkedList; import com.github.romualdrousseau.archery.base.Symbol; -import com.github.romualdrousseau.archery.layex.TableParser; -import com.github.romualdrousseau.archery.layex.Lexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.Lexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class Not implements TableMatcher { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Or.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Or.java similarity index 78% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Or.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Or.java index 993e7894..afcb4019 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Or.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Or.java @@ -1,12 +1,12 @@ -package com.github.romualdrousseau.archery.layex.operations; +package com.github.romualdrousseau.archery.parser.layex.operations; import java.util.Deque; import com.github.romualdrousseau.archery.base.Symbol; -import com.github.romualdrousseau.archery.layex.TableParser; -import com.github.romualdrousseau.archery.layex.Lexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.Lexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class Or implements TableMatcher { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Value.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Value.java similarity index 73% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Value.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Value.java index b8c0bac7..c2be0f19 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/Value.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/Value.java @@ -1,9 +1,9 @@ -package com.github.romualdrousseau.archery.layex.operations; +package com.github.romualdrousseau.archery.parser.layex.operations; import com.github.romualdrousseau.archery.base.Symbol; -import com.github.romualdrousseau.archery.layex.TableParser; -import com.github.romualdrousseau.archery.layex.Lexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.Lexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class Value implements TableMatcher { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/ValueNeg.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/ValueNeg.java similarity index 74% rename from archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/ValueNeg.java rename to archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/ValueNeg.java index bb9024cc..495e574c 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/layex/operations/ValueNeg.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/layex/operations/ValueNeg.java @@ -1,9 +1,9 @@ -package com.github.romualdrousseau.archery.layex.operations; +package com.github.romualdrousseau.archery.parser.layex.operations; import com.github.romualdrousseau.archery.base.Symbol; -import com.github.romualdrousseau.archery.layex.TableParser; -import com.github.romualdrousseau.archery.layex.Lexer; -import com.github.romualdrousseau.archery.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.Lexer; +import com.github.romualdrousseau.archery.parser.layex.TableMatcher; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class ValueNeg implements TableMatcher { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/table/DataTableParser.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/table/DataTableParser.java index 15ee2e07..e30b82bc 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/table/DataTableParser.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/table/DataTableParser.java @@ -3,7 +3,7 @@ import java.util.List; import com.github.romualdrousseau.archery.base.BaseCell; -import com.github.romualdrousseau.archery.layex.TableParser; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public abstract class DataTableParser extends TableParser { diff --git a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/table/MetaTableParser.java b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/table/MetaTableParser.java index f4f51d42..98e93726 100644 --- a/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/table/MetaTableParser.java +++ b/archery-layex-parser/src/main/java/com/github/romualdrousseau/archery/parser/table/MetaTableParser.java @@ -4,7 +4,7 @@ import com.github.romualdrousseau.archery.base.MetaTable; import com.github.romualdrousseau.archery.header.MetaHeader; import com.github.romualdrousseau.archery.header.MetaKeyValueHeader; -import com.github.romualdrousseau.archery.layex.TableParser; +import com.github.romualdrousseau.archery.parser.layex.TableParser; public class MetaTableParser extends TableParser { diff --git a/archery-layex-parser/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java b/archery-layex-parser/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java new file mode 100644 index 00000000..f46854ae --- /dev/null +++ b/archery-layex-parser/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java @@ -0,0 +1,11 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags({"unit", "full"}) +@SelectPackages("com.github.romualdrousseau.archery") +public class FullTestSuite { +} diff --git a/archery-layex-parser/src/test/java/com/github/romualdrousseau/archery/Test_Layexes.java b/archery-layex-parser/src/test/java/com/github/romualdrousseau/archery/Test_Layexes.java index 0625e859..4ef08a6a 100644 --- a/archery-layex-parser/src/test/java/com/github/romualdrousseau/archery/Test_Layexes.java +++ b/archery-layex-parser/src/test/java/com/github/romualdrousseau/archery/Test_Layexes.java @@ -4,10 +4,11 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Tag; -import com.github.romualdrousseau.archery.layex.Layex; -import com.github.romualdrousseau.archery.layex.StringLexer; +import com.github.romualdrousseau.archery.parser.layex.Layex; +import com.github.romualdrousseau.archery.parser.layex.StringLexer; /** @@ -16,6 +17,7 @@ public class Test_Layexes { @Test + @Tag("unit") public void testCompile() throws Exception { final var matcher = new Layex("(()(h+$))(()(v+$)())+(f+$)$").compile(); final var expected = "CONCAT(GROUP(CONCAT(GROUP(NOP),GROUP(CONCAT(MANY(VALUE('h'), 1, 2147483647),EOR)))),CONCAT(GROUP(MANY(CONCAT(GROUP(NOP),CONCAT(GROUP(CONCAT(MANY(VALUE('v'), 1, 2147483647),EOR)),GROUP(NOP))), 1, 2147483647)),CONCAT(GROUP(CONCAT(MANY(VALUE('f'), 1, 2147483647),EOR)),EOR)))"; @@ -23,6 +25,7 @@ public void testCompile() throws Exception { } @Test + @Tag("unit") public void testStringMatch() throws Exception { final var lexer = new StringLexer("hhhh$vvvv$vvvv$vvvv$ffff$$"); final var matcher = new Layex("(()(h+$))(()(v+$)())+(f+$)$").compile(); @@ -31,6 +34,7 @@ public void testStringMatch() throws Exception { } @Test + @Tag("unit") public void testStringDontMatch() throws Exception { final var lexer = new StringLexer("hhhh$vvvv$vvvv$vsvv$ffff$$"); final var matcher = new Layex("(()(h+$))(()(v+$)())+(f+$)$").compile(); diff --git a/archery-layex-parser/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java b/archery-layex-parser/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java new file mode 100644 index 00000000..011a5909 --- /dev/null +++ b/archery-layex-parser/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java @@ -0,0 +1,13 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.ExcludeTags; +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags("unit") +@ExcludeTags("full") +@SelectPackages("com.github.romualdrousseau.archery") +public class UnitTestSuite { +} diff --git a/archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java b/archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java new file mode 100644 index 00000000..f46854ae --- /dev/null +++ b/archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java @@ -0,0 +1,11 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags({"unit", "full"}) +@SelectPackages("com.github.romualdrousseau.archery") +public class FullTestSuite { +} diff --git a/archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/classifier/Test_LLM.java b/archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/Test_LLM.java similarity index 96% rename from archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/classifier/Test_LLM.java rename to archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/Test_LLM.java index 4487e57b..f015af5f 100644 --- a/archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/classifier/Test_LLM.java +++ b/archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/Test_LLM.java @@ -1,4 +1,4 @@ -package com.github.romualdrousseau.archery.classifier; +package com.github.romualdrousseau.archery; import java.io.IOException; import java.net.URISyntaxException; @@ -7,10 +7,9 @@ import java.util.EnumSet; import java.util.stream.StreamSupport; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Tag; -import com.github.romualdrousseau.archery.Document; -import com.github.romualdrousseau.archery.DocumentFactory; import com.github.romualdrousseau.archery.modeldata.DataContractModelBuilder; /** @@ -19,6 +18,7 @@ public class Test_LLM { @Test + @Tag("unit") public void testDocumentPanama() throws IOException, URISyntaxException { final var model = new DataContractModelBuilder() .fromResource(getClass(), "/data-contract-lowes.yml") @@ -46,6 +46,7 @@ public void testDocumentPanama() throws IOException, URISyntaxException { } @Test + @Tag("unit") public void testDocumentHongKongA() throws IOException, URISyntaxException { final var model = new DataContractModelBuilder() .fromResource(getClass(), "/data-contract-zuellig-a.yml") @@ -73,6 +74,7 @@ public void testDocumentHongKongA() throws IOException, URISyntaxException { } @Test + @Tag("unit") public void testDocumentHongKongB() throws IOException, URISyntaxException { final var model = new DataContractModelBuilder() .fromResource(getClass(), "/data-contract-zuellig-b.yml") diff --git a/archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java b/archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java new file mode 100644 index 00000000..011a5909 --- /dev/null +++ b/archery-llm-classifier/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java @@ -0,0 +1,13 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.ExcludeTags; +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags("unit") +@ExcludeTags("full") +@SelectPackages("com.github.romualdrousseau.archery") +public class UnitTestSuite { +} diff --git a/archery-net-classifier/src/main/java/com/github/romualdrousseau/archery/classifier/NetTagClassifier.java b/archery-net-classifier/src/main/java/com/github/romualdrousseau/archery/classifier/NetTagClassifier.java index 269bb981..e0b83795 100644 --- a/archery-net-classifier/src/main/java/com/github/romualdrousseau/archery/classifier/NetTagClassifier.java +++ b/archery-net-classifier/src/main/java/com/github/romualdrousseau/archery/classifier/NetTagClassifier.java @@ -28,10 +28,10 @@ import com.github.romualdrousseau.archery.Model; import com.github.romualdrousseau.archery.Table; import com.github.romualdrousseau.archery.TagClassifier; -import com.github.romualdrousseau.archery.util.Disk; -import com.github.romualdrousseau.archery.util.TempFile; import com.github.romualdrousseau.archery.commons.types.Tensor; import com.github.romualdrousseau.archery.commons.python.PythonManager; +import com.github.romualdrousseau.archery.commons.io.Disk; +import com.github.romualdrousseau.archery.commons.io.TempFile; import com.github.romualdrousseau.archery.commons.json.JSON; import com.github.romualdrousseau.archery.commons.preprocessing.Text; import com.github.romualdrousseau.archery.commons.preprocessing.hasher.VocabularyHasher; diff --git a/archery-net-classifier/src/main/java/com/github/romualdrousseau/archery/classifier/TrainingSetBuilder.java b/archery-net-classifier/src/main/java/com/github/romualdrousseau/archery/classifier/TrainingSetBuilder.java index d91e3dfe..5aebbd44 100644 --- a/archery-net-classifier/src/main/java/com/github/romualdrousseau/archery/classifier/TrainingSetBuilder.java +++ b/archery-net-classifier/src/main/java/com/github/romualdrousseau/archery/classifier/TrainingSetBuilder.java @@ -10,7 +10,7 @@ import java.util.stream.IntStream; import java.util.stream.Stream; -import com.github.romualdrousseau.archery.commons.types.CollectionUtils; +import com.github.romualdrousseau.archery.commons.collections.CollectionUtils; import com.github.romualdrousseau.archery.commons.preprocessing.Text; public class TrainingSetBuilder { diff --git a/archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java b/archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java new file mode 100644 index 00000000..f46854ae --- /dev/null +++ b/archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java @@ -0,0 +1,11 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags({"unit", "full"}) +@SelectPackages("com.github.romualdrousseau.archery") +public class FullTestSuite { +} diff --git a/archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/classifier/Test_TrainingEntry.java b/archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/Test_TrainingEntry.java similarity index 88% rename from archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/classifier/Test_TrainingEntry.java rename to archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/Test_TrainingEntry.java index d598d92c..6fcdb643 100644 --- a/archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/classifier/Test_TrainingEntry.java +++ b/archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/Test_TrainingEntry.java @@ -1,6 +1,9 @@ -package com.github.romualdrousseau.archery.classifier; +package com.github.romualdrousseau.archery; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Tag; + +import com.github.romualdrousseau.archery.classifier.TrainingEntry; import java.util.List; @@ -10,6 +13,7 @@ public class Test_TrainingEntry { @Test + @Tag("unit") public void testTraininEntryEqualities() { final var e1 = new TrainingEntry(List.of(1, 2, 3, 4, 0, 0, 0), List.of(1, 0, 0, 0, 0)); final var e2 = new TrainingEntry(List.of(1, 2, 3, 4, 0, 0, 0), List.of(1, 0, 0, 0, 0)); @@ -22,6 +26,7 @@ public void testTraininEntryEqualities() { } @Test + @Tag("unit") public void testTraininEntryConflicts() { final var e1 = new TrainingEntry(List.of(1, 2, 3, 4, 0, 0, 0), List.of(1, 0, 0, 0, 0)); final var e2 = new TrainingEntry(List.of(1, 2, 3, 4, 0, 0, 0), List.of(0, 1, 0, 0, 0)); @@ -29,6 +34,7 @@ public void testTraininEntryConflicts() { } @Test + @Tag("unit") public void testTraininEntryIndexOfOk() { final var e1 = new TrainingEntry(List.of(1, 2, 3, 4, 0, 0, 0), List.of(1, 0, 0, 0, 0)); final var e2 = new TrainingEntry(List.of(1, 2, 3, 4, 0, 0, 0), List.of(1, 0, 0, 0, 0)); @@ -38,6 +44,7 @@ public void testTraininEntryIndexOfOk() { } @Test + @Tag("unit") public void testTraininEntryIndexOfNg() { final var e1 = new TrainingEntry(List.of(1, 2, 3, 4, 0, 0, 0), List.of(1, 0, 0, 0, 0)); final var e2 = new TrainingEntry(List.of(1, 2, 3, 4, 0, 0, 0), List.of(1, 0, 0, 0, 0)); diff --git a/archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java b/archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java new file mode 100644 index 00000000..011a5909 --- /dev/null +++ b/archery-net-classifier/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java @@ -0,0 +1,13 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.ExcludeTags; +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags("unit") +@ExcludeTags("full") +@SelectPackages("com.github.romualdrousseau.archery") +public class UnitTestSuite { +} diff --git a/archery-parquet/src/main/java/com/github/romualdrousseau/archery/loader/parquet/ParquetDocument.java b/archery-parquet/src/main/java/com/github/romualdrousseau/archery/loader/parquet/ParquetDocument.java index b89a4f7c..838e5c36 100644 --- a/archery-parquet/src/main/java/com/github/romualdrousseau/archery/loader/parquet/ParquetDocument.java +++ b/archery-parquet/src/main/java/com/github/romualdrousseau/archery/loader/parquet/ParquetDocument.java @@ -14,8 +14,8 @@ import com.github.romualdrousseau.archery.Sheet; import com.github.romualdrousseau.archery.base.BaseDocument; import com.github.romualdrousseau.archery.base.BaseSheet; +import com.github.romualdrousseau.archery.commons.io.Disk; import com.github.romualdrousseau.archery.transform.op.DropColumnsWhenFillRatioLessThan; -import com.github.romualdrousseau.archery.util.Disk; public class ParquetDocument extends BaseDocument { diff --git a/archery-parquet/src/main/java/com/github/romualdrousseau/archery/loader/parquet/ParquetSheet.java b/archery-parquet/src/main/java/com/github/romualdrousseau/archery/loader/parquet/ParquetSheet.java index 7a28ca1c..168ce30f 100644 --- a/archery-parquet/src/main/java/com/github/romualdrousseau/archery/loader/parquet/ParquetSheet.java +++ b/archery-parquet/src/main/java/com/github/romualdrousseau/archery/loader/parquet/ParquetSheet.java @@ -7,9 +7,9 @@ import org.apache.parquet.hadoop.ParquetReader; import com.github.romualdrousseau.archery.base.PatcheableSheetStore; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrame; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrameWriter; -import com.github.romualdrousseau.archery.commons.bigdata.Row; +import com.github.romualdrousseau.archery.commons.collections.DataFrame; +import com.github.romualdrousseau.archery.commons.collections.DataFrameWriter; +import com.github.romualdrousseau.archery.commons.collections.Row; import com.github.romualdrousseau.archery.commons.strings.StringUtils; class ParquetSheet extends PatcheableSheetStore implements Closeable { diff --git a/archery-parquet/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java b/archery-parquet/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java new file mode 100644 index 00000000..f46854ae --- /dev/null +++ b/archery-parquet/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java @@ -0,0 +1,11 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags({"unit", "full"}) +@SelectPackages("com.github.romualdrousseau.archery") +public class FullTestSuite { +} diff --git a/archery-parquet/src/test/java/com/github/romualdrousseau/archery/AppTest.java b/archery-parquet/src/test/java/com/github/romualdrousseau/archery/Test_Parquet.java similarity index 94% rename from archery-parquet/src/test/java/com/github/romualdrousseau/archery/AppTest.java rename to archery-parquet/src/test/java/com/github/romualdrousseau/archery/Test_Parquet.java index 268ab1b2..2e91ae1d 100644 --- a/archery-parquet/src/test/java/com/github/romualdrousseau/archery/AppTest.java +++ b/archery-parquet/src/test/java/com/github/romualdrousseau/archery/Test_Parquet.java @@ -6,17 +6,19 @@ import java.io.File; import java.net.URISyntaxException; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Tag; /** * Unit test for simple App. */ -public class AppTest { +public class Test_Parquet { /** * Rigorous Test :-) */ @Test + @Tag("unit") public void testReadWithoutIntelliTag() { final File file = this.getResourceFile("Titanic.parquet"); @@ -36,6 +38,7 @@ public void testReadWithoutIntelliTag() { * Rigorous Test :-) */ @Test + @Tag("unit") public void testBigReadWithoutIntelliTag() { final File file = this.getResourceFile("Flights.parquet"); diff --git a/archery-parquet/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java b/archery-parquet/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java new file mode 100644 index 00000000..011a5909 --- /dev/null +++ b/archery-parquet/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java @@ -0,0 +1,13 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.ExcludeTags; +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags("unit") +@ExcludeTags("full") +@SelectPackages("com.github.romualdrousseau.archery") +public class UnitTestSuite { +} diff --git a/archery-pdf/src/main/java/com/github/romualdrousseau/archery/loader/pdf/PdfDocument.java b/archery-pdf/src/main/java/com/github/romualdrousseau/archery/loader/pdf/PdfDocument.java index 92aa6bae..490a377e 100644 --- a/archery-pdf/src/main/java/com/github/romualdrousseau/archery/loader/pdf/PdfDocument.java +++ b/archery-pdf/src/main/java/com/github/romualdrousseau/archery/loader/pdf/PdfDocument.java @@ -13,7 +13,7 @@ import com.github.romualdrousseau.archery.Sheet; import com.github.romualdrousseau.archery.base.BaseDocument; import com.github.romualdrousseau.archery.base.BaseSheet; -import com.github.romualdrousseau.archery.util.Disk; +import com.github.romualdrousseau.archery.commons.io.Disk; public class PdfDocument extends BaseDocument { diff --git a/archery-pdf/src/main/java/com/github/romualdrousseau/archery/loader/pdf/PdfSheet.java b/archery-pdf/src/main/java/com/github/romualdrousseau/archery/loader/pdf/PdfSheet.java index 95c92048..0368a843 100644 --- a/archery-pdf/src/main/java/com/github/romualdrousseau/archery/loader/pdf/PdfSheet.java +++ b/archery-pdf/src/main/java/com/github/romualdrousseau/archery/loader/pdf/PdfSheet.java @@ -8,9 +8,9 @@ import org.apache.pdfbox.pdmodel.PDDocument; import com.github.romualdrousseau.archery.base.PatcheableSheetStore; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrame; -import com.github.romualdrousseau.archery.commons.bigdata.DataFrameWriter; -import com.github.romualdrousseau.archery.commons.bigdata.Row; +import com.github.romualdrousseau.archery.commons.collections.DataFrame; +import com.github.romualdrousseau.archery.commons.collections.DataFrameWriter; +import com.github.romualdrousseau.archery.commons.collections.Row; import com.github.romualdrousseau.archery.commons.strings.StringUtils; import technology.tabula.ObjectExtractor; diff --git a/archery-pdf/src/test/java/com/github/romualdrousseau/archery/AppTest.java b/archery-pdf/src/test/java/com/github/romualdrousseau/archery/AppTest.java deleted file mode 100644 index 7d7fe18c..00000000 --- a/archery-pdf/src/test/java/com/github/romualdrousseau/archery/AppTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.github.romualdrousseau.archery; - -import org.junit.Test; - -/** - * Unit test for simple App. - */ -public class AppTest { - - /** - * Rigorous Test :-) - */ - @Test - public void testReadWithoutIntelliTag() { - // final File file = this.getResourceFile("Slovakia - Phoenix - Sales - 202306.dbf"); - - // final Model model = ModelDB.createConnection("sales-english"); - - // try (final Document doc = DocumentFactory.createInstance(file, "UTF-8").setModel(model)) { - // doc.sheets().forEach(s -> s.getTable().ifPresent(t -> t.headers().forEach(h -> System.out.print(h.getTag().getValue() + " ")))); - // System.out.println(); - // doc.sheets().forEach(s -> s.getTable().ifPresent(t -> StreamSupport.stream(t.rows().spliterator(), false).limit(5).forEach(r -> { - // r.cells().forEach(c -> System.out.print(c.getValue() + " ")); - // System.out.println(); - // }))); - // } - } - - /** - * Rigorous Test :-) - */ - @Test - public void testReadWithIntelliTag() { - // final File file = this.getResourceFile("Slovakia - Phoenix - Sales - 202306.dbf"); - - // final Model model = ModelDB.createConnection("sales-english"); - - // try (final Document doc = DocumentFactory.createInstance(file, "UTF-8") - // .setModel(model) - // .setHints(EnumSet.of(Document.Hint.INTELLI_TAG))) { - // doc.sheets().forEach(s -> s.getTable().ifPresent(t -> t.headers().forEach(h -> System.out.print(h.getTag().getValue() + " ")))); - // System.out.println(); - // doc.sheets().forEach(s -> s.getTable().ifPresent(t -> StreamSupport.stream(t.rows().spliterator(), false).limit(5).forEach(r -> { - // r.cells().forEach(c -> System.out.print(c.getValue() + " ")); - // System.out.println(); - // }))); - // } - } - - // private File getResourceFile(String resourceName) { - // try { - // URL resourceUrl = this.getClass().getResource(String.format("/data/%s", resourceName)); - // assert resourceUrl != null : resourceName + " not found"; - // return Path.of(resourceUrl.toURI()).toFile(); - // } catch (URISyntaxException x) { - // assert false : x.getMessage(); - // return null; - // } - // } -} diff --git a/archery-pdf/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java b/archery-pdf/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java new file mode 100644 index 00000000..f46854ae --- /dev/null +++ b/archery-pdf/src/test/java/com/github/romualdrousseau/archery/FullTestSuite.java @@ -0,0 +1,11 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags({"unit", "full"}) +@SelectPackages("com.github.romualdrousseau.archery") +public class FullTestSuite { +} diff --git a/archery-pdf/src/test/java/com/github/romualdrousseau/archery/Test_PDF.java b/archery-pdf/src/test/java/com/github/romualdrousseau/archery/Test_PDF.java new file mode 100644 index 00000000..f167d241 --- /dev/null +++ b/archery-pdf/src/test/java/com/github/romualdrousseau/archery/Test_PDF.java @@ -0,0 +1,70 @@ +package com.github.romualdrousseau.archery; + +import java.nio.file.Path; +import java.util.EnumSet; +import java.util.stream.StreamSupport; +import java.net.URL; +import java.io.File; +import java.net.URISyntaxException; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Tag; + +/** + * Unit test for simple App. + */ +public class Test_PDF { + + /** + * Rigorous Test :-) + */ + @Test + @Tag("unit") + public void testReadWithoutIntelliTag() { + final File file = this.getResourceFile("Panama - BM - BGA - Sales - 20230601.pdf"); + + final Model model = ModelDB.createConnection("sales-english"); + + try (final Document doc = DocumentFactory.createInstance(file, "UTF-8").setModel(model)) { + doc.sheets().forEach(s -> s.getTable().ifPresent(t -> t.headers().forEach(h -> System.out.print(h.getTag().getValue() + " ")))); + System.out.println(); + doc.sheets().forEach(s -> s.getTable().ifPresent(t -> StreamSupport.stream(t.rows().spliterator(), false).limit(5).forEach(r -> { + r.cells().forEach(c -> System.out.print(c.getValue() + " ")); + System.out.println(); + }))); + } + } + + /** + * Rigorous Test :-) + */ + @Test + @Tag("unit") + public void testReadWithIntelliTag() { + final File file = this.getResourceFile("Panama - BM - BGA - Sales - 20230601.pdf"); + + final Model model = ModelDB.createConnection("sales-english"); + + try (final Document doc = DocumentFactory.createInstance(file, "UTF-8") + .setModel(model) + .setHints(EnumSet.of(Document.Hint.INTELLI_TAG))) { + doc.sheets().forEach(s -> s.getTable().ifPresent(t -> t.headers().forEach(h -> System.out.print(h.getTag().getValue() + " ")))); + System.out.println(); + doc.sheets().forEach(s -> s.getTable().ifPresent(t -> StreamSupport.stream(t.rows().spliterator(), false).limit(5).forEach(r -> { + r.cells().forEach(c -> System.out.print(c.getValue() + " ")); + System.out.println(); + }))); + } + } + + private File getResourceFile(String resourceName) { + try { + URL resourceUrl = this.getClass().getResource(String.format("/data/%s", resourceName)); + assert resourceUrl != null : resourceName + " not found"; + return Path.of(resourceUrl.toURI()).toFile(); + } catch (URISyntaxException x) { + assert false : x.getMessage(); + return null; + } + } +} diff --git a/archery-pdf/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java b/archery-pdf/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java new file mode 100644 index 00000000..011a5909 --- /dev/null +++ b/archery-pdf/src/test/java/com/github/romualdrousseau/archery/UnitTestSuite.java @@ -0,0 +1,13 @@ +package com.github.romualdrousseau.archery; + +import org.junit.platform.suite.api.ExcludeTags; +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeTags("unit") +@ExcludeTags("full") +@SelectPackages("com.github.romualdrousseau.archery") +public class UnitTestSuite { +} diff --git a/archery-pdf/src/test/resources/data/Panama - BM - BGA - Sales - 20230601.pdf b/archery-pdf/src/test/resources/data/Panama - BM - BGA - Sales - 20230601.pdf new file mode 100644 index 0000000000000000000000000000000000000000..50a90f53b985ed69b65e5f62b4a0c116775176af GIT binary patch literal 12426 zcmeHNZExGU75*L||KR|0u(XRUQST~>i#dL2jXH54yDwQg42rEZ-W)5il-~CK$$i*A z*#5|#Ly@wSWH(uzZ4Ooju_*G8JbZNYoI{FxC*6Kiw4B|Yy}$qCuYcR!5oA(&_UGN5 zmoImBjLs^F^Le`L#(6^f-4~W=*`{X-5txn$o@t46Mf;sNkFTy5IR!1NWw!j#6`lYPSND2pLTbW3!`8I$B|PJhH8{S>WPVbaOyd*q>UM0=g|dNog0waS2kJ1cqY>iBkT{K>bg zgbbeOBK^#Bi$5nBIouQOM%VdbzC?jr6jb|RnKi0KKe9F29VN4Qe3*X4v`qX7(+tQH zmYf)L$IJwz-ppqiBtq_+tE#>8fH!;B+MwyWlm2{_p*w!Ytno0e+*Lbdqh9yn~d zG&$!xlO|LC`I*P$(jk{lp3}be*pGGXv=2{D`Vn_`I68c+UWuO31W{3;^5LsCy;`N$ zS2Q}OPI`G2FXwnxa!j~G!!gZb;BlT#|3dL{M&o#qWX1^|>IEb+iju2zl`HjxVS0vT zlW<a?T5VUNaqw=Jova<6$A&leQWW~(I2 zUQn`{Pg_~MoL(fqw65Y+{`)LheL-l~nx>ckoeA*UDn}CQ@v15_$|uk>ol$QoLm68b zN9|LC183@7ujE_)EkR_I<(L5nJL!^082#R1Aw;7ky=IF!ix-$HOyvv)Gh?wMaKHt3 zOjl{fZ3~lItMbrXRpn;0`G984=9nflq7J=jQj^BirXj(02(8yQ)P=|pe{BS*TvtsG z80A+)swxk#guucfo37?pygIqj?Co+cU#!uwtdN(^+elJ^z7E^t32I+OqxX~7s=cnm zZ6!-mR0)njzz@QC z3(Zb@ZK=AxR>m)7P*$z3<}2d&XR9jTFTE8KPh910yFY}5PTGgV-egR!XHd$OP*4xG@FS!y^3foG|_ePF{iLDcaf+BVun z`Tf6Dls(Us39W=>Vk5v*Lvc3-mvW{|RSvi>UpA^|YR&3Z|N5?~a(B=^8gwE6eH4*b zKcXP=*Pwk*((Gu~4@834hwRe6Q*Ff&1y1Qe{i6 zxifm#i^ivLv(c-;@!+^eZcEXIUEvIAJD5oUo~6vkS2+843hep4wKaR#8IlS7;S2RH zARpLvDY}U@3y;V4L!XWM(|%As)$JsWhi1B6Dv)XfPn+g?zLem~5X>-bFfPT;aC+Yj?e)SL98_6M?Bu3@%3 z%Y_GoKOD0|Tf>YELzzmWDQ*?a3?pC$1s5KWE5QybHH52Lqtx=;$AMXTSkn}~9XutN z$u&f)0&*Q@ON9z0b_IlCaZxbiawp7|Uj!x)ZrG-TS&D9A&92FPN|?i^1hX&=7<6gM zm_yZ?tr}_QNJFpu!M7ZwRk_&>6to};OA;u9j6C4cq8q_1xu0PU{U-pkbb;+7*s_9H zM$dqx4zsV!xVYE~LhOIZ6o8w7op6*jOAb~o5YUCzI`1F^(V`o{EQ24w?7#xHpPMzz zFlNCKhF+%BVHRfHniae{(g;8v;AU(aYSL)<;9!{mvoP1I6W8;ls14DLV3u!^gjqZR znBTRB-O-2kG4^NcAQ$1YUY=kxSSDqb#f^^duu5Qs2yw~KOxvoda>u1wt=(XovdsUdXW43wQfFBhrd z2NsJWKG@KlJr3SY)552Bz`b5*ZgJqOVV1n1fU3bvcHNv+h+!%CEJSR;4)I6{GmakU zjv78#Tct*b2c|_gGH1zHfY}W>)Yx{Iu{t@y@&x9Lx1NKIf}*Oi0`U#484-rE=BMBTD=@3jxulLN%$Bl8MH=c(L&@Zf z_yGu(){HYW%7Cfi`N|)HKp1i@x`{P=2*4H0Pa$xwZP68*M;e|g%xX77U$lsVlC4@h zHeIz|2G)HbR_0pt*yw5L`>xepMY$1b2_`Pvk#d$)Uef)ys9qH;D#W@Y}{TH8nJNU}WLJbifSfPrRxZppZsw&?etxy>s zsz<9Cj&|OmvTReOgxj4wcFC`+{Me&CN`F}d;kQiWxh{5%xJD)TDw(5YSteYJ$*EFi1-Iqw zJLDXED7x9!#YW7{G7n6DqfCBcxLForFW^=gj`P*agb4BFuPn<~I8w!j;pOrE@%)!W z!eB&cn&S&>an^9KJWufvU)^-+0.5.0 4.13.2 - 1.10.2 + 1.11.0 + 5.11.0 3.0 @@ -119,6 +120,18 @@ ${junit.version} test + + org.junit.platform + junit-platform-suite + ${junit-platform.version} + test + + + org.junit.jupiter + junit-jupiter-api + ${junit-jupiter.version} + test + org.hamcrest hamcrest