diff --git a/src/test/java/com/demcha/documentation/EnginePoiIsolationGuardTest.java b/src/test/java/com/demcha/documentation/EnginePoiIsolationGuardTest.java new file mode 100644 index 00000000..86d00eea --- /dev/null +++ b/src/test/java/com/demcha/documentation/EnginePoiIsolationGuardTest.java @@ -0,0 +1,92 @@ +package com.demcha.documentation; + +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Architectural guard that keeps Apache POI out of the lean engine module. + * + *
The semantic DOCX/PPTX backend — the only code that ever touched POI — + * lives in the separate {@code graph-compose-render-docx} module. The engine + * (root module) must stay free of every {@code org.apache.poi.*} import or + * fully-qualified reference so it never drags {@code poi-ooxml} back onto its + * classpath.
+ * + *This freezes that invariant at the source level: the retired {@code no-poi} + * CI job only ran the suite without POI on the classpath, it never + * asserted the sources were POI-free. Mirrors + * {@link PdfBackendIsolationGuardTest}'s grep-style walk/assert.
+ */ +class EnginePoiIsolationGuardTest { + + private static final Path PROJECT_ROOT = Path.of("").toAbsolutePath().normalize(); + private static final String POI_IMPORT_PREFIX = "import org.apache.poi."; + private static final String POI_REFERENCE = "org.apache.poi."; + + private static final List