-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fj-doc-mod-fop] better init check for PdfFopTypeHandler
- Loading branch information
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
fj-doc-mod-fop/src/test/java/test/org/fugerit/java/doc/mod/fop/TestInitFreeMarkerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package test.org.fugerit.java.doc.mod.fop; | ||
|
||
import org.fugerit.java.core.cfg.ConfigRuntimeException; | ||
import org.fugerit.java.doc.freemarker.process.FreemarkerDocProcessConfigFacade; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class TestInitFreeMarkerConfig { | ||
|
||
@Test | ||
public void restError() { | ||
try { | ||
FreemarkerDocProcessConfigFacade.loadConfigSafe( "cl://fj-test-error-config.xml" ); | ||
} catch (ConfigRuntimeException e) { | ||
Assert.assertTrue( e.getMessage().contains( "Cannot find fop config path" ) ); | ||
} | ||
|
||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
fj-doc-mod-fop/src/test/resources/fj-test-error-config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<freemarker-doc-process-config | ||
xmlns="https://freemarkerdocprocess.fugerit.org" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://freemarkerdocprocess.fugerit.org https://www.fugerit.org/data/java/doc/xsd/freemarker-doc-process-1-0.xsd" > | ||
|
||
<!-- | ||
Configuration stub version : 006 (2024-10-31) | ||
--> | ||
|
||
|
||
<docHandlerConfig registerById="true" allowDuplicatedId="false"> | ||
|
||
<!-- Simple default PDF FOP Type handler with no added configuration --> | ||
<docHandler id="pdf-fop" info="pdf" type="org.fugerit.java.doc.mod.fop.PdfFopTypeHandler"/> | ||
|
||
<!-- PDF FOP Type handler, set charset to UTF-8, needs a fop configuration file in a specific class loader path --> | ||
<docHandler id="pdf-fop" info="pdf" type="org.fugerit.java.doc.mod.fop.PdfFopTypeHandler"> | ||
<docHandlerCustomConfig charset="UTF-8" fop-config-mode="classloader" fop-config-classloader-path="fop-config-not-exists.xml"/> | ||
</docHandler> | ||
|
||
</docHandlerConfig> | ||
|
||
|
||
<docChain id="shared"> | ||
<chainStep stepType="config"> | ||
<config | ||
id="FJ_DOC_LIB_AUTODOC" | ||
class="org.fugerit.java.doc.lib.autodoc.AutodocModule" | ||
exception-handler="RETHROW_HANDLER" | ||
fallback-on-null-loop-variable="false" | ||
log-exception="false" | ||
mode="class" | ||
path="/fj_doc_lib_autodoc/template/" | ||
version="2.3.29" | ||
wrap-unchecked-exceptions="true" | ||
/> | ||
</chainStep> | ||
</docChain> | ||
|
||
|
||
</freemarker-doc-process-config> |