-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated parent version to fj-doc 1.4.4 * Typos in documentation * Added JUnit for basic testing
- Loading branch information
Showing
7 changed files
with
114 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
# Changelog for project fj-doc-mod-itext | ||
# Changelog for project fj-doc-mod-openpdf | ||
|
||
## version 0.1.0 - 2023-08-13 | ||
* Updated parent version to fj-doc 1.4.4 | ||
* Typos in documentation | ||
* Added JUnit for basic testing | ||
|
||
## version 0.1.0-rc.001 - 2023-07-22 | ||
* Porting of fj-doc-mod-itext based on [OpenPDF](https://github.com/LibrePDF/OpenPDF) / [OpenRTF](https://github.com/LibrePDF/OpenRTF) |
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
13 changes: 13 additions & 0 deletions
13
src/test/java/test/org/fugerit/java/doc/mod/itext/poc/TestDefaultDoc.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,13 @@ | ||
package test.org.fugerit.java.doc.mod.itext.poc; | ||
|
||
import org.fugerit.java.doc.mod.openpdf.PdfTypeHandler; | ||
import org.junit.Test; | ||
|
||
public class TestDefaultDoc extends TestDocBase { | ||
|
||
@Test | ||
public void testOpenPDF() { | ||
this.testDocWorker( "default_doc" , PdfTypeHandler.HANDLER ); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/test/java/test/org/fugerit/java/doc/mod/itext/poc/TestDocBase.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,34 @@ | ||
package test.org.fugerit.java.doc.mod.itext.poc; | ||
|
||
import static org.junit.Assert.fail; | ||
|
||
import java.io.File; | ||
import java.io.FileOutputStream; | ||
import java.io.InputStreamReader; | ||
import java.io.OutputStream; | ||
|
||
import org.fugerit.java.core.lang.helpers.ClassHelper; | ||
import org.fugerit.java.doc.base.config.DocInput; | ||
import org.fugerit.java.doc.base.config.DocOutput; | ||
import org.fugerit.java.doc.base.config.DocTypeHandler; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
public class TestDocBase { | ||
|
||
protected void testDocWorker( String testCase, DocTypeHandler handler ) { | ||
String inputXml = "xml/"+testCase+".xml" ; | ||
File outputFile = new File( "target", testCase+"."+handler.getType() ); | ||
log.info( "inputXml:{}, outputFile:{}", inputXml, outputFile ); | ||
try ( InputStreamReader reader = new InputStreamReader( ClassHelper.loadFromDefaultClassLoader( inputXml ) ); | ||
OutputStream os = new FileOutputStream( outputFile ) ) { | ||
handler.handle( DocInput.newInput( handler.getType() , reader ) , DocOutput.newOutput(os) ); | ||
} catch (Exception e) { | ||
String message = "Error : "+e.getMessage(); | ||
log.error( message , e ); | ||
fail( message ); | ||
} | ||
} | ||
|
||
} |
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,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Configuration status="WARN"> | ||
<Appenders> | ||
<Console name="Console" target="SYSTEM_OUT"> | ||
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/> | ||
</Console> | ||
</Appenders> | ||
<Loggers> | ||
<Root level="INFO"> | ||
<AppenderRef ref="Console"/> | ||
</Root> | ||
</Loggers> | ||
</Configuration> |
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,45 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<doc | ||
xmlns="http://javacoredoc.fugerit.org" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://javacoredoc.fugerit.org https://www.fugerit.org/data/java/doc/xsd/doc-2-0.xsd" > | ||
|
||
<metadata> | ||
<!-- Margin for document : left;right;top;bottom --> | ||
<info name="margins">10;10;10;30</info> | ||
<info name="excel-table-id">excel-table=print</info> | ||
<!-- documenta meta information --> | ||
<info name="doc-title">Basic example</info> | ||
<info name="doc-subject">fj doc venus sample source xml</info> | ||
<info name="doc-author">fugerit79</info> | ||
<info name="doc-language">en</info> | ||
<!-- font must be loaded --> | ||
<!-- | ||
<info name="default-font-name">TitilliumWeb</info> | ||
--> | ||
<footer-ext> | ||
<para align="right">${r"${currentPage}"} / ${r"${pageCount}"}</para> | ||
</footer-ext> | ||
</metadata> | ||
<body> | ||
<para>My sample title</para> | ||
<table columns="3" colwidths="30;30;40" width="100" id="excel-table" padding="2"> | ||
<row> | ||
<cell align="center" border-color="#000000" border-width="1"><para style="bold">Name</para></cell> | ||
<cell align="center"><para style="bold">Surname</para></cell> | ||
<cell align="center"><para style="bold">Title</para></cell> | ||
</row> | ||
<row> | ||
<cell><para><![CDATA[Luthien]]></para></cell> | ||
<cell><para><![CDATA[Tinuviel]]></para></cell> | ||
<cell><para><![CDATA[Queen]]></para></cell> | ||
</row> | ||
<row> | ||
<cell><para><![CDATA[Thorin]]></para></cell> | ||
<cell><para><![CDATA[Oakshield]]></para></cell> | ||
<cell><para><![CDATA[King]]></para></cell> | ||
</row> | ||
</table> | ||
</body> | ||
|
||
</doc> |