Skip to content

Commit b94542b

Browse files
committed
chore: better coverage
1 parent 249a384 commit b94542b

File tree

5 files changed

+26
-13
lines changed

5 files changed

+26
-13
lines changed

fj-doc-mod-fop/src/main/java/org/fugerit/java/doc/mod/fop/PdfFopTypeHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class PdfFopTypeHandler extends FreeMarkerFopTypeHandler {
5050

5151
public static final String ATT_FOP_CONFIG_CLASSLOADER_PATH = "fop-config-classloader-path";
5252

53-
public static final String ATT_FOP_CONFIG_RESOLVER_TYPE = "fop-config-resover-type";
53+
public static final String ATT_FOP_CONFIG_RESOLVER_TYPE = "fop-config-resolver-type";
5454

5555
public static final String ATT_FOP_CONFIG_RESOLVER_TYPE_DEFAULT = FopConfigClassLoaderWrapper.DEFAULT_RESOURCE_RESOLVER.getClass().getName();
5656

@@ -232,7 +232,7 @@ protected void handleConfigTag(Element config) throws ConfigException {
232232
Properties props = DOMUtils.attributesToProperties( config );
233233
String fopConfigMode = props.getProperty( ATT_FOP_CONFIG_MODE );
234234
String fopConfigClassloaderPath = props.getProperty( ATT_FOP_CONFIG_CLASSLOADER_PATH );
235-
String fopConfigResoverType = props.getProperty( ATT_FOP_CONFIG_RESOLVER_TYPE, ATT_FOP_CONFIG_RESOLVER_TYPE_DEFAULT );
235+
String fopConfigResolverType = props.getProperty( ATT_FOP_CONFIG_RESOLVER_TYPE, ATT_FOP_CONFIG_RESOLVER_TYPE_DEFAULT );
236236
String fontBaseClassloaderPath = props.getProperty( ATT_FONT_BASE_CLASSLOADER_PATH );
237237
String pdfUAModConfig = props.getProperty( ATT_PDF_UA_MODE );
238238
// config pdf ua
@@ -261,7 +261,7 @@ protected void handleConfigTag(Element config) throws ConfigException {
261261
this.legacyClassLoaderMode();
262262
}
263263
// setup fop config mode
264-
this.setupFopConfigMode(fopConfigMode, fopConfigResoverType, fopConfigClassloaderPath, config);
264+
this.setupFopConfigMode(fopConfigMode, fopConfigResolverType, fopConfigClassloaderPath, config);
265265
// setup suppress events
266266
this.setSuppressEvents( BooleanUtils.isTrue( props.getProperty( ATT_FOP_SUPPRESS_EVENTS ) ) );
267267
// setup pool

fj-doc-mod-fop/src/test/java/test/org/fugerit/java/doc/mod/fop/TestPdfFopTypeHandler.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,24 @@ private boolean configureHelper( String path ) {
6868
}
6969

7070
@Test
71-
void test003Ok() {
72-
boolean ok = this.configureHelper( "config/test_config_ok.xml" );
73-
Assertions.assertTrue(ok);
71+
void testOk() {
72+
Arrays.asList( "config/test_config_ok.xml",
73+
"config/test_config_ok-alt1.xml",
74+
"config/test_config_ok-alt-2.xml").forEach(
75+
current -> {
76+
boolean ok = this.configureHelper( current );
77+
Assertions.assertTrue(ok);
78+
}
79+
);
80+
7481
}
7582

7683
@Test
7784
void testKo() {
78-
Arrays.asList( "config/test_config_err1.xml", "config/test_config_err2.xml", "config/test_config_err3.xml" ).forEach(
79-
current -> {
80-
Assertions.assertThrows( ConfigRuntimeException.class , () -> {
81-
this.configureHelper( current );
82-
});
83-
}
85+
Arrays.asList( "config/test_config_err1.xml",
86+
"config/test_config_err2.xml",
87+
"config/test_config_err3.xml" ).forEach(
88+
current -> Assertions.assertThrows( ConfigRuntimeException.class , () -> this.configureHelper( current ))
8489
);
8590
}
8691

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<docHandler id="pdf_a-fop" info="pdf" type="org.fugerit.java.doc.mod.fop.PdfFopTypeHandler">
2+
<docHandlerCustomConfig
3+
font-base-classloader-path="font/"/>
4+
</docHandler>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<docHandler id="pdf_a-fop" info="pdf" type="org.fugerit.java.doc.mod.fop.PdfFopTypeHandler">
2+
<docHandlerCustomConfig
3+
fop-config-classloader-path="."/>
4+
</docHandler>

fj-doc-sample/src/main/resources/config/freemarker-doc-process.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
2) fop-config-mode='classloader'
7979
Example : <config fop-config-mode="classloader" fop-config-classloader-path="fop-config.xml"/>
8080
With an optinal attribute :
81-
'fop-config-resover-type' (which default to 'org.fugerit.java.doc.mod.fop.config.ClassLoaderResourceResolverWrapper')
81+
'fop-config-resolver-type' (which default to 'org.fugerit.java.doc.mod.fop.config.ClassLoaderResourceResolverWrapper')
8282
8383
3) fop-config-mode='classloader-legacy' [deprecated, equal to the previous method of classloading, see [0.5.2](https://github.com/fugerit-org/fj-doc/issues/7)
8484
Example 1: <config fop-config-mode='classloader-legacy' fop-config-classloader-path="fop-config.xml" font-base-classloader-path="font/"/>

0 commit comments

Comments
 (0)